本文整理汇总了Java中com.amazonaws.services.ec2.model.Volume.setAvailabilityZone方法的典型用法代码示例。如果您正苦于以下问题:Java Volume.setAvailabilityZone方法的具体用法?Java Volume.setAvailabilityZone怎么用?Java Volume.setAvailabilityZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.ec2.model.Volume
的用法示例。
在下文中一共展示了Volume.setAvailabilityZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createVolume
import com.amazonaws.services.ec2.model.Volume; //导入方法依赖的package包/类
private Volume createVolume(String volId, String snapId, Date createDate, String zone, int size, String state, List<Tag> tags, String instance_id) {
Volume volume = new Volume();
volume.setVolumeId(volId);
volume.setSnapshotId(snapId);
volume.setCreateTime(createDate);
volume.setAvailabilityZone(zone);
volume.setState(state);
volume.setSize(size);
volume.setTags(tags);
if (instance_id != null) {
List<VolumeAttachment> volumeAttachmentList = new ArrayList();
VolumeAttachment volumeAttachment = new VolumeAttachment();
volumeAttachment.setInstanceId(instance_id);
volumeAttachmentList.add(volumeAttachment);
volume.setAttachments(volumeAttachmentList);
}
return volume;
}
示例2: convertObject
import com.amazonaws.services.ec2.model.Volume; //导入方法依赖的package包/类
@Override
protected Volume convertObject(VolumeInfo from) {
Volume to = new Volume();
to.setVolumeId(from.getVolumeId());
Integer size = null;
if (from.getSize() != null && from.getSize().length() != 0) {
size = Integer.valueOf(from.getSize());
}
to.setSize(size);
to.setSnapshotId(from.getSnapshotId());
to.setAvailabilityZone(from.getZone());
to.setState(from.getStatus());
to.setCreateTime(from.getCreateTime().getTime());
to.setAttachments(new VolumeAttachmentConverter().convert(from.getAttachmentInfo()));
// 未実装
to.setTags(null);
return to;
}