/** * <p> * One or more user-defined key-value pairs to be added to the stack attributes. * </p> * * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
/** * <p> * A <code>ChefConfiguration</code> object that specifies whether to enable Berkshelf and the Berkshelf version on * Chef 11.10 stacks. For more information, see <a * href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New Stack</a>. * </p> * * @param chefConfiguration * A <code>ChefConfiguration</code> object that specifies whether to enable Berkshelf and the Berkshelf * version on Chef 11.10 stacks. For more information, see <a * href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New * Stack</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withChefConfiguration(ChefConfiguration chefConfiguration) { setChefConfiguration(chefConfiguration); return this; }
/** * <p> * The configuration manager. When you create a stack we recommend that you use the configuration manager to specify * the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for Linux * stacks is currently 12. * </p> * * @param configurationManager * The configuration manager. When you create a stack we recommend that you use the configuration manager to * specify the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default * value for Linux stacks is currently 12. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withConfigurationManager(StackConfigurationManager configurationManager) { setConfigurationManager(configurationManager); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getServiceRoleArn() == null) ? 0 : getServiceRoleArn().hashCode()); hashCode = prime * hashCode + ((getDefaultInstanceProfileArn() == null) ? 0 : getDefaultInstanceProfileArn().hashCode()); hashCode = prime * hashCode + ((getDefaultOs() == null) ? 0 : getDefaultOs().hashCode()); hashCode = prime * hashCode + ((getHostnameTheme() == null) ? 0 : getHostnameTheme().hashCode()); hashCode = prime * hashCode + ((getDefaultAvailabilityZone() == null) ? 0 : getDefaultAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getDefaultSubnetId() == null) ? 0 : getDefaultSubnetId().hashCode()); hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); hashCode = prime * hashCode + ((getConfigurationManager() == null) ? 0 : getConfigurationManager().hashCode()); hashCode = prime * hashCode + ((getChefConfiguration() == null) ? 0 : getChefConfiguration().hashCode()); hashCode = prime * hashCode + ((getUseCustomCookbooks() == null) ? 0 : getUseCustomCookbooks().hashCode()); hashCode = prime * hashCode + ((getUseOpsworksSecurityGroups() == null) ? 0 : getUseOpsworksSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getCustomCookbooksSource() == null) ? 0 : getCustomCookbooksSource().hashCode()); hashCode = prime * hashCode + ((getDefaultSshKeyName() == null) ? 0 : getDefaultSshKeyName().hashCode()); hashCode = prime * hashCode + ((getDefaultRootDeviceType() == null) ? 0 : getDefaultRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); return hashCode; }
checkParams(); AWSOpsWorksClient client = getOrCreateClient(AWSOpsWorksClient.class); CreateStackRequest createStackRequest = new CreateStackRequest() .withName(name).withRegion(region) .withServiceRoleArn(serviceRoleArn) .withUseOpsworksSecurityGroups(useOpsworksSecurityGroups) .withUseCustomCookbooks(useCustomCookbooks).withVpcId(vpcId) .withDefaultAvailabilityZone(defaultAvailabilityZone) .withDefaultOs(defaultOs) .withDefaultRootDeviceType(defaultRootDeviceType) .withDefaultInstanceProfileArn(defaultInstanceProfileArn) .withDefaultSshKeyName(defaultSshKeyName) .withHostnameTheme(hostnameTheme).withCustomJson(customJson); if (attributes.size() > 0) { createStackRequest.setAttributes(attributes); .setConfigurationManager(new StackConfigurationManager() .withName(CHEF).withVersion(chefVersion)); .withUsername(repoUsername); createStackRequest .setCustomCookbooksSource(customCookBookSource); chefConfiguration.setBerkshelfVersion(berkshelfVersion); createStackRequest.setChefConfiguration(chefConfiguration);
/** * @param customCookbooksSource * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withCustomCookbooksSource(Source customCookbooksSource) { setCustomCookbooksSource(customCookbooksSource); return this; }
/** * <p> * The default root device type. This value is the default for all instances in the stack, but you can override it * when you create an instance. The default option is <code>instance-store</code>. 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 defaultRootDeviceType * The default root device type. This value is the default for all instances in the stack, but you can * override it when you create an instance. The default option is <code>instance-store</code>. 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 setDefaultRootDeviceType(RootDeviceType defaultRootDeviceType) { withDefaultRootDeviceType(defaultRootDeviceType); }
return false; CreateStackRequest other = (CreateStackRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getRegion() == null ^ this.getRegion() == null) return false; if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == 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.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getServiceRoleArn() == null ^ this.getServiceRoleArn() == null) return false; if (other.getServiceRoleArn() != null && other.getServiceRoleArn().equals(this.getServiceRoleArn()) == false) return false; if (other.getDefaultInstanceProfileArn() == null ^ this.getDefaultInstanceProfileArn() == null) return false; if (other.getDefaultInstanceProfileArn() != null && other.getDefaultInstanceProfileArn().equals(this.getDefaultInstanceProfileArn()) == false) return false; if (other.getDefaultOs() == null ^ this.getDefaultOs() == null) return false; if (other.getDefaultOs() != null && other.getDefaultOs().equals(this.getDefaultOs()) == false)
/** * @param customCookbooksSource * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withCustomCookbooksSource(Source customCookbooksSource) { setCustomCookbooksSource(customCookbooksSource); return this; }
/** * <p> * The default root device type. This value is the default for all instances in the stack, but you can override it * when you create an instance. The default option is <code>instance-store</code>. 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 defaultRootDeviceType * The default root device type. This value is the default for all instances in the stack, but you can * override it when you create an instance. The default option is <code>instance-store</code>. 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 setDefaultRootDeviceType(RootDeviceType defaultRootDeviceType) { withDefaultRootDeviceType(defaultRootDeviceType); }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getRegion() != null) sb.append("Region: ").append(getRegion()).append(","); if (getVpcId() != null) sb.append("VpcId: ").append(getVpcId()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getServiceRoleArn() != null) sb.append("ServiceRoleArn: ").append(getServiceRoleArn()).append(","); if (getDefaultInstanceProfileArn() != null) sb.append("DefaultInstanceProfileArn: ").append(getDefaultInstanceProfileArn()).append(","); if (getDefaultOs() != null) sb.append("DefaultOs: ").append(getDefaultOs()).append(","); if (getHostnameTheme() != null) sb.append("HostnameTheme: ").append(getHostnameTheme()).append(","); if (getDefaultAvailabilityZone() != null) sb.append("DefaultAvailabilityZone: ").append(getDefaultAvailabilityZone()).append(","); if (getDefaultSubnetId() != null) sb.append("DefaultSubnetId: ").append(getDefaultSubnetId()).append(","); if (getCustomJson() != null) sb.append("CustomJson: ").append(getCustomJson()).append(","); if (getConfigurationManager() != null) sb.append("ConfigurationManager: ").append(getConfigurationManager()).append(","); if (getChefConfiguration() != null) sb.append("ChefConfiguration: ").append(getChefConfiguration()).append(","); if (getUseCustomCookbooks() != null)
/** * <p> * One or more user-defined key-value pairs to be added to the stack attributes. * </p> * * @param attributes * One or more user-defined key-value pairs to be added to the stack attributes. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withAttributes(java.util.Map<String, String> attributes) { setAttributes(attributes); return this; }
/** * <p> * The configuration manager. When you create a stack we recommend that you use the configuration manager to specify * the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for Linux * stacks is currently 12. * </p> * * @param configurationManager * The configuration manager. When you create a stack we recommend that you use the configuration manager to * specify the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default * value for Linux stacks is currently 12. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withConfigurationManager(StackConfigurationManager configurationManager) { setConfigurationManager(configurationManager); return this; }
/** * <p> * A <code>ChefConfiguration</code> object that specifies whether to enable Berkshelf and the Berkshelf version on * Chef 11.10 stacks. For more information, see <a * href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New Stack</a>. * </p> * * @param chefConfiguration * A <code>ChefConfiguration</code> object that specifies whether to enable Berkshelf and the Berkshelf * version on Chef 11.10 stacks. For more information, see <a * href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html">Create a New * Stack</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackRequest withChefConfiguration(ChefConfiguration chefConfiguration) { setChefConfiguration(chefConfiguration); return this; }
protocolMarshaller.marshall(createStackRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createStackRequest.getRegion(), REGION_BINDING); protocolMarshaller.marshall(createStackRequest.getVpcId(), VPCID_BINDING); protocolMarshaller.marshall(createStackRequest.getAttributes(), ATTRIBUTES_BINDING); protocolMarshaller.marshall(createStackRequest.getServiceRoleArn(), SERVICEROLEARN_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultInstanceProfileArn(), DEFAULTINSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultOs(), DEFAULTOS_BINDING); protocolMarshaller.marshall(createStackRequest.getHostnameTheme(), HOSTNAMETHEME_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultAvailabilityZone(), DEFAULTAVAILABILITYZONE_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultSubnetId(), DEFAULTSUBNETID_BINDING); protocolMarshaller.marshall(createStackRequest.getCustomJson(), CUSTOMJSON_BINDING); protocolMarshaller.marshall(createStackRequest.getConfigurationManager(), CONFIGURATIONMANAGER_BINDING); protocolMarshaller.marshall(createStackRequest.getChefConfiguration(), CHEFCONFIGURATION_BINDING); protocolMarshaller.marshall(createStackRequest.getUseCustomCookbooks(), USECUSTOMCOOKBOOKS_BINDING); protocolMarshaller.marshall(createStackRequest.getUseOpsworksSecurityGroups(), USEOPSWORKSSECURITYGROUPS_BINDING); protocolMarshaller.marshall(createStackRequest.getCustomCookbooksSource(), CUSTOMCOOKBOOKSSOURCE_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultSshKeyName(), DEFAULTSSHKEYNAME_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultRootDeviceType(), DEFAULTROOTDEVICETYPE_BINDING); protocolMarshaller.marshall(createStackRequest.getAgentVersion(), AGENTVERSION_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 + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getServiceRoleArn() == null) ? 0 : getServiceRoleArn().hashCode()); hashCode = prime * hashCode + ((getDefaultInstanceProfileArn() == null) ? 0 : getDefaultInstanceProfileArn().hashCode()); hashCode = prime * hashCode + ((getDefaultOs() == null) ? 0 : getDefaultOs().hashCode()); hashCode = prime * hashCode + ((getHostnameTheme() == null) ? 0 : getHostnameTheme().hashCode()); hashCode = prime * hashCode + ((getDefaultAvailabilityZone() == null) ? 0 : getDefaultAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getDefaultSubnetId() == null) ? 0 : getDefaultSubnetId().hashCode()); hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); hashCode = prime * hashCode + ((getConfigurationManager() == null) ? 0 : getConfigurationManager().hashCode()); hashCode = prime * hashCode + ((getChefConfiguration() == null) ? 0 : getChefConfiguration().hashCode()); hashCode = prime * hashCode + ((getUseCustomCookbooks() == null) ? 0 : getUseCustomCookbooks().hashCode()); hashCode = prime * hashCode + ((getUseOpsworksSecurityGroups() == null) ? 0 : getUseOpsworksSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getCustomCookbooksSource() == null) ? 0 : getCustomCookbooksSource().hashCode()); hashCode = prime * hashCode + ((getDefaultSshKeyName() == null) ? 0 : getDefaultSshKeyName().hashCode()); hashCode = prime * hashCode + ((getDefaultRootDeviceType() == null) ? 0 : getDefaultRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getAgentVersion() == null) ? 0 : getAgentVersion().hashCode()); return hashCode; }
return false; CreateStackRequest other = (CreateStackRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getRegion() == null ^ this.getRegion() == null) return false; if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == 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.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getServiceRoleArn() == null ^ this.getServiceRoleArn() == null) return false; if (other.getServiceRoleArn() != null && other.getServiceRoleArn().equals(this.getServiceRoleArn()) == false) return false; if (other.getDefaultInstanceProfileArn() == null ^ this.getDefaultInstanceProfileArn() == null) return false; if (other.getDefaultInstanceProfileArn() != null && other.getDefaultInstanceProfileArn().equals(this.getDefaultInstanceProfileArn()) == false) return false; if (other.getDefaultOs() == null ^ this.getDefaultOs() == null) return false; if (other.getDefaultOs() != null && other.getDefaultOs().equals(this.getDefaultOs()) == false)
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getRegion() != null) sb.append("Region: ").append(getRegion()).append(","); if (getVpcId() != null) sb.append("VpcId: ").append(getVpcId()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getServiceRoleArn() != null) sb.append("ServiceRoleArn: ").append(getServiceRoleArn()).append(","); if (getDefaultInstanceProfileArn() != null) sb.append("DefaultInstanceProfileArn: ").append(getDefaultInstanceProfileArn()).append(","); if (getDefaultOs() != null) sb.append("DefaultOs: ").append(getDefaultOs()).append(","); if (getHostnameTheme() != null) sb.append("HostnameTheme: ").append(getHostnameTheme()).append(","); if (getDefaultAvailabilityZone() != null) sb.append("DefaultAvailabilityZone: ").append(getDefaultAvailabilityZone()).append(","); if (getDefaultSubnetId() != null) sb.append("DefaultSubnetId: ").append(getDefaultSubnetId()).append(","); if (getCustomJson() != null) sb.append("CustomJson: ").append(getCustomJson()).append(","); if (getConfigurationManager() != null) sb.append("ConfigurationManager: ").append(getConfigurationManager()).append(","); if (getChefConfiguration() != null) sb.append("ChefConfiguration: ").append(getChefConfiguration()).append(","); if (getUseCustomCookbooks() != null)
protocolMarshaller.marshall(createStackRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createStackRequest.getRegion(), REGION_BINDING); protocolMarshaller.marshall(createStackRequest.getVpcId(), VPCID_BINDING); protocolMarshaller.marshall(createStackRequest.getAttributes(), ATTRIBUTES_BINDING); protocolMarshaller.marshall(createStackRequest.getServiceRoleArn(), SERVICEROLEARN_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultInstanceProfileArn(), DEFAULTINSTANCEPROFILEARN_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultOs(), DEFAULTOS_BINDING); protocolMarshaller.marshall(createStackRequest.getHostnameTheme(), HOSTNAMETHEME_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultAvailabilityZone(), DEFAULTAVAILABILITYZONE_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultSubnetId(), DEFAULTSUBNETID_BINDING); protocolMarshaller.marshall(createStackRequest.getCustomJson(), CUSTOMJSON_BINDING); protocolMarshaller.marshall(createStackRequest.getConfigurationManager(), CONFIGURATIONMANAGER_BINDING); protocolMarshaller.marshall(createStackRequest.getChefConfiguration(), CHEFCONFIGURATION_BINDING); protocolMarshaller.marshall(createStackRequest.getUseCustomCookbooks(), USECUSTOMCOOKBOOKS_BINDING); protocolMarshaller.marshall(createStackRequest.getUseOpsworksSecurityGroups(), USEOPSWORKSSECURITYGROUPS_BINDING); protocolMarshaller.marshall(createStackRequest.getCustomCookbooksSource(), CUSTOMCOOKBOOKSSOURCE_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultSshKeyName(), DEFAULTSSHKEYNAME_BINDING); protocolMarshaller.marshall(createStackRequest.getDefaultRootDeviceType(), DEFAULTROOTDEVICETYPE_BINDING); protocolMarshaller.marshall(createStackRequest.getAgentVersion(), AGENTVERSION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);