com.amazonaws.services.ec2.model.Instance.getImageId()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.amazonaws.services.ec2.model.Instance.getImageId()方法的一些代码示例,展示了Instance.getImageId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getImageId()方法的具体详情如下:
包路径:com.amazonaws.services.ec2.model.Instance
类名称:Instance
方法名:getImageId

Instance.getImageId介绍

[英]The ID of the AMI used to launch the instance.
[中]用于启动实例的AMI的ID。

代码示例

代码示例来源:origin: aws/aws-sdk-java

if (getAmiLaunchIndex() != null)
  sb.append("AmiLaunchIndex: ").append(getAmiLaunchIndex()).append(",");
if (getImageId() != null)
  sb.append("ImageId: ").append(getImageId()).append(",");
if (getInstanceId() != null)
  sb.append("InstanceId: ").append(getInstanceId()).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());

代码示例来源:origin: awsdocs/aws-doc-sdk-examples

"and monitoring state %s",
instance.getInstanceId(),
instance.getImageId(),
instance.getInstanceType(),
instance.getState().getName(),

代码示例来源: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.getAmiLaunchIndex() != null && other.getAmiLaunchIndex().equals(this.getAmiLaunchIndex()) == false)
  return false;
if (other.getImageId() == null ^ this.getImageId() == null)
  return false;
if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false)
  return false;
if (other.getInstanceId() == null ^ this.getInstanceId() == null)

代码示例来源:origin: aws-amplify/aws-sdk-android

sb.append("{");
if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ",");
if (getImageId() != null) sb.append("ImageId: " + getImageId() + ",");
if (getState() != null) sb.append("State: " + getState() + ",");
if (getPrivateDnsName() != null) sb.append("PrivateDnsName: " + getPrivateDnsName() + ",");

代码示例来源:origin: aws-amplify/aws-sdk-android

hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); 
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode());

代码示例来源:origin: aws-amplify/aws-sdk-android

if (other.getImageId() == null ^ this.getImageId() == null) return false;
if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; 
if (other.getState() == null ^ this.getState() == null) return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false) return false;

代码示例来源:origin: org.jenkins-ci.plugins/ec2

protected boolean isEc2ProvisionedSlave(Instance i, String ami) {
  // Check if the ami matches
  if (ami == null || StringUtils.equals(ami, i.getImageId())) {
    // Check if there is a ec2slave tag...
    for (Tag tag : i.getTags()) {
      if (StringUtils.equals(tag.getKey(), EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE)) {
        return true;
      }
    }
    return false;
  }
  return false;
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2

if (getAmiLaunchIndex() != null)
  sb.append("AmiLaunchIndex: ").append(getAmiLaunchIndex()).append(",");
if (getImageId() != null)
  sb.append("ImageId: ").append(getImageId()).append(",");
if (getInstanceId() != null)
  sb.append("InstanceId: ").append(getInstanceId()).append(",");

代码示例来源:origin: zalando-stups/fullstop

private void processInstance(String account, String region, Instance instance) {
  final Map<String, Object> metaData = newHashMap();
  metaData.putAll(amiDetailsProvider.getAmiDetails(account, getRegion(fromName(region)), instance.getImageId()));
  final List<String> errorMessages = newArrayList();
  final String instancePublicIpAddress = instance.getPublicIpAddress();

代码示例来源:origin: UrbanCode/terraform

public boolean verify() {
  // will return false if the id is null
  boolean result = false;
  if (instanceId != null) {
    if (ec2Client == null) {
      ec2Client = context.fetchEC2Client();
    }
    List<String> id = new ArrayList<String>();
    id.add(instanceId);
    List<Instance> instances = helper.getInstances(id, ec2Client);
    if (instances != null && !instances.isEmpty()) {
      for (Instance instance : instances) {
        if (instance.getImageId().equals(amiId)) {
          String subId = ((EnvironmentTaskAWS)context.getEnvironment()).getVpc()
                  .findSubnetForName(subnetName).getId();
          if (instance.getSubnetId() != null
            && instance.getSubnetId().equals(subId)
            && verifyElasticIp(instance)
            && verifyKeyPair(instance)
            && verifySize(instance)
            && verifySecurityGroups(instance)) {
            result = true;
          }
        }
      }
    }
  }
  return result;
}

代码示例来源:origin: zalando-stups/fullstop

final Optional<Image> optionalImage = getAmiFromEC2Api(ec2Client, instance.getImageId());
final Optional<Boolean> isTaupageAmi = optionalImage
    .filter(img -> img.getName().startsWith(taupageNamePrefix))

代码示例来源: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());

代码示例来源:origin: jenkinsci/ec2-plugin

if (isEc2ProvisionedAmiSlave(i.getTags(), description)
  && isEc2ProvisionedJenkinsSlave(i.getTags(), jenkinsServerUrl)
  && (template == null || template.getAmi().equals(i.getImageId()))) {
  InstanceStateName stateName = InstanceStateName.fromValue(i.getState().getName());
  if (stateName != InstanceStateName.Terminated && 
    stateName != InstanceStateName.ShuttingDown && 
    stateName != InstanceStateName.Stopped ) {
    LOGGER.log(Level.FINE, "Existing instance found: " + i.getInstanceId() + " AMI: " + i.getImageId()
    + (template != null ? (" Template: " + description) : "") + " Jenkins Server: " + jenkinsServerUrl);
    n++;

代码示例来源: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

this.kernel = instance.getKernelId();
this.key = instance.getKeyName();
this.image = instance.getImageId();
this.privateIP = instance.getPrivateIpAddress();
this.publicIP = instance.getPublicIpAddress();

代码示例来源:origin: com.amazonaws/aws-java-sdk-ec2

if (other.getAmiLaunchIndex() != null && other.getAmiLaunchIndex().equals(this.getAmiLaunchIndex()) == false)
  return false;
if (other.getImageId() == null ^ this.getImageId() == null)
  return false;
if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false)
  return false;
if (other.getInstanceId() == null ^ this.getInstanceId() == null)

相关文章

Instance类方法