congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Snapshot.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
org.jclouds.ec2.domain.Snapshot

Best Java code snippets using org.jclouds.ec2.domain.Snapshot.getId (Showing top 20 results out of 315)

origin: jclouds/legacy-jclouds

public boolean apply(Snapshot snapshot) {
 logger.trace("looking for status on snapshot %s", snapshot.getId());
 snapshot = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
      snapshotIds(snapshot.getId())));
 logger.trace("%s: looking for status %s: currently: %s; progress %d/100", snapshot,
      Snapshot.Status.COMPLETED, snapshot.getStatus(), snapshot.getProgress());
 return snapshot.getStatus() == Snapshot.Status.COMPLETED;
}
origin: com.amysta.jclouds.api/ec2

public boolean apply(Snapshot snapshot) {
 logger.trace("looking for status on snapshot %s", snapshot.getId());
 snapshot = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
      snapshotIds(snapshot.getId())));
 logger.trace("%s: looking for status %s: currently: %s; progress %d/100", snapshot,
      Snapshot.Status.COMPLETED, snapshot.getStatus(), snapshot.getProgress());
 return snapshot.getStatus() == Snapshot.Status.COMPLETED;
}
origin: apache/jclouds

@Test(expectedExceptions = AWSResponseException.class)
void testDescribeSnapshotsWithFilterInvalid() {
 String region = defaultRegion;
 SortedSet<Snapshot> allResults = Sets.newTreeSet(client.describeSnapshotsInRegion(region));
 assertNotNull(allResults);
 if (!allResults.isEmpty()) {
   Snapshot snapshot = allResults.last();
   client.describeSnapshotsInRegionWithFilter(region,
       ImmutableMultimap.<String, String>builder()
           .put("invalid-filter", snapshot.getId()).build());
 }
}
origin: apache/jclouds

public boolean apply(Snapshot snapshot) {
 logger.trace("looking for status on snapshot %s", snapshot.getId());
 snapshot = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
      snapshotIds(snapshot.getId())));
 logger.trace("%s: looking for status %s: currently: %s; progress %d/100", snapshot,
      Snapshot.Status.COMPLETED, snapshot.getStatus(), snapshot.getProgress());
 return snapshot.getStatus() == Snapshot.Status.COMPLETED;
}
origin: org.jclouds.api/ec2

public boolean apply(Snapshot snapshot) {
 logger.trace("looking for status on snapshot %s", snapshot.getId());
 snapshot = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
      snapshotIds(snapshot.getId())));
 logger.trace("%s: looking for status %s: currently: %s; progress %d/100", snapshot,
      Snapshot.Status.COMPLETED, snapshot.getStatus(), snapshot.getProgress());
 return snapshot.getStatus() == Snapshot.Status.COMPLETED;
}
origin: org.apache.jclouds.api/ec2

public boolean apply(Snapshot snapshot) {
 logger.trace("looking for status on snapshot %s", snapshot.getId());
 snapshot = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
      snapshotIds(snapshot.getId())));
 logger.trace("%s: looking for status %s: currently: %s; progress %d/100", snapshot,
      Snapshot.Status.COMPLETED, snapshot.getStatus(), snapshot.getProgress());
 return snapshot.getStatus() == Snapshot.Status.COMPLETED;
}
origin: apache/jclouds

@Test(dependsOnMethods = "testDeleteVolumeInRegion")
void testDeleteSnapshotInRegion() {
 client.deleteSnapshotInRegion(defaultRegion, snapshot.getId());
 assert client.describeSnapshotsInRegion(defaultRegion, snapshotIds(snapshot.getId())).size() == 0;
}
origin: apache/jclouds

@Test
void testDescribeSnapshots() {
 String region = defaultRegion;
 SortedSet<Snapshot> allResults = Sets.newTreeSet(client.describeSnapshotsInRegion(region));
 assertNotNull(allResults);
 if (!allResults.isEmpty()) {
   Snapshot snapshot = allResults.last();
   Snapshot result = Iterables.getOnlyElement(client.describeSnapshotsInRegion(region,
       snapshotIds(snapshot.getId())));
   assertNotNull(result);
   assertEquals(result, snapshot);
 }
}
origin: jclouds/legacy-jclouds

