本文整理了Java中com.amazonaws.services.ec2.model.Instance.getInstanceType()
方法的一些代码示例,展示了Instance.getInstanceType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getInstanceType()
方法的具体详情如下:
包路径:com.amazonaws.services.ec2.model.Instance
类名称:Instance
方法名:getInstanceType
[英]The instance type.
[中]实例类型。
代码示例来源:origin: aws/aws-sdk-java
if (getInstanceId() != null)
sb.append("InstanceId: ").append(getInstanceId()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getKernelId() != null)
sb.append("KernelId: ").append(getKernelId()).append(",");
代码示例来源:origin: aws/aws-sdk-java
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode());
hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
代码示例来源:origin: awsdocs/aws-doc-sdk-examples
instance.getInstanceId(),
instance.getImageId(),
instance.getInstanceType(),
instance.getState().getName(),
instance.getMonitoring().getState());
代码示例来源:origin: apache/usergrid
/**
* Constructs and returns an BasicInstance object, using information from <code>ec2</code>
*
* @param ec2
* @return
*/
protected static Instance toInstance( com.amazonaws.services.ec2.model.Instance ec2 ) {
Instance instance;
BasicInstanceSpec spec;
spec = new BasicInstanceSpec();
spec.setImageId( ec2.getImageId() );
spec.setKeyName( ec2.getKeyName() );
spec.setType( ec2.getInstanceType() );
instance = new BasicInstance(
ec2.getInstanceId(),
spec,
InstanceState.fromValue( ec2.getState().getName() ),
ec2.getPrivateDnsName(),
ec2.getPublicDnsName(),
ec2.getPrivateIpAddress(),
ec2.getPublicIpAddress()
);
return instance;
}
代码示例来源:origin: aws/aws-sdk-java
if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getKernelId() == null ^ this.getKernelId() == null)
代码示例来源:origin: aws-amplify/aws-sdk-android
if (getAmiLaunchIndex() != null) sb.append("AmiLaunchIndex: " + getAmiLaunchIndex() + ",");
if (getProductCodes() != null) sb.append("ProductCodes: " + getProductCodes() + ",");
if (getInstanceType() != null) sb.append("InstanceType: " + getInstanceType() + ",");
if (getLaunchTime() != null) sb.append("LaunchTime: " + getLaunchTime() + ",");
if (getPlacement() != null) sb.append("Placement: " + getPlacement() + ",");
代码示例来源:origin: aws-amplify/aws-sdk-android
hashCode = prime * hashCode + ((getAmiLaunchIndex() == null) ? 0 : getAmiLaunchIndex().hashCode());
hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getLaunchTime() == null) ? 0 : getLaunchTime().hashCode());
hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
代码示例来源:origin: UrbanCode/terraform
private boolean verifySize(Instance instance) {
boolean result = false;
String size = sizeType;
if (instance.getInstanceType() != null && size != null) {
if (instance.getInstanceType().equals(size)) {
result = true;
}
}
return result;
}
代码示例来源:origin: stackoverflow.com
HazelcastInstance hzInstance = Hazelcast.newHazelcastInstance(null);
Collection<Instance> instances = hzInstance.getInstances();
Set<Instance> locks = new HashSet<Instance>();
for (Instance inst : instances) {
if(inst.getInstanceType().equals(Instance.InstanceType.LOCK))
locks.add(inst);
}
代码示例来源:origin: aws-amplify/aws-sdk-android
if (other.getProductCodes() == null ^ this.getProductCodes() == null) return false;
if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == false) return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false;
if (other.getLaunchTime() == null ^ this.getLaunchTime() == null) return false;
if (other.getLaunchTime() != null && other.getLaunchTime().equals(this.getLaunchTime()) == false) return false;
代码示例来源:origin: airlift/airship
public static Instance toInstance(com.amazonaws.services.ec2.model.Instance instance, URI internalUri, URI externalUri, String role)
{
return new Instance(instance.getInstanceId(), instance.getInstanceType(), getLocation(instance, role), internalUri, externalUri);
}
代码示例来源:origin: com.proofpoint.galaxy/galaxy-coordinator
public static Instance toInstance(com.amazonaws.services.ec2.model.Instance instance, URI internalUri, URI externalUri, String role)
{
return new Instance(instance.getInstanceId(), instance.getInstanceType(), getLocation(instance, role), internalUri, externalUri);
}
代码示例来源:origin: pinterest/soundwave
String instanceType = instance.getInstanceType();
boolean isSpotInstance = StringUtils.equalsIgnoreCase(
instance.getInstanceLifecycle(), InstanceLifecycleType.Spot.toString());
代码示例来源:origin: org.duracloud/account-management-compute-amazon
@Override
public InstanceType getInstanceType(String providerInstanceId)
throws DuracloudInstanceNotAvailableException {
DescribeInstancesResult result = describeInstance(providerInstanceId);
try {
// Allowed Values: pending, running, shutting-down, terminated
String instanceType = result.getReservations().iterator().next().getInstances()
.iterator().next().getInstanceType();
for (InstanceType it : InstanceType.values()) {
if (convertDuracloudInstanceTypeToNative(it).equals(instanceType)) {
return it;
}
}
String message = "Unable to get instance type for EC2 instance with ID " +
providerInstanceId + ": amazon instance type '" + instanceType + "' unknown to DuraCloud MC.";
throw new DuraCloudRuntimeException(message);
} catch(Exception e) {
String message = "Unable to get instance type for EC2 instance with ID " +
providerInstanceId + " due to error: " + e.getMessage();
log.error(message, e);
throw new DuraCloudRuntimeException(message, e);
}
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2
if (getInstanceId() != null)
sb.append("InstanceId: ").append(getInstanceId()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getKernelId() != null)
sb.append("KernelId: ").append(getKernelId()).append(",");
代码示例来源:origin: jenkinsci/ec2-plugin
privateDNS = i.getPrivateIpAddress();
createdTime = i.getLaunchTime().getTime();
instanceType = i.getInstanceType();
代码示例来源:origin: com.elastisys.scale/cloudpool.aws.commons
.machineSize(instance.getInstanceType()).membershipStatus(membershipStatus).serviceState(serviceState)
.launchTime(launchtime).publicIps(publicIps).privateIps(privateIps).metadata(metadata).build();
代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode());
hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
/**
* @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int)
*/
@Override
public Object getValue(int index) {
switch (index) {
case 0:
return this.instance.getInstanceId();
case 1:
return this.instance.getImageId();
case 2:
return this.instance.getRootDeviceType();
case 3:
return this.instance.getInstanceType();
case 4:
return this.instance.getState().getName();
case 5:
return this.instance.getKeyName();
case 6:
return this.instance.getMonitoring().getState();
case 7:
return this.instance.getVirtualizationType();
case 8:
return this.instance.getPlacement().getGroupName();
default:
return null;
}
}
代码示例来源:origin: airbnb/billow
public EC2Instance(Instance instance) {
this.id = instance.getInstanceId();
this.type = instance.getInstanceType();
this.lifecycle = instance.getInstanceLifecycle();
this.hypervisor = instance.getHypervisor();
内容来源于网络,如有侵权,请联系作者删除!