本文整理了Java中org.jclouds.ec2.domain.Volume.getAttachments()
方法的一些代码示例,展示了Volume.getAttachments()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getAttachments()
方法的具体详情如下:
包路径:org.jclouds.ec2.domain.Volume
类名称:Volume
方法名:getAttachments
暂无
代码示例来源:origin: jclouds/legacy-jclouds
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
if (volume.getAttachments().size() == 0) {
return false;
}
Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.ATTACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
}
代码示例来源:origin: org.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
if (volume.getAttachments().size() == 0) {
return false;
}
Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.ATTACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
}
代码示例来源:origin: com.amysta.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
if (volume.getAttachments().isEmpty()) {
return false;
}
Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.ATTACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
}
代码示例来源:origin: org.apache.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
if (volume.getAttachments().isEmpty()) {
return false;
}
Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.ATTACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
}
代码示例来源:origin: apache/jclouds
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
if (volume.getAttachments().isEmpty()) {
return false;
}
Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.ATTACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
}
代码示例来源:origin: org.apache.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
/*If attachment size is 0 volume is detached for sure.*/
if (volume.getAttachments().isEmpty()) {
return true;
}
/* But if attachment size is > 0, then the attachment could be in any state.
* So we need to check if the status is DETACHED (return true) or not (return false).
*/
Attachment lastAttachment = getLast(volume.getAttachments());
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.DETACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.DETACHED;
}
}
代码示例来源:origin: apache/jclouds
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
/*If attachment size is 0 volume is detached for sure.*/
if (volume.getAttachments().isEmpty()) {
return true;
}
/* But if attachment size is > 0, then the attachment could be in any state.
* So we need to check if the status is DETACHED (return true) or not (return false).
*/
Attachment lastAttachment = getLast(volume.getAttachments());
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.DETACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.DETACHED;
}
}
代码示例来源:origin: jclouds/legacy-jclouds
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
/*If attachment size is 0 volume is detached for sure.*/
if (volume.getAttachments().size() == 0) {
return true;
}
/* But if attachment size is > 0, then the attachment could be in any state.
* So we need to check if the status is DETACHED (return true) or not (return false).
*/
Attachment lastAttachment = getLast(volume.getAttachments());
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.DETACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.DETACHED;
}
}
代码示例来源:origin: com.amysta.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
/*If attachment size is 0 volume is detached for sure.*/
if (volume.getAttachments().isEmpty()) {
return true;
}
/* But if attachment size is > 0, then the attachment could be in any state.
* So we need to check if the status is DETACHED (return true) or not (return false).
*/
Attachment lastAttachment = getLast(volume.getAttachments());
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.DETACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.DETACHED;
}
}
代码示例来源:origin: org.jclouds.api/ec2
public boolean apply(Attachment attachment) {
logger.trace("looking for volume %s", attachment.getVolumeId());
Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
.getRegion(), attachment.getVolumeId()));
/*If attachment size is 0 volume is detached for sure.*/
if (volume.getAttachments().size() == 0) {
return true;
}
/* But if attachment size is > 0, then the attachment could be in any state.
* So we need to check if the status is DETACHED (return true) or not (return false).
*/
Attachment lastAttachment = getLast(volume.getAttachments());
logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
Attachment.Status.DETACHED, lastAttachment.getStatus());
return lastAttachment.getStatus() == Attachment.Status.DETACHED;
}
}
代码示例来源:origin: apache/jclouds
volume = Iterables.getOnlyElement(client.getElasticBlockStoreApi().get().describeVolumesInRegion(
volume.getRegion(), volume.getId()));
if (!volume.getAttachments().isEmpty()) {
代码示例来源:origin: jclouds/legacy-jclouds
volume = Iterables.getOnlyElement(client.getElasticBlockStoreServices().describeVolumesInRegion(
volume.getRegion(), volume.getId()));
if (volume.getAttachments().size() > 0) {
内容来源于网络,如有侵权,请联系作者删除!