@Test
void testDescribeSnapshots() {
 for (String region : ec2Client.getConfiguredRegions()) {
   SortedSet<Snapshot> allResults = Sets.newTreeSet(client.describeSnapshotsInRegion(region));
   assertNotNull(allResults);
   if (allResults.size() >= 1) {
    Snapshot snapshot = allResults.last();
    Snapshot result = Iterables.getOnlyElement(client.describeSnapshotsInRegion(region,
       snapshotIds(snapshot.getId())));
    assertNotNull(result);
    assertEquals(result, snapshot);
   }
 }
}
origin: jclouds/legacy-jclouds

@Test(dependsOnMethods = "testCreateSnapshotInRegion")
public void testGetCreateVolumePermissionForSnapshot() {
 client.getCreateVolumePermissionForSnapshotInRegion(snapshot.getRegion(), snapshot.getId());
}
origin: jclouds/legacy-jclouds

private void verifyImage() {
 assertEquals(ebsImage.getImageType(), ImageType.MACHINE);
 assertEquals(ebsImage.getRootDeviceType(), RootDeviceType.EBS);
 assertEquals(ebsImage.getRootDeviceName(), "/dev/sda1");
 assertEquals(ebsImage.getEbsBlockDevices().entrySet(),
    ImmutableMap.of("/dev/sda1", new Image.EbsBlockDevice(snapshot.getId(), VOLUME_SIZE, true)).entrySet());
}
origin: jclouds/legacy-jclouds

@Test(dependsOnMethods = "testGetCreateVolumePermissionForSnapshot")
void testDeleteSnapshotInRegion() {
 client.deleteSnapshotInRegion(snapshot.getRegion(), snapshot.getId());
 assert client.describeSnapshotsInRegion(snapshot.getRegion(), snapshotIds(snapshot.getId())).size() == 0;
}
origin: apache/jclouds

private void verifyImage() {
 assertEquals(ebsImage.getImageType(), ImageType.MACHINE);
 assertEquals(ebsImage.getRootDeviceType(), RootDeviceType.EBS);
 assertEquals(ebsImage.getRootDeviceName(), "/dev/sda1");
 assertEquals(ebsImage.getEbsBlockDevices().entrySet(),
    ImmutableMap.of("/dev/sda1", new Image.EbsBlockDevice(snapshot.getId(), VOLUME_SIZE, true, "standard", null, false)).entrySet());
}
origin: apache/jclouds

@AfterClass(groups = { "integration", "live" })
@Override
protected void tearDownContext() {
 try {
   client.deleteSnapshotInRegion(defaultRegion, snapshot.getId());
   client.deleteVolumeInRegion(defaultRegion, volumeId);
 } catch (Exception e) {
   // we don't really care about any exception here, so just delete away.
 }
 super.tearDownContext();
}
origin: apache/jclouds

@Test(dependsOnMethods = "testCreateVolumeInAvailabilityZone")
void testCreateSnapshotInRegion() {
 Snapshot snapshot = client.createSnapshotInRegion(defaultRegion, volumeId);
 Predicate<Snapshot> snapshotted = retry(new SnapshotCompleted(client), 600, 10, SECONDS);
 assert snapshotted.apply(snapshot);
 Snapshot result = Iterables.getOnlyElement(client.describeSnapshotsInRegion(defaultRegion,
    snapshotIds(snapshot.getId())));
 assertEquals(result.getProgress(), 100);
 this.snapshot = result;
}
origin: apache/jclouds

public void testFilterSnapshotsWhenResponseIs2xx() {
 HttpResponse filterResponse = HttpResponse.builder().statusCode(200)
     .payload(payloadFromResourceWithContentType("/describe_snapshots.xml", "text/xml")).build();
 EC2Api apiWhenExist = requestsSendResponses(describeRegionsRequest, describeRegionsResponse, filterSnapshots, filterResponse);
 Snapshot snapshot = getOnlyElement(apiWhenExist.getElasticBlockStoreApi().get().describeSnapshotsInRegionWithFilter("us-east-1",
     ImmutableMultimap.<String, String>builder()
         .put("volume-id", "4d826724")
         .build()));
 assertEquals(snapshot.getId(), "snap-78a54011");
}
origin: jclouds/legacy-jclouds

