org.jclouds.ec2.domain.Volume.getSnapshotId()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.jclouds.ec2.domain.Volume.getSnapshotId()方法的一些代码示例,展示了Volume.getSnapshotId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getSnapshotId()方法的具体详情如下:
包路径:org.jclouds.ec2.domain.Volume
类名称:Volume
方法名:getSnapshotId

Volume.getSnapshotId介绍

暂无

代码示例

代码示例来源: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: apache/jclouds

@Test(dependsOnMethods = "testCreateVolumeFromSnapshotInAvailabilityZone")
void testCreateVolumeFromSnapshotInAvailabilityZoneWithOptions() {
 Volume volume = client.createVolumeInAvailabilityZone(defaultZone,
     fromSnapshotId(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: apache/jclouds

@Test(dependsOnMethods = "testCreateVolumeFromSnapshotInAvailabilityZoneWithOptions")
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(defaultRegion, 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(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());
}

代码示例来源:origin: apache/jclouds

assertEquals(snapshot.getId(), volume.getSnapshotId());

代码示例来源:origin: jclouds/legacy-jclouds

assertEquals(snapshot.getId(), volume.getSnapshotId());

相关文章