hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); hashCode = prime * hashCode + ((getAmiId() == null) ? 0 : getAmiId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getAutoScalingType() == null) ? 0 : getAutoScalingType().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getEc2InstanceId() == null) ? 0 : getEc2InstanceId().hashCode()); hashCode = prime * hashCode + ((getEcsClusterArn() == null) ? 0 : getEcsClusterArn().hashCode()); hashCode = prime * hashCode + ((getEcsContainerInstanceArn() == null) ? 0 : getEcsContainerInstanceArn().hashCode()); hashCode = prime * hashCode + ((getElasticIp() == null) ? 0 : getElasticIp().hashCode()); hashCode = prime * hashCode + ((getHostname() == null) ? 0 : getHostname().hashCode()); hashCode = prime * hashCode + ((getInfrastructureClass() == null) ? 0 : getInfrastructureClass().hashCode()); hashCode = prime * hashCode + ((getInstallUpdatesOnBoot() == null) ? 0 : getInstallUpdatesOnBoot().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceProfileArn() == null) ? 0 : getInstanceProfileArn().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getLastServiceErrorId() == null) ? 0 : getLastServiceErrorId().hashCode()); hashCode = prime * hashCode + ((getLayerIds() == null) ? 0 : getLayerIds().hashCode()); hashCode = prime * hashCode + ((getOs() == null) ? 0 : getOs().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getPrivateDns() == null) ? 0 : getPrivateDns().hashCode()); hashCode = prime * hashCode + ((getPrivateIp() == null) ? 0 : getPrivateIp().hashCode()); hashCode = prime * hashCode + ((getPublicDns() == null) ? 0 : getPublicDns().hashCode()); hashCode = prime * hashCode + ((getPublicIp() == null) ? 0 : getPublicIp().hashCode()); hashCode = prime * hashCode + ((getRegisteredBy() == null) ? 0 : getRegisteredBy().hashCode()); hashCode = prime * hashCode + ((getReportedAgentVersion() == null) ? 0 : getReportedAgentVersion().hashCode());
public Instance unmarshall(JsonUnmarshallerContext context) throws Exception { Instance instance = new Instance(); if (context.testExpression("AgentVersion", targetDepth)) { context.nextToken(); instance.setAgentVersion(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAmiId(context.getUnmarshaller(String.class).unmarshall(context)); instance.setArchitecture(context.getUnmarshaller(String.class).unmarshall(context)); instance.setArn(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAutoScalingType(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAvailabilityZone(context.getUnmarshaller(String.class).unmarshall(context)); instance.setBlockDeviceMappings(new ListUnmarshaller<BlockDeviceMapping>(BlockDeviceMappingJsonUnmarshaller.getInstance()) .unmarshall(context)); instance.setCreatedAt(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEbsOptimized(context.getUnmarshaller(Boolean.class).unmarshall(context)); instance.setEc2InstanceId(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEcsClusterArn(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEcsContainerInstanceArn(context.getUnmarshaller(String.class).unmarshall(context));
public static void waitForOpsworksInstanceToReachState( AWSOpsWorksClient client, String instanceId, String state) throws InterruptedException { System.out.println("Waiting for instance " + instanceId + " to transition to " + state); int count = 0; while (true) { Thread.sleep(1000 * 30); if (count++ > 100) { throw new RuntimeException("Never reached " + state); } Instance instance = client .describeInstances( new DescribeInstancesRequest() .withInstanceIds(instanceId)) .getInstances().get(0); String status = instance.getStatus(); System.out.println(status); if (status.contains("failed")) { throw new RuntimeException("instance failed to launch"); } if (!status.equalsIgnoreCase(state)) { continue; } return; } } }
public Instance unmarshall(JsonUnmarshallerContext context) throws Exception { Instance instance = new Instance(); if (context.testExpression("AgentVersion", targetDepth)) { context.nextToken(); instance.setAgentVersion(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAmiId(context.getUnmarshaller(String.class).unmarshall(context)); instance.setArchitecture(context.getUnmarshaller(String.class).unmarshall(context)); instance.setArn(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAutoScalingType(context.getUnmarshaller(String.class).unmarshall(context)); instance.setAvailabilityZone(context.getUnmarshaller(String.class).unmarshall(context)); instance.setBlockDeviceMappings(new ListUnmarshaller<BlockDeviceMapping>(BlockDeviceMappingJsonUnmarshaller.getInstance()) .unmarshall(context)); instance.setCreatedAt(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEbsOptimized(context.getUnmarshaller(Boolean.class).unmarshall(context)); instance.setEc2InstanceId(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEcsClusterArn(context.getUnmarshaller(String.class).unmarshall(context)); instance.setEcsContainerInstanceArn(context.getUnmarshaller(String.class).unmarshall(context));
return false; Instance other = (Instance) obj; if (other.getAgentVersion() == null ^ this.getAgentVersion() == null) return false; if (other.getAgentVersion() != null && other.getAgentVersion().equals(this.getAgentVersion()) == false) return false; if (other.getAmiId() == null ^ this.getAmiId() == null) return false; if (other.getAmiId() != null && other.getAmiId().equals(this.getAmiId()) == false) return false; if (other.getArchitecture() == null ^ this.getArchitecture() == null) return false; if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getAutoScalingType() == null ^ this.getAutoScalingType() == null) return false; if (other.getAutoScalingType() != null && other.getAutoScalingType().equals(this.getAutoScalingType()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAgentVersion() != null) sb.append("AgentVersion: ").append(getAgentVersion()).append(","); if (getAmiId() != null) sb.append("AmiId: ").append(getAmiId()).append(","); if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getAutoScalingType() != null) sb.append("AutoScalingType: ").append(getAutoScalingType()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getEbsOptimized() != null) sb.append("EbsOptimized: ").append(getEbsOptimized()).append(","); if (getEc2InstanceId() != null) sb.append("Ec2InstanceId: ").append(getEc2InstanceId()).append(","); if (getEcsClusterArn() != null) sb.append("EcsClusterArn: ").append(getEcsClusterArn()).append(","); if (getEcsContainerInstanceArn() != null) sb.append("EcsContainerInstanceArn: ").append(getEcsContainerInstanceArn()).append(","); if (getElasticIp() != null) sb.append("ElasticIp: ").append(getElasticIp()).append(","); if (getHostname() != null)
protocolMarshaller.marshall(instance.getAgentVersion(), AGENTVERSION_BINDING); protocolMarshaller.marshall(instance.getAmiId(), AMIID_BINDING); protocolMarshaller.marshall(instance.getArchitecture(), ARCHITECTURE_BINDING); protocolMarshaller.marshall(instance.getArn(), ARN_BINDING); protocolMarshaller.marshall(instance.getAutoScalingType(), AUTOSCALINGTYPE_BINDING); protocolMarshaller.marshall(instance.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(instance.getBlockDeviceMappings(), BLOCKDEVICEMAPPINGS_BINDING); protocolMarshaller.marshall(instance.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(instance.getEbsOptimized(), EBSOPTIMIZED_BINDING); protocolMarshaller.marshall(instance.getEc2InstanceId(), EC2INSTANCEID_BINDING); protocolMarshaller.marshall(instance.getEcsClusterArn(), ECSCLUSTERARN_BINDING); protocolMarshaller.marshall(instance.getEcsContainerInstanceArn(), ECSCONTAINERINSTANCEARN_BINDING); protocolMarshaller.marshall(instance.getElasticIp(), ELASTICIP_BINDING); protocolMarshaller.marshall(instance.getHostname(), HOSTNAME_BINDING); protocolMarshaller.marshall(instance.getInfrastructureClass(), INFRASTRUCTURECLASS_BINDING); protocolMarshaller.marshall(instance.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING); protocolMarshaller.marshall(instance.getInstanceId(), INSTANCEID_BINDING); protocolMarshaller.marshall(instance.getInstanceProfileArn(), INSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(instance.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(instance.getLastServiceErrorId(), LASTSERVICEERRORID_BINDING); protocolMarshaller.marshall(instance.getLayerIds(), LAYERIDS_BINDING); protocolMarshaller.marshall(instance.getOs(), OS_BINDING); protocolMarshaller.marshall(instance.getPlatform(), PLATFORM_BINDING); protocolMarshaller.marshall(instance.getPrivateDns(), PRIVATEDNS_BINDING); protocolMarshaller.marshall(instance.getPrivateIp(), PRIVATEIP_BINDING); protocolMarshaller.marshall(instance.getPublicDns(), PUBLICDNS_BINDING); protocolMarshaller.marshall(instance.getPublicIp(), PUBLICIP_BINDING); protocolMarshaller.marshall(instance.getRegisteredBy(), REGISTEREDBY_BINDING); protocolMarshaller.marshall(instance.getReportedAgentVersion(), REPORTEDAGENTVERSION_BINDING);
hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); hashCode = prime * hashCode + ((getAmiId() == null) ? 0 : getAmiId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getAutoScalingType() == null) ? 0 : getAutoScalingType().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getEc2InstanceId() == null) ? 0 : getEc2InstanceId().hashCode()); hashCode = prime * hashCode + ((getEcsClusterArn() == null) ? 0 : getEcsClusterArn().hashCode()); hashCode = prime * hashCode + ((getEcsContainerInstanceArn() == null) ? 0 : getEcsContainerInstanceArn().hashCode()); hashCode = prime * hashCode + ((getElasticIp() == null) ? 0 : getElasticIp().hashCode()); hashCode = prime * hashCode + ((getHostname() == null) ? 0 : getHostname().hashCode()); hashCode = prime * hashCode + ((getInfrastructureClass() == null) ? 0 : getInfrastructureClass().hashCode()); hashCode = prime * hashCode + ((getInstallUpdatesOnBoot() == null) ? 0 : getInstallUpdatesOnBoot().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceProfileArn() == null) ? 0 : getInstanceProfileArn().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getLastServiceErrorId() == null) ? 0 : getLastServiceErrorId().hashCode()); hashCode = prime * hashCode + ((getLayerIds() == null) ? 0 : getLayerIds().hashCode()); hashCode = prime * hashCode + ((getOs() == null) ? 0 : getOs().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getPrivateDns() == null) ? 0 : getPrivateDns().hashCode()); hashCode = prime * hashCode + ((getPrivateIp() == null) ? 0 : getPrivateIp().hashCode()); hashCode = prime * hashCode + ((getPublicDns() == null) ? 0 : getPublicDns().hashCode()); hashCode = prime * hashCode + ((getPublicIp() == null) ? 0 : getPublicIp().hashCode()); hashCode = prime * hashCode + ((getRegisteredBy() == null) ? 0 : getRegisteredBy().hashCode()); hashCode = prime * hashCode + ((getReportedAgentVersion() == null) ? 0 : getReportedAgentVersion().hashCode());
return false; Instance other = (Instance) obj; if (other.getAgentVersion() == null ^ this.getAgentVersion() == null) return false; if (other.getAgentVersion() != null && other.getAgentVersion().equals(this.getAgentVersion()) == false) return false; if (other.getAmiId() == null ^ this.getAmiId() == null) return false; if (other.getAmiId() != null && other.getAmiId().equals(this.getAmiId()) == false) return false; if (other.getArchitecture() == null ^ this.getArchitecture() == null) return false; if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getAutoScalingType() == null ^ this.getAutoScalingType() == null) return false; if (other.getAutoScalingType() != null && other.getAutoScalingType().equals(this.getAutoScalingType()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAgentVersion() != null) sb.append("AgentVersion: ").append(getAgentVersion()).append(","); if (getAmiId() != null) sb.append("AmiId: ").append(getAmiId()).append(","); if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getAutoScalingType() != null) sb.append("AutoScalingType: ").append(getAutoScalingType()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getEbsOptimized() != null) sb.append("EbsOptimized: ").append(getEbsOptimized()).append(","); if (getEc2InstanceId() != null) sb.append("Ec2InstanceId: ").append(getEc2InstanceId()).append(","); if (getEcsClusterArn() != null) sb.append("EcsClusterArn: ").append(getEcsClusterArn()).append(","); if (getEcsContainerInstanceArn() != null) sb.append("EcsContainerInstanceArn: ").append(getEcsContainerInstanceArn()).append(","); if (getElasticIp() != null) sb.append("ElasticIp: ").append(getElasticIp()).append(","); if (getHostname() != null)
protocolMarshaller.marshall(instance.getAgentVersion(), AGENTVERSION_BINDING); protocolMarshaller.marshall(instance.getAmiId(), AMIID_BINDING); protocolMarshaller.marshall(instance.getArchitecture(), ARCHITECTURE_BINDING); protocolMarshaller.marshall(instance.getArn(), ARN_BINDING); protocolMarshaller.marshall(instance.getAutoScalingType(), AUTOSCALINGTYPE_BINDING); protocolMarshaller.marshall(instance.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(instance.getBlockDeviceMappings(), BLOCKDEVICEMAPPINGS_BINDING); protocolMarshaller.marshall(instance.getCreatedAt(), CREATEDAT_BINDING); protocolMarshaller.marshall(instance.getEbsOptimized(), EBSOPTIMIZED_BINDING); protocolMarshaller.marshall(instance.getEc2InstanceId(), EC2INSTANCEID_BINDING); protocolMarshaller.marshall(instance.getEcsClusterArn(), ECSCLUSTERARN_BINDING); protocolMarshaller.marshall(instance.getEcsContainerInstanceArn(), ECSCONTAINERINSTANCEARN_BINDING); protocolMarshaller.marshall(instance.getElasticIp(), ELASTICIP_BINDING); protocolMarshaller.marshall(instance.getHostname(), HOSTNAME_BINDING); protocolMarshaller.marshall(instance.getInfrastructureClass(), INFRASTRUCTURECLASS_BINDING); protocolMarshaller.marshall(instance.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING); protocolMarshaller.marshall(instance.getInstanceId(), INSTANCEID_BINDING); protocolMarshaller.marshall(instance.getInstanceProfileArn(), INSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(instance.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(instance.getLastServiceErrorId(), LASTSERVICEERRORID_BINDING); protocolMarshaller.marshall(instance.getLayerIds(), LAYERIDS_BINDING); protocolMarshaller.marshall(instance.getOs(), OS_BINDING); protocolMarshaller.marshall(instance.getPlatform(), PLATFORM_BINDING); protocolMarshaller.marshall(instance.getPrivateDns(), PRIVATEDNS_BINDING); protocolMarshaller.marshall(instance.getPrivateIp(), PRIVATEIP_BINDING); protocolMarshaller.marshall(instance.getPublicDns(), PUBLICDNS_BINDING); protocolMarshaller.marshall(instance.getPublicIp(), PUBLICIP_BINDING); protocolMarshaller.marshall(instance.getRegisteredBy(), REGISTEREDBY_BINDING); protocolMarshaller.marshall(instance.getReportedAgentVersion(), REPORTEDAGENTVERSION_BINDING);