@Test(dependsOnMethods = "testCreateVolumeInAvailabilityZone")
void testCreateSnapshotInRegion() {
 Snapshot snapshot = client.createSnapshotInRegion(defaultRegion, volumeId);
 Predicate<Snapshot> snapshotted = retry(new SnapshotCompleted(client), 600, 10, SECONDS);
 assert snapshotted.apply(snapshot);
 Snapshot result = Iterables.getOnlyElement(client.describeSnapshotsInRegion(snapshot.getRegion(),
    snapshotIds(snapshot.getId())));
 assertEquals(result.getProgress(), 100);
 this.snapshot = result;
}
origin: apache/jclouds

@Test(dependsOnMethods = "testCreateSnapshotInRegion")
void testCreateVolumeFromSnapshotInAvailabilityZone() {
 Volume volume = client.createVolumeFromSnapshotInAvailabilityZone(defaultZone, snapshot.getId());
 assertNotNull(volume);
 Predicate<Volume> availabile = retry(new VolumeAvailable(client), 600, 10, SECONDS);
 assert availabile.apply(volume);
 Volume result = Iterables.getOnlyElement(client.describeVolumesInRegion(defaultRegion, volume.getId()));
 assertEquals(volume.getId(), result.getId());
 assertEquals(volume.getSnapshotId(), snapshot.getId());
 assertEquals(volume.getAvailabilityZone(), defaultZone);
 assertEquals(result.getStatus(), Volume.Status.AVAILABLE);
 client.deleteVolumeInRegion(defaultRegion, result.getId());
}
origin: jclouds/legacy-jclouds

@Test(dependsOnMethods = "testCreateSnapshotInRegion")
void testCreateVolumeFromSnapshotInAvailabilityZone() {
 Volume volume = client.createVolumeFromSnapshotInAvailabilityZone(defaultZone, snapshot.getId());
 assertNotNull(volume);
 Predicate<Volume> availabile = retry(new VolumeAvailable(client), 600, 10, SECONDS);
 assert availabile.apply(volume);
 Volume result = Iterables.getOnlyElement(client.describeVolumesInRegion(snapshot.getRegion(), volume.getId()));
 assertEquals(volume.getId(), result.getId());
 assertEquals(volume.getSnapshotId(), snapshot.getId());
 assertEquals(volume.getAvailabilityZone(), defaultZone);
 assertEquals(result.getStatus(), Volume.Status.AVAILABLE);
 client.deleteVolumeInRegion(snapshot.getRegion(), volume.getId());
}
origin: jclouds/legacy-jclouds

@Test(dependsOnMethods = "testCreateSnapshotInRegion")
void testCreateVolumeFromSnapshotInAvailabilityZoneWithSize() {
 Volume volume = client.createVolumeFromSnapshotInAvailabilityZone(defaultZone, 2, snapshot.getId());
 assertNotNull(volume);
 Predicate<Volume> availabile = retry(new VolumeAvailable(client), 600, 10, SECONDS);
 assert availabile.apply(volume);
 Volume result = Iterables.getOnlyElement(client.describeVolumesInRegion(snapshot.getRegion(), volume.getId()));
 assertEquals(volume.getId(), result.getId());
 assertEquals(volume.getSnapshotId(), snapshot.getId());
 assertEquals(volume.getAvailabilityZone(), defaultZone);
 assertEquals(volume.getSize(), 2);
 assertEquals(result.getStatus(), Volume.Status.AVAILABLE);
 client.deleteVolumeInRegion(snapshot.getRegion(), volume.getId());
}
org.jclouds.ec2.domainSnapshotgetId

Javadoc

The ID of the snapshot.

Popular methods of Snapshot

  • <init>
  • getProgress
    The progress of the snapshot, in percentage.
  • getRegion
    To be removed in jclouds 1.6 WARNING Especially on EC2 clones that may not support regions, this val
  • getStatus
    Snapshot state (e.g., pending, completed, or error)
  • getVolumeSize
    The size of the volume, in GiB.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JCheckBox (javax.swing)
  • JLabel (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now