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

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

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

Instance.getVpcId介绍

[英][EC2-VPC] The ID of the VPC in which the instance is running.
[中][EC2-VPC]实例运行所在VPC的ID。

代码示例

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

if (getSubnetId() != null)
  sb.append("SubnetId: ").append(getSubnetId()).append(",");
if (getVpcId() != null)
  sb.append("VpcId: ").append(getVpcId()).append(",");
if (getArchitecture() != null)
  sb.append("Architecture: ").append(getArchitecture()).append(",");

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

hashCode = prime * hashCode + ((getStateTransitionReason() == null) ? 0 : getStateTransitionReason().hashCode());
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode());
hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode());

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

if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false)
  return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
  return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
  return false;
if (other.getArchitecture() == null ^ this.getArchitecture() == null)

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

if (getMonitoring() != null) sb.append("Monitoring: " + getMonitoring() + ",");
if (getSubnetId() != null) sb.append("SubnetId: " + getSubnetId() + ",");
if (getVpcId() != null) sb.append("VpcId: " + getVpcId() + ",");
if (getPrivateIpAddress() != null) sb.append("PrivateIpAddress: " + getPrivateIpAddress() + ",");
if (getPublicIpAddress() != null) sb.append("PublicIpAddress: " + getPublicIpAddress() + ",");

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

hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); 
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode()); 
hashCode = prime * hashCode + ((getPublicIpAddress() == null) ? 0 : getPublicIpAddress().hashCode());

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

if (other.getSubnetId() == null ^ this.getSubnetId() == null) return false;
if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false) return false; 
if (other.getVpcId() == null ^ this.getVpcId() == null) return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false; 
if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == null) return false;
if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == false) return false;

代码示例来源:origin: stackoverflow.com

AmazonEC2Client ec2Client = new AmazonEC2Client();
DescribeInstancesResult describeInstanceResult = ec2Client.describeInstances();
List<Reservation> reservations = describeInstanceResult.getReservations(); 
for (Reservation reservation : reservations) {    
  for (Instance instance : reservation.getInstances()) {
   System.out.println(instance.getVpcId());    
  } 
}

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

if (getSubnetId() != null)
  sb.append("SubnetId: ").append(getSubnetId()).append(",");
if (getVpcId() != null)
  sb.append("VpcId: ").append(getVpcId()).append(",");
if (getArchitecture() != null)
  sb.append("Architecture: ").append(getArchitecture()).append(",");

代码示例来源:origin: com.netflix.spinnaker.clouddriver/clouddriver-aws

instanceResult.getReservations().stream()
 .flatMap(r -> r.getInstances().stream())
 .filter(i -> i.getVpcId() == null)
 .filter(i -> Optional.ofNullable(i.getState()).filter(is -> is.getCode() == RUNNING_STATE).isPresent())
 .filter(this::isInstanceOldEnough)

代码示例来源:origin: pinterest/soundwave

@Override
 public EsInstance createFromEC2(Instance awsInstance) throws Exception {
  Preconditions.checkNotNull(awsInstance);

  EsInstance esInstance = new EsInstance();

  esInstance.setId(awsInstance.getInstanceId());
  esInstance.setState(awsInstance.getState().getName());
  esInstance.setLocation(awsInstance.getPlacement().getAvailabilityZone());

  //Region=location-last char. This is what CMDBV1 and people on internet do.
  //There should be a better way. Right now, keep as what it is
  esInstance.setRegion(
    esInstance.getLocation().substring(0, esInstance.getLocation().length() - 1));
  esInstance.setAwsLaunchTime(awsInstance.getLaunchTime());
  esInstance.setSubnetId(awsInstance.getSubnetId());
  esInstance.setVpcId(awsInstance.getVpcId());

  //Convert AWS instance to a map of property bags and save it.
  esInstance.getCloud()
    .put("aws", getAwsInstanceProperties(awsInstance));

  Date utcNow = DateTime.now(DateTimeZone.UTC).toDate();
  esInstance.setCreatedTime(utcNow);
  esInstance.setUpdatedTime(utcNow);

  return esInstance;
 }
}

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

hashCode = prime * hashCode + ((getStateTransitionReason() == null) ? 0 : getStateTransitionReason().hashCode());
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode());
hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode());

代码示例来源:origin: airbnb/billow

this.group = instance.getPlacement().getGroupName();
this.tenancy = instance.getPlacement().getTenancy();
this.vpc = instance.getVpcId();
this.platform = instance.getPlatform();
this.kernel = instance.getKernelId();

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

if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false)
  return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
  return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
  return false;
if (other.getArchitecture() == null ^ this.getArchitecture() == null)

相关文章

Instance类方法