本文整理了Java中org.jclouds.ec2.domain.Volume.getAvailabilityZone()
方法的一些代码示例,展示了Volume.getAvailabilityZone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getAvailabilityZone()
方法的具体详情如下:
包路径:org.jclouds.ec2.domain.Volume
类名称:Volume
方法名:getAvailabilityZone
暂无
代码示例来源:origin: jclouds/legacy-jclouds
@Test
void testCreateVolumeInAvailabilityZone() {
Volume expected = client.createVolumeInAvailabilityZone(defaultZone, 1);
assertNotNull(expected);
assertEquals(expected.getAvailabilityZone(), defaultZone);
this.volumeId = expected.getId();
Set<Volume> result = Sets.newLinkedHashSet(client.describeVolumesInRegion(defaultRegion, expected.getId()));
assertNotNull(result);
assertEquals(result.size(), 1);
Volume volume = result.iterator().next();
assertEquals(volume.getId(), expected.getId());
}
代码示例来源:origin: apache/jclouds
@Test
void testCreateVolumeInAvailabilityZone() {
Volume expected = client.createVolumeInAvailabilityZone(defaultZone,
withSize(1));
assertNotNull(expected);
assertEquals(expected.getAvailabilityZone(), defaultZone);
this.volumeId = expected.getId();
Set<Volume> result = Sets.newLinkedHashSet(client.describeVolumesInRegion(defaultRegion, expected.getId()));
assertNotNull(result);
assertEquals(result.size(), 1);
Volume volume = result.iterator().next();
assertEquals(volume.getId(), expected.getId());
assertEquals(volume.getVolumeType(), expected.getVolumeType());
}
代码示例来源:origin: apache/jclouds
@Test
void testCreateVolumeInAvailabilityZoneWithVolumeType() {
Volume expected = client.createVolumeInAvailabilityZone(defaultZone,
volumeType("gp2"), withSize(1));
assertNotNull(expected);
assertEquals(expected.getAvailabilityZone(), defaultZone);
assertEquals(expected.getVolumeType(), "gp2");
Set<Volume> result = Sets.newLinkedHashSet(client.describeVolumesInRegion(defaultRegion, expected.getId()));
assertNotNull(result);
assertEquals(result.size(), 1);
Volume volume = result.iterator().next();
assertEquals(volume.getId(), expected.getId());
assertEquals(volume.getVolumeType(), expected.getVolumeType());
client.deleteVolumeInRegion(volume.getRegion(), volume.getId());
}
代码示例来源: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 = "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
@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());
}
内容来源于网络,如有侵权,请联系作者删除!