本文整理汇总了Java中com.amazonaws.services.ec2.model.Instance.getImageId方法的典型用法代码示例。如果您正苦于以下问题:Java Instance.getImageId方法的具体用法?Java Instance.getImageId怎么用?Java Instance.getImageId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.ec2.model.Instance
的用法示例。
在下文中一共展示了Instance.getImageId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkInstanceIsManagedByDirector
import com.amazonaws.services.ec2.model.Instance; //导入方法依赖的package包/类
/**
* Performs a sequence of strict instance ownership checks to avoid any potential harmful
* accidents.
*
* @param instance the instance
* @param template the template from which the instance was created, or <code>null</code>
* if it is unknown (such as during a delete call)
* @return the virtual instance ID
* @throws IllegalStateException if the instance fails an ownership check
*/
private String checkInstanceIsManagedByDirector(Instance instance, EC2InstanceTemplate template) {
String virtualInstanceId = getVirtualInstanceId(instance.getTags(), "instance");
String instanceIds = instance.getInstanceId() + " / " + virtualInstanceId;
String instanceKeyName = instance.getKeyName();
if (template != null) {
if (!template.getKeyName().equals(Optional.fromNullable(instanceKeyName))) {
LOG.warn("Found unexpected key name: {} for instance: {}", instanceKeyName, instanceIds);
}
String instanceType = instance.getInstanceType();
if (!template.getType().equals(instanceType)) {
LOG.warn("Found unexpected type: {} for instance: {}", instanceType, instanceIds);
}
String instanceImageId = instance.getImageId();
if (!template.getImage().equals(instanceImageId)) {
LOG.warn("Found unexpected image: {} for instance: {}", instanceImageId, instanceIds);
}
}
return virtualInstanceId;
}
示例2: getPropertyValue
import com.amazonaws.services.ec2.model.Instance; //导入方法依赖的package包/类
@Override
protected String getPropertyValue(Instance instance) {
return instance.getImageId();
}