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(",");
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());
String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();
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)
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() + ",");
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());
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;
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; }
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(); }
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(",");
"Not Routetable found in: {} for ids: {}", SubnetPlugin.class.getName(), instance.getSubnetId());
@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; } }
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());
String subnetId = instanceData(myInstanceId, ec2Service).getSubnetId();
this.state = instance.getState().getName(); this.ramdisk = instance.getRamdiskId(); this.subnet = instance.getSubnetId(); this.rootDeviceName = instance.getRootDeviceName(); this.rootDeviceType = instance.getRootDeviceType();
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)