本文整理了Java中org.jclouds.ec2.domain.Volume.getRegion()
方法的一些代码示例,展示了Volume.getRegion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getRegion()
方法的具体详情如下:
包路径:org.jclouds.ec2.domain.Volume
类名称:Volume
方法名:getRegion
[英]To be removed in jclouds 1.6
Especially on EC2 clones that may not support regions, this value is fragile. Consider alternate means to determine context.
[中]将在jclouds 1.6中删除
#####警告
尤其是在可能不支持区域的EC2克隆上,这个值是脆弱的。考虑替代手段来确定上下文。
代码示例来源:origin: jclouds/legacy-jclouds
public boolean apply(Volume volume) {
logger.trace("looking for status on volume %s", volume.getId());
volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume
.getId()));
logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE,
volume.getStatus());
return volume.getStatus() == Volume.Status.AVAILABLE;
}
代码示例来源:origin: org.jclouds.api/ec2
public boolean apply(Volume volume) {
logger.trace("looking for status on volume %s", volume.getId());
volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume
.getId()));
logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE,
volume.getStatus());
return volume.getStatus() == Volume.Status.AVAILABLE;
}
代码示例来源:origin: com.amysta.jclouds.api/ec2
public boolean apply(Volume volume) {
logger.trace("looking for status on volume %s", volume.getId());
volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume
.getId()));
logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE,
volume.getStatus());
return volume.getStatus() == Volume.Status.AVAILABLE;
}
代码示例来源:origin: org.apache.jclouds.api/ec2
public boolean apply(Volume volume) {
logger.trace("looking for status on volume %s", volume.getId());
volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume
.getId()));
logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE,
volume.getStatus());
return volume.getStatus() == Volume.Status.AVAILABLE;
}
代码示例来源:origin: apache/jclouds
public boolean apply(Volume volume) {
logger.trace("looking for status on volume %s", volume.getId());
volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume
.getId()));
logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE,
volume.getStatus());
return volume.getStatus() == Volume.Status.AVAILABLE;
}
代码示例来源: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
client.getElasticBlockStoreApi().get().detachVolumeInRegion(volume.getRegion(), volume.getId(), true);
assert volumeTester.apply(volume);
} catch (Exception e) {
client.getElasticBlockStoreApi().get().deleteVolumeInRegion(volume.getRegion(), volume.getId());
} catch (Exception e) {
e.printStackTrace();
代码示例来源:origin: apache/jclouds
@Test(enabled = false, dependsOnMethods = "testBundleInstance")
void testAMIFromBundle() {
volume = Iterables.getOnlyElement(client.getElasticBlockStoreApi().get().describeVolumesInRegion(
volume.getRegion(), volume.getId()));
if (!volume.getAttachments().isEmpty()) {
snapshot = client.getElasticBlockStoreApi().get().createSnapshotInRegion(volume.getRegion(), volume.getId(),
withDescription("EBS Ubuntu Hardy"));
代码示例来源:origin: jclouds/legacy-jclouds
@Test(enabled = false, dependsOnMethods = "testBundleInstance")
void testAMIFromBundle() {
volume = Iterables.getOnlyElement(client.getElasticBlockStoreServices().describeVolumesInRegion(
volume.getRegion(), volume.getId()));
if (volume.getAttachments().size() > 0) {
snapshot = client.getElasticBlockStoreServices().createSnapshotInRegion(volume.getRegion(), volume.getId(),
withDescription("EBS Ubuntu Hardy"));
代码示例来源:origin: jclouds/legacy-jclouds
client.getElasticBlockStoreServices().detachVolumeInRegion(volume.getRegion(), volume.getId(), true);
assert volumeTester.apply(volume);
} catch (Exception e) {
client.getElasticBlockStoreServices().deleteVolumeInRegion(volume.getRegion(), volume.getId());
} catch (Exception e) {
e.printStackTrace();
代码示例来源:origin: apache/jclouds
Snapshot snapshot = ebsClient.createSnapshotInRegion(volume.getRegion(), volume.getId());
ebsClient.deleteVolumeInRegion(volume.getRegion(), volume.getId());
代码示例来源:origin: jclouds/legacy-jclouds
Snapshot snapshot = ebsClient.createSnapshotInRegion(volume.getRegion(), volume.getId());
ebsClient.deleteVolumeInRegion(volume.getRegion(), volume.getId());
内容来源于网络,如有侵权,请联系作者删除!