Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
    * 
    * Licensed under the Apache License, Version 2.0 (the "License").
    * You may not use this file except in compliance with the License.
    * A copy of the License is located at
    * 
    *  http://aws.amazon.com/apache2.0
    * 
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  package com.amazonaws.services.opsworks.model;
  
  
Container for the parameters to the CreateInstance operation.

Creates an instance in a specified stack. For more information, see Adding an Instance to a Layer .

Required Permissions : To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .

  
  public class CreateInstanceRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The stack ID.
  
      private String stackId;

    
An array that contains the instance layer IDs.
  
The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.
  
      private String instanceType;

    
For load-based or time-based instances, the type.

Constraints:
Allowed Values: load, timer

  
      private String autoScalingType;

    
The instance host name.
  
      private String hostname;

    
The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

  
      private String os;

    
A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>
 
     private String amiId;

    
The instance's Amazon EC2 key pair name.
 
     private String sshKeyName;

    
The instance Availability Zone. For more information, see Regions and Endpoints.
 
     private String availabilityZone;

    
The instance's virtualization type, paravirtual or hvm.
 
     private String virtualizationType;

    
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.
 
     private String subnetId;

    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Constraints:
Allowed Values: x86_64, i386

 
     private String architecture;

    
The instance root device type. For more information, see Storage for the Root Device.

Constraints:
Allowed Values: ebs, instance-store

 
     private String rootDeviceType;

    
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.
 
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

 
     private Boolean installUpdatesOnBoot;

    
Whether to create an Amazon EBS-optimized instance.
 
     private Boolean ebsOptimized;

    
The stack ID.

Returns:
The stack ID.
 
     public String getStackId() {
         return ;
     }
    
    
The stack ID.

Parameters:
stackId The stack ID.
 
     public void setStackId(String stackId) {
         this. = stackId;
     }
    
    
The stack ID.

Returns a reference to this object so that method calls can be chained together.

Parameters:
stackId The stack ID.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withStackId(String stackId) {
         this. = stackId;
         return this;
     }

    
An array that contains the instance layer IDs.

Returns:
An array that contains the instance layer IDs.
 
     public java.util.List<StringgetLayerIds() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
An array that contains the instance layer IDs.

Parameters:
layerIds An array that contains the instance layer IDs.
 
     public void setLayerIds(java.util.Collection<StringlayerIds) {
         if (layerIds == null) {
             this. = null;
             return;
         }
         layerIdsCopy.addAll(layerIds);
         this. = layerIdsCopy;
     }
    
    
An array that contains the instance layer IDs.

NOTE: This method appends the values to the existing list (if any). Use setLayerIds(java.util.Collection) or withLayerIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
layerIds An array that contains the instance layer IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withLayerIds(String... layerIds) {
         if (getLayerIds() == nullsetLayerIds(new java.util.ArrayList<String>(layerIds.length));
         for (String value : layerIds) {
             getLayerIds().add(value);
         }
         return this;
     }
    
    
An array that contains the instance layer IDs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
layerIds An array that contains the instance layer IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (layerIds == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringlayerIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(layerIds.size());
             layerIdsCopy.addAll(layerIds);
             this. = layerIdsCopy;
         }
 
         return this;
     }

    
The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

Returns:
The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.
 
     public String getInstanceType() {
         return ;
     }
    
    
The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

Parameters:
instanceType The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.
 
     public void setInstanceType(String instanceType) {
         this. = instanceType;
     }
    
    
The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceType The instance type. AWS OpsWorks supports all instance types except Cluster Compute, Cluster GPU, and High Memory Cluster. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withInstanceType(String instanceType) {
         this. = instanceType;
         return this;
     }

    
For load-based or time-based instances, the type.

Constraints:
Allowed Values: load, timer

Returns:
For load-based or time-based instances, the type.
See also:
AutoScalingType
 
     public String getAutoScalingType() {
         return ;
     }
    
    
For load-based or time-based instances, the type.

Constraints:
Allowed Values: load, timer

Parameters:
autoScalingType For load-based or time-based instances, the type.
See also:
AutoScalingType
 
     public void setAutoScalingType(String autoScalingType) {
         this. = autoScalingType;
     }
    
    
For load-based or time-based instances, the type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: load, timer

Parameters:
autoScalingType For load-based or time-based instances, the type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AutoScalingType
 
     public CreateInstanceRequest withAutoScalingType(String autoScalingType) {
         this. = autoScalingType;
         return this;
     }

    
For load-based or time-based instances, the type.

Constraints:
Allowed Values: load, timer

Parameters:
autoScalingType For load-based or time-based instances, the type.
See also:
AutoScalingType
 
     public void setAutoScalingType(AutoScalingType autoScalingType) {
         this. = autoScalingType.toString();
     }
    
    
For load-based or time-based instances, the type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: load, timer

Parameters:
autoScalingType For load-based or time-based instances, the type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AutoScalingType
 
     public CreateInstanceRequest withAutoScalingType(AutoScalingType autoScalingType) {
         this. = autoScalingType.toString();
         return this;
     }

    
The instance host name.

Returns:
The instance host name.
 
     public String getHostname() {
         return ;
     }
    
    
The instance host name.

Parameters:
hostname The instance host name.
 
     public void setHostname(String hostname) {
         this. = hostname;
     }
    
    
The instance host name.

Returns a reference to this object so that method calls can be chained together.

Parameters:
hostname The instance host name.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withHostname(String hostname) {
         this. = hostname;
         return this;
     }

    
The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

Returns:
The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

 
     public String getOs() {
         return ;
     }
    
    
The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

Parameters:
os The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

 
     public void setOs(String os) {
         this. = os;
     }
    
    
The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
os The instance's operating system, which must be set to one of the following.
  • Standard operating systems: an Amazon Linux version such as Amazon Linux 2014.09, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.
  • Custom AMIs: Custom

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the standard operating systems, see Operating SystemsFor more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withOs(String os) {
         this. = os;
         return this;
     }

    
A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>

Returns:
A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>
 
     public String getAmiId() {
         return ;
     }
    
    
A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>

Parameters:
amiId A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>
 
     public void setAmiId(String amiId) {
         this. = amiId;
     }
    
    
A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
amiId A custom AMI ID to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks AMIs: Amazon Linux, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS. For more information, see Instances. <note>If you specify a custom AMI, you must set Os to Custom.</note>
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withAmiId(String amiId) {
         this. = amiId;
         return this;
     }

    
The instance's Amazon EC2 key pair name.

Returns:
The instance's Amazon EC2 key pair name.
 
     public String getSshKeyName() {
         return ;
     }
    
    
The instance's Amazon EC2 key pair name.

Parameters:
sshKeyName The instance's Amazon EC2 key pair name.
 
     public void setSshKeyName(String sshKeyName) {
         this. = sshKeyName;
     }
    
    
The instance's Amazon EC2 key pair name.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sshKeyName The instance's Amazon EC2 key pair name.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withSshKeyName(String sshKeyName) {
         this. = sshKeyName;
         return this;
     }

    
The instance Availability Zone. For more information, see Regions and Endpoints.

Returns:
The instance Availability Zone. For more information, see Regions and Endpoints.
 
     public String getAvailabilityZone() {
         return ;
     }
    
    
The instance Availability Zone. For more information, see Regions and Endpoints.

Parameters:
availabilityZone The instance Availability Zone. For more information, see Regions and Endpoints.
 
     public void setAvailabilityZone(String availabilityZone) {
         this. = availabilityZone;
     }
    
    
The instance Availability Zone. For more information, see Regions and Endpoints.

Returns a reference to this object so that method calls can be chained together.

Parameters:
availabilityZone The instance Availability Zone. For more information, see Regions and Endpoints.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withAvailabilityZone(String availabilityZone) {
         this. = availabilityZone;
         return this;
     }

    
The instance's virtualization type, paravirtual or hvm.

Returns:
The instance's virtualization type, paravirtual or hvm.
 
     public String getVirtualizationType() {
         return ;
     }
    
    
The instance's virtualization type, paravirtual or hvm.

Parameters:
virtualizationType The instance's virtualization type, paravirtual or hvm.
 
     public void setVirtualizationType(String virtualizationType) {
         this. = virtualizationType;
     }
    
    
The instance's virtualization type, paravirtual or hvm.

Returns a reference to this object so that method calls can be chained together.

Parameters:
virtualizationType The instance's virtualization type, paravirtual or hvm.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withVirtualizationType(String virtualizationType) {
         this. = virtualizationType;
         return this;
     }

    
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.

Returns:
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.
 
     public String getSubnetId() {
         return ;
     }
    
    
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.

Parameters:
subnetId The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.
 
     public void setSubnetId(String subnetId) {
         this. = subnetId;
     }
    
    
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.

Returns a reference to this object so that method calls can be chained together.

Parameters:
subnetId The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateInstanceRequest withSubnetId(String subnetId) {
         this. = subnetId;
         return this;
     }

    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Constraints:
Allowed Values: x86_64, i386

Returns:
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
See also:
Architecture
 
     public String getArchitecture() {
         return ;
     }
    
    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Constraints:
Allowed Values: x86_64, i386

Parameters:
architecture The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
See also:
Architecture
 
     public void setArchitecture(String architecture) {
         this. = architecture;
     }
    
    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: x86_64, i386

Parameters:
architecture The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Architecture
 
     public CreateInstanceRequest withArchitecture(String architecture) {
         this. = architecture;
         return this;
     }

    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Constraints:
Allowed Values: x86_64, i386

Parameters:
architecture The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
See also:
Architecture
 
     public void setArchitecture(Architecture architecture) {
         this. = architecture.toString();
     }
    
    
The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: x86_64, i386

Parameters:
architecture The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Architecture
 
     public CreateInstanceRequest withArchitecture(Architecture architecture) {
         this. = architecture.toString();
         return this;
     }

    
The instance root device type. For more information, see Storage for the Root Device.

Constraints:
Allowed Values: ebs, instance-store

Returns:
The instance root device type. For more information, see Storage for the Root Device.
See also:
RootDeviceType
 
     public String getRootDeviceType() {
         return ;
     }
    
    
The instance root device type. For more information, see Storage for the Root Device.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The instance root device type. For more information, see Storage for the Root Device.
See also:
RootDeviceType
 
     public void setRootDeviceType(String rootDeviceType) {
         this. = rootDeviceType;
     }
    
    
The instance root device type. For more information, see Storage for the Root Device.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The instance root device type. For more information, see Storage for the Root Device.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RootDeviceType
 
     public CreateInstanceRequest withRootDeviceType(String rootDeviceType) {
         this. = rootDeviceType;
         return this;
     }

    
The instance root device type. For more information, see Storage for the Root Device.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The instance root device type. For more information, see Storage for the Root Device.
See also:
RootDeviceType
    public void setRootDeviceType(RootDeviceType rootDeviceType) {
        this. = rootDeviceType.toString();
    }
    
    
The instance root device type. For more information, see Storage for the Root Device.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: ebs, instance-store

Parameters:
rootDeviceType The instance root device type. For more information, see Storage for the Root Device.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RootDeviceType
    public CreateInstanceRequest withRootDeviceType(RootDeviceType rootDeviceType) {
        this. = rootDeviceType.toString();
        return this;
    }

    
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

Returns:
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

Parameters:
blockDeviceMappings An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.
    public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        if (blockDeviceMappings == null) {
            this. = null;
            return;
        }
        blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        this. = blockDeviceMappingsCopy;
    }
    
    
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

NOTE: This method appends the values to the existing list (if any). Use setBlockDeviceMappings(java.util.Collection) or withBlockDeviceMappings(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateInstanceRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
        if (getBlockDeviceMappings() == nullsetBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
        for (BlockDeviceMapping value : blockDeviceMappings) {
            getBlockDeviceMappings().add(value);
        }
        return this;
    }
    
    
An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (blockDeviceMappings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMappingblockDeviceMappingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMapping>(blockDeviceMappings.size());
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
            this. = blockDeviceMappingsCopy;
        }
        return this;
    }

    
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

Returns:
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

    public Boolean isInstallUpdatesOnBoot() {
        return ;
    }
    
    
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

Parameters:
installUpdatesOnBoot Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

    public void setInstallUpdatesOnBoot(Boolean installUpdatesOnBoot) {
        this. = installUpdatesOnBoot;
    }
    
    
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

Returns a reference to this object so that method calls can be chained together.

Parameters:
installUpdatesOnBoot Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateInstanceRequest withInstallUpdatesOnBoot(Boolean installUpdatesOnBoot) {
        this. = installUpdatesOnBoot;
        return this;
    }

    
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

Returns:
Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances. <note>

We strongly recommend using the default value of true to ensure that your instances have the latest security updates. </note>

    public Boolean getInstallUpdatesOnBoot() {
        return ;
    }

    
Whether to create an Amazon EBS-optimized instance.

Returns:
Whether to create an Amazon EBS-optimized instance.
    public Boolean isEbsOptimized() {
        return ;
    }
    
    
Whether to create an Amazon EBS-optimized instance.

Parameters:
ebsOptimized Whether to create an Amazon EBS-optimized instance.
    public void setEbsOptimized(Boolean ebsOptimized) {
        this. = ebsOptimized;
    }
    
    
Whether to create an Amazon EBS-optimized instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ebsOptimized Whether to create an Amazon EBS-optimized instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateInstanceRequest withEbsOptimized(Boolean ebsOptimized) {
        this. = ebsOptimized;
        return this;
    }

    
Whether to create an Amazon EBS-optimized instance.

Returns:
Whether to create an Amazon EBS-optimized instance.
    public Boolean getEbsOptimized() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getLayerIds() != nullsb.append("LayerIds: " + getLayerIds() + ",");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getAutoScalingType() != nullsb.append("AutoScalingType: " + getAutoScalingType() + ",");
        if (getHostname() != nullsb.append("Hostname: " + getHostname() + ",");
        if (getOs() != nullsb.append("Os: " + getOs() + ",");
        if (getAmiId() != nullsb.append("AmiId: " + getAmiId() + ",");
        if (getSshKeyName() != nullsb.append("SshKeyName: " + getSshKeyName() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getVirtualizationType() != nullsb.append("VirtualizationType: " + getVirtualizationType() + ",");
        if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (getArchitecture() != nullsb.append("Architecture: " + getArchitecture() + ",");
        if (getRootDeviceType() != nullsb.append("RootDeviceType: " + getRootDeviceType() + ",");
        if (getBlockDeviceMappings() != nullsb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ",");
        if (isInstallUpdatesOnBoot() != nullsb.append("InstallUpdatesOnBoot: " + isInstallUpdatesOnBoot() + ",");
        if (isEbsOptimized() != nullsb.append("EbsOptimized: " + isEbsOptimized() );
        sb.append("}");
        return sb.toString();
    }
    
    @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 + ((isInstallUpdatesOnBoot() == null) ? 0 : isInstallUpdatesOnBoot().hashCode()); 
        hashCode = prime * hashCode + ((isEbsOptimized() == null) ? 0 : isEbsOptimized().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateInstanceRequest == falsereturn false;
        CreateInstanceRequest other = (CreateInstanceRequest)obj;
        
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getLayerIds() == null ^ this.getLayerIds() == nullreturn false;
        if (other.getLayerIds() != null && other.getLayerIds().equals(this.getLayerIds()) == falsereturn false
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getAutoScalingType() == null ^ this.getAutoScalingType() == nullreturn false;
        if (other.getAutoScalingType() != null && other.getAutoScalingType().equals(this.getAutoScalingType()) == falsereturn false
        if (other.getHostname() == null ^ this.getHostname() == nullreturn false;
        if (other.getHostname() != null && other.getHostname().equals(this.getHostname()) == falsereturn false
        if (other.getOs() == null ^ this.getOs() == nullreturn false;
        if (other.getOs() != null && other.getOs().equals(this.getOs()) == falsereturn false
        if (other.getAmiId() == null ^ this.getAmiId() == nullreturn false;
        if (other.getAmiId() != null && other.getAmiId().equals(this.getAmiId()) == falsereturn false
        if (other.getSshKeyName() == null ^ this.getSshKeyName() == nullreturn false;
        if (other.getSshKeyName() != null && other.getSshKeyName().equals(this.getSshKeyName()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        if (other.getVirtualizationType() == null ^ this.getVirtualizationType() == nullreturn false;
        if (other.getVirtualizationType() != null && other.getVirtualizationType().equals(this.getVirtualizationType()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getArchitecture() == null ^ this.getArchitecture() == nullreturn false;
        if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == falsereturn false
        if (other.getRootDeviceType() == null ^ this.getRootDeviceType() == nullreturn false;
        if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == falsereturn false
        if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == nullreturn false;
        if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == falsereturn false
        if (other.isInstallUpdatesOnBoot() == null ^ this.isInstallUpdatesOnBoot() == nullreturn false;
        if (other.isInstallUpdatesOnBoot() != null && other.isInstallUpdatesOnBoot().equals(this.isInstallUpdatesOnBoot()) == falsereturn false
        if (other.isEbsOptimized() == null ^ this.isEbsOptimized() == nullreturn false;
        if (other.isEbsOptimized() != null && other.isEbsOptimized().equals(this.isEbsOptimized()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateInstanceRequest clone() {
        
            return (CreateInstanceRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X