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

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

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

Instance.getSubnetId介绍

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

代码示例

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

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

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

hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
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());

代码示例来源:origin: Netflix/eureka

String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();

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

if (other.getStateTransitionReason() != null && other.getStateTransitionReason().equals(this.getStateTransitionReason()) == false)
  return false;
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)

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

if (getPlatform() != null) sb.append("Platform: " + getPlatform() + ",");
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() + ",");

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

hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); 
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());

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

if (other.getMonitoring() == null ^ this.getMonitoring() == null) return false;
if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false) return false; 
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;

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

private List<RouteTable> fetchRouteTables(final List<Filter> subnetIdFilters, final AmazonEC2Client amazonEC2Client,
                     final Instance instance) {
  subnetIdFilters.add(
      new Filter().withName("association.subnet-id")
            .withValues(instance.getSubnetId())); // filter by subnetId
  final DescribeRouteTablesRequest describeRouteTablesRequest = new DescribeRouteTablesRequest()
      .withFilters(subnetIdFilters);
  final DescribeRouteTablesResult describeRouteTablesResult = amazonEC2Client
      .describeRouteTables(describeRouteTablesRequest);
  return describeRouteTablesResult.getRouteTables();
}

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

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

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

"Not Routetable found in: {} for ids: {}",
SubnetPlugin.class.getName(),
instance.getSubnetId());

代码示例来源: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 + ((getState() == null) ? 0 : getState().hashCode());
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());

代码示例来源:origin: com.netflix.eureka/eureka-core

String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();

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

this.state = instance.getState().getName();
this.ramdisk = instance.getRamdiskId();
this.subnet = instance.getSubnetId();
this.rootDeviceName = instance.getRootDeviceName();
this.rootDeviceType = instance.getRootDeviceType();

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

if (other.getStateTransitionReason() != null && other.getStateTransitionReason().equals(this.getStateTransitionReason()) == false)
  return false;
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)

相关文章

Instance类方法