/** * <p> * The instance architecture. The default option is <code>x86_64</code>. Instance types do not necessarily support * both architectures. For a list of the architectures that are supported by the different instance types, see <a * href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance Families and Types</a>. * </p> * * @param architecture * The instance architecture. The default option is <code>x86_64</code>. Instance types do not necessarily * support both architectures. For a list of the architectures that are supported by the different instance * types, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance * Families and Types</a>. * @return Returns a reference to this object so that method calls can be chained together. * @see Architecture */ public CreateInstanceRequest withArchitecture(String architecture) { setArchitecture(architecture); return this; }
/** * <p> * For load-based or time-based instances, the type. Windows stacks can use only time-based instances. * </p> * * @param autoScalingType * For load-based or time-based instances, the type. Windows stacks can use only time-based instances. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoScalingType */ public CreateInstanceRequest withAutoScalingType(String autoScalingType) { setAutoScalingType(autoScalingType); return this; }
/** * <p> * The instance root device type. For more information, see <a * href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device">Storage * for the Root Device</a>. * </p> * * @param rootDeviceType * The instance root device type. For more information, see <a href= * "http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device" * >Storage for the Root Device</a>. * @see RootDeviceType */ public void setRootDeviceType(RootDeviceType rootDeviceType) { withRootDeviceType(rootDeviceType); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getLayerIds() == null) ? 0 : getLayerIds().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getAutoScalingType() == null) ? 0 : getAutoScalingType().hashCode()); hashCode = prime * hashCode + ((getHostname() == null) ? 0 : getHostname().hashCode()); hashCode = prime * hashCode + ((getOs() == null) ? 0 : getOs().hashCode()); hashCode = prime * hashCode + ((getAmiId() == null) ? 0 : getAmiId().hashCode()); hashCode = prime * hashCode + ((getSshKeyName() == null) ? 0 : getSshKeyName().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode()); hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getInstallUpdatesOnBoot() == null) ? 0 : getInstallUpdatesOnBoot().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); hashCode = prime * hashCode + ((getTenancy() == null) ? 0 : getTenancy().hashCode()); return hashCode; }
checkParams(); AWSOpsWorksClient client = getOrCreateClient(AWSOpsWorksClient.class); CreateInstanceRequest createInstanceRequest = new CreateInstanceRequest() .withStackId(stackId) .withInstallUpdatesOnBoot(installUpdatesOnBoot) .withEbsOptimized(ebsOptimized).withLayerIds(layerIds) .withInstanceType(instanceType).withOs(os) .withAmiId(amiId).withSshKeyName(sshKeyName) .withAvailabilityZone(availabilityZone) .withVirtualizationType(virtualizationType) .withRootDeviceType(rootDeviceType).withSubnetId(subnetId); String instanceId; if(autoScalingType != null) { createInstanceRequest.setAutoScalingType(autoScalingType); createInstanceRequest.setArchitecture(architecture);
return false; CreateInstanceRequest other = (CreateInstanceRequest) obj; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getLayerIds() == null ^ this.getLayerIds() == null) return false; if (other.getLayerIds() != null && other.getLayerIds().equals(this.getLayerIds()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == 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.getHostname() == null ^ this.getHostname() == null) return false; if (other.getHostname() != null && other.getHostname().equals(this.getHostname()) == false) return false; if (other.getOs() == null ^ this.getOs() == null) return false; if (other.getOs() != null && other.getOs().equals(this.getOs()) == false) return false; if (other.getAmiId() == null ^ this.getAmiId() == null) return false; if (other.getAmiId() != null && other.getAmiId().equals(this.getAmiId()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getLayerIds() != null) sb.append("LayerIds: ").append(getLayerIds()).append(","); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getAutoScalingType() != null) sb.append("AutoScalingType: ").append(getAutoScalingType()).append(","); if (getHostname() != null) sb.append("Hostname: ").append(getHostname()).append(","); if (getOs() != null) sb.append("Os: ").append(getOs()).append(","); if (getAmiId() != null) sb.append("AmiId: ").append(getAmiId()).append(","); if (getSshKeyName() != null) sb.append("SshKeyName: ").append(getSshKeyName()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getVirtualizationType() != null) sb.append("VirtualizationType: ").append(getVirtualizationType()).append(","); if (getSubnetId() != null) sb.append("SubnetId: ").append(getSubnetId()).append(","); if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getRootDeviceType() != null) sb.append("RootDeviceType: ").append(getRootDeviceType()).append(","); if (getBlockDeviceMappings() != null)
/** * <p> * For load-based or time-based instances, the type. Windows stacks can use only time-based instances. * </p> * * @param autoScalingType * For load-based or time-based instances, the type. Windows stacks can use only time-based instances. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoScalingType */ public CreateInstanceRequest withAutoScalingType(String autoScalingType) { setAutoScalingType(autoScalingType); return this; }
/** * <p> * The instance root device type. For more information, see <a * href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device">Storage * for the Root Device</a>. * </p> * * @param rootDeviceType * The instance root device type. For more information, see <a href= * "http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device" * >Storage for the Root Device</a>. * @see RootDeviceType */ public void setRootDeviceType(RootDeviceType rootDeviceType) { withRootDeviceType(rootDeviceType); }
/** * <p> * The instance architecture. The default option is <code>x86_64</code>. Instance types do not necessarily support * both architectures. For a list of the architectures that are supported by the different instance types, see <a * href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance Families and Types</a>. * </p> * * @param architecture * The instance architecture. The default option is <code>x86_64</code>. Instance types do not necessarily * support both architectures. For a list of the architectures that are supported by the different instance * types, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html">Instance * Families and Types</a>. * @return Returns a reference to this object so that method calls can be chained together. * @see Architecture */ public CreateInstanceRequest withArchitecture(String architecture) { setArchitecture(architecture); return this; }
/** * Marshall the given parameter object. */ public void marshall(CreateInstanceRequest createInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (createInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createInstanceRequest.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getLayerIds(), LAYERIDS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAutoScalingType(), AUTOSCALINGTYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getHostname(), HOSTNAME_BINDING); protocolMarshaller.marshall(createInstanceRequest.getOs(), OS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAmiId(), AMIID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getSshKeyName(), SSHKEYNAME_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getVirtualizationType(), VIRTUALIZATIONTYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getSubnetId(), SUBNETID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getArchitecture(), ARCHITECTURE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getRootDeviceType(), ROOTDEVICETYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getBlockDeviceMappings(), BLOCKDEVICEMAPPINGS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING); protocolMarshaller.marshall(createInstanceRequest.getEbsOptimized(), EBSOPTIMIZED_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAgentVersion(), AGENTVERSION_BINDING); protocolMarshaller.marshall(createInstanceRequest.getTenancy(), TENANCY_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getLayerIds() == null) ? 0 : getLayerIds().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getAutoScalingType() == null) ? 0 : getAutoScalingType().hashCode()); hashCode = prime * hashCode + ((getHostname() == null) ? 0 : getHostname().hashCode()); hashCode = prime * hashCode + ((getOs() == null) ? 0 : getOs().hashCode()); hashCode = prime * hashCode + ((getAmiId() == null) ? 0 : getAmiId().hashCode()); hashCode = prime * hashCode + ((getSshKeyName() == null) ? 0 : getSshKeyName().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode()); hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getInstallUpdatesOnBoot() == null) ? 0 : getInstallUpdatesOnBoot().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); hashCode = prime * hashCode + ((getTenancy() == null) ? 0 : getTenancy().hashCode()); return hashCode; }
return false; CreateInstanceRequest other = (CreateInstanceRequest) obj; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getLayerIds() == null ^ this.getLayerIds() == null) return false; if (other.getLayerIds() != null && other.getLayerIds().equals(this.getLayerIds()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == 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.getHostname() == null ^ this.getHostname() == null) return false; if (other.getHostname() != null && other.getHostname().equals(this.getHostname()) == false) return false; if (other.getOs() == null ^ this.getOs() == null) return false; if (other.getOs() != null && other.getOs().equals(this.getOs()) == false) return false; if (other.getAmiId() == null ^ this.getAmiId() == null) return false; if (other.getAmiId() != null && other.getAmiId().equals(this.getAmiId()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getLayerIds() != null) sb.append("LayerIds: ").append(getLayerIds()).append(","); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getAutoScalingType() != null) sb.append("AutoScalingType: ").append(getAutoScalingType()).append(","); if (getHostname() != null) sb.append("Hostname: ").append(getHostname()).append(","); if (getOs() != null) sb.append("Os: ").append(getOs()).append(","); if (getAmiId() != null) sb.append("AmiId: ").append(getAmiId()).append(","); if (getSshKeyName() != null) sb.append("SshKeyName: ").append(getSshKeyName()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getVirtualizationType() != null) sb.append("VirtualizationType: ").append(getVirtualizationType()).append(","); if (getSubnetId() != null) sb.append("SubnetId: ").append(getSubnetId()).append(","); if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getRootDeviceType() != null) sb.append("RootDeviceType: ").append(getRootDeviceType()).append(","); if (getBlockDeviceMappings() != null)
/** * Marshall the given parameter object. */ public void marshall(CreateInstanceRequest createInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (createInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createInstanceRequest.getStackId(), STACKID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getLayerIds(), LAYERIDS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getInstanceType(), INSTANCETYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAutoScalingType(), AUTOSCALINGTYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getHostname(), HOSTNAME_BINDING); protocolMarshaller.marshall(createInstanceRequest.getOs(), OS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAmiId(), AMIID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getSshKeyName(), SSHKEYNAME_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAvailabilityZone(), AVAILABILITYZONE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getVirtualizationType(), VIRTUALIZATIONTYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getSubnetId(), SUBNETID_BINDING); protocolMarshaller.marshall(createInstanceRequest.getArchitecture(), ARCHITECTURE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getRootDeviceType(), ROOTDEVICETYPE_BINDING); protocolMarshaller.marshall(createInstanceRequest.getBlockDeviceMappings(), BLOCKDEVICEMAPPINGS_BINDING); protocolMarshaller.marshall(createInstanceRequest.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING); protocolMarshaller.marshall(createInstanceRequest.getEbsOptimized(), EBSOPTIMIZED_BINDING); protocolMarshaller.marshall(createInstanceRequest.getAgentVersion(), AGENTVERSION_BINDING); protocolMarshaller.marshall(createInstanceRequest.getTenancy(), TENANCY_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }