/* * Copyright 2018-2023 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.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateInstancesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for
* example: ["MyFirstInstance","MySecondInstance"]
*
* The Availability Zone in which to create your instance. Use the following format: us-east-2a
(case
* sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*
* (Deprecated) The name for your custom image. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
*
* The ID for a virtual private server image (e.g., app_wordpress_4_4
or app_lamp_7_0
).
* Use the get blueprints
operation to return a list of available images (or blueprints).
*
* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *
*
* The bundle of specification information for your virtual private server (or instance), including the
* pricing plan (e.g., micro_1_0
).
*
* A launch script you can create that configures a server with additional user data. For example, you might want to
* run apt-get -y update
.
*
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and
* CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses pkg
. For a
* complete list, see the Amazon Lightsail Developer Guide.
*
* The name of your key pair. *
*/ private String keyPairName; /** ** The tag keys and optional values to add to the resource during create. *
*
* Use the TagResource
action to tag a resource after it's created.
*
* An array of objects representing the add-ons to enable for the new instance. *
*/ private java.util.List* The IP address type for the instance. *
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
*
* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for
* example: ["MyFirstInstance","MySecondInstance"]
*
["MyFirstInstance","MySecondInstance"]
*/
public java.util.List
* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for
* example: ["MyFirstInstance","MySecondInstance"]
*
["MyFirstInstance","MySecondInstance"]
*/
public void setInstanceNames(java.util.Collection
* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for
* example: ["MyFirstInstance","MySecondInstance"]
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setInstanceNames(java.util.Collection)} or {@link #withInstanceNames(java.util.Collection)} if you want * to override the existing values. *
* * @param instanceNames * The names to use for your new Lightsail instances. Separate multiple values using quotation marks and * commas, for example:["MyFirstInstance","MySecondInstance"]
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withInstanceNames(String... instanceNames) {
if (this.instanceNames == null) {
setInstanceNames(new java.util.ArrayList
* The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for
* example: ["MyFirstInstance","MySecondInstance"]
*
["MyFirstInstance","MySecondInstance"]
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withInstanceNames(java.util.Collection
* The Availability Zone in which to create your instance. Use the following format: us-east-2a
(case
* sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*
us-east-2a
* (case sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* The Availability Zone in which to create your instance. Use the following format: us-east-2a
(case
* sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*
us-east-2a
* (case sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* The Availability Zone in which to create your instance. Use the following format: us-east-2a
(case
* sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
*
us-east-2a
* (case sensitive). You can get a list of Availability Zones by using the get regions
* operation. Be sure to add the include Availability Zones
parameter to your request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
* * (Deprecated) The name for your custom image. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
*/ @Deprecated public void setCustomImageName(String customImageName) { this.customImageName = customImageName; } /** ** (Deprecated) The name for your custom image. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
*/ @Deprecated public String getCustomImageName() { return this.customImageName; } /** ** (Deprecated) The name for your custom image. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
** In releases prior to June 12, 2017, this parameter was ignored by the API. It is now deprecated. *
* @return Returns a reference to this object so that method calls can be chained together. */ @Deprecated public CreateInstancesRequest withCustomImageName(String customImageName) { setCustomImageName(customImageName); return this; } /** *
* The ID for a virtual private server image (e.g., app_wordpress_4_4
or app_lamp_7_0
).
* Use the get blueprints
operation to return a list of available images (or blueprints).
*
* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *
*app_wordpress_4_4
or
* app_lamp_7_0
). Use the get blueprints
operation to return a list of available
* images (or blueprints). * Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *
*/ public void setBlueprintId(String blueprintId) { this.blueprintId = blueprintId; } /** *
* The ID for a virtual private server image (e.g., app_wordpress_4_4
or app_lamp_7_0
).
* Use the get blueprints
operation to return a list of available images (or blueprints).
*
* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *
*app_wordpress_4_4
or
* app_lamp_7_0
). Use the get blueprints
operation to return a list of available
* images (or blueprints). * Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *
*/ public String getBlueprintId() { return this.blueprintId; } /** *
* The ID for a virtual private server image (e.g., app_wordpress_4_4
or app_lamp_7_0
).
* Use the get blueprints
operation to return a list of available images (or blueprints).
*
* Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with * existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when * they become outdated due to operating system updates or new application releases. *
*app_wordpress_4_4
or
* app_lamp_7_0
). Use the get blueprints
operation to return a list of available
* images (or blueprints). * Use active blueprints when creating new instances. Inactive blueprints are listed to support customers * with existing instances and are not necessarily available to create new instances. Blueprints are marked * inactive when they become outdated due to operating system updates or new application releases. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withBlueprintId(String blueprintId) { setBlueprintId(blueprintId); return this; } /** *
* The bundle of specification information for your virtual private server (or instance), including the
* pricing plan (e.g., micro_1_0
).
*
micro_1_0
).
*/
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
/**
*
* The bundle of specification information for your virtual private server (or instance), including the
* pricing plan (e.g., micro_1_0
).
*
micro_1_0
).
*/
public String getBundleId() {
return this.bundleId;
}
/**
*
* The bundle of specification information for your virtual private server (or instance), including the
* pricing plan (e.g., micro_1_0
).
*
micro_1_0
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withBundleId(String bundleId) {
setBundleId(bundleId);
return this;
}
/**
*
* A launch script you can create that configures a server with additional user data. For example, you might want to
* run apt-get -y update
.
*
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and
* CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses pkg
. For a
* complete list, see the Amazon Lightsail Developer Guide.
*
apt-get -y update
.
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon
* Linux and CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses
* pkg
. For a complete list, see the Amazon Lightsail Developer Guide.
*
* A launch script you can create that configures a server with additional user data. For example, you might want to
* run apt-get -y update
.
*
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and
* CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses pkg
. For a
* complete list, see the Amazon Lightsail Developer Guide.
*
apt-get -y update
.
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon
* Linux and CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses
* pkg
. For a complete list, see the Amazon Lightsail Developer Guide.
*
* A launch script you can create that configures a server with additional user data. For example, you might want to
* run apt-get -y update
.
*
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and
* CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses pkg
. For a
* complete list, see the Amazon Lightsail Developer Guide.
*
apt-get -y update
.
* Depending on the machine image you choose, the command to get software on your instance varies. Amazon
* Linux and CentOS use yum
, Debian and Ubuntu use apt-get
, and FreeBSD uses
* pkg
. For a complete list, see the Amazon Lightsail Developer Guide.
*
* The name of your key pair. *
* * @param keyPairName * The name of your key pair. */ public void setKeyPairName(String keyPairName) { this.keyPairName = keyPairName; } /** ** The name of your key pair. *
* * @return The name of your key pair. */ public String getKeyPairName() { return this.keyPairName; } /** ** The name of your key pair. *
* * @param keyPairName * The name of your key pair. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateInstancesRequest withKeyPairName(String keyPairName) { setKeyPairName(keyPairName); return this; } /** ** The tag keys and optional values to add to the resource during create. *
*
* Use the TagResource
action to tag a resource after it's created.
*
* Use the
* The tag keys and optional values to add to the resource during create.
*
* Use the TagResource
action to tag a resource after it's created.
*/
public java.util.ListTagResource
action to tag a resource after it's created.
*
* Use the
* The tag keys and optional values to add to the resource during create.
*
* Use the
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
* TagResource
action to tag a resource after it's created.
*/
public void setTags(java.util.CollectionTagResource
action to tag a resource after it's created.
*
* Use the
* The tag keys and optional values to add to the resource during create.
*
* Use the TagResource
action to tag a resource after it's created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayListTagResource
action to tag a resource after it's created.
*
* Use the
* An array of objects representing the add-ons to enable for the new instance.
*
* An array of objects representing the add-ons to enable for the new instance.
*
* An array of objects representing the add-ons to enable for the new instance.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAddOns(java.util.Collection)} or {@link #withAddOns(java.util.Collection)} if you want to override the
* existing values.
*
* An array of objects representing the add-ons to enable for the new instance.
*
* The IP address type for the instance.
*
* The possible values are
* The default value is TagResource
action to tag a resource after it's created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateInstancesRequest withTags(java.util.Collectionipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
* dualstack
.
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
* @see IpAddressType
*/
public void setIpAddressType(String ipAddressType) {
this.ipAddressType = ipAddressType;
}
/**
*
* The IP address type for the instance. *
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
* @see IpAddressType
*/
public String getIpAddressType() {
return this.ipAddressType;
}
/**
*
* The IP address type for the instance. *
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public CreateInstancesRequest withIpAddressType(String ipAddressType) {
setIpAddressType(ipAddressType);
return this;
}
/**
*
* The IP address type for the instance. *
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
*
* The possible values are ipv4
for IPv4 only, and dualstack
for IPv4 and IPv6.
*
* The default value is dualstack
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public CreateInstancesRequest withIpAddressType(IpAddressType ipAddressType) {
this.ipAddressType = ipAddressType.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getInstanceNames() != null)
sb.append("InstanceNames: ").append(getInstanceNames()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getCustomImageName() != null)
sb.append("CustomImageName: ").append(getCustomImageName()).append(",");
if (getBlueprintId() != null)
sb.append("BlueprintId: ").append(getBlueprintId()).append(",");
if (getBundleId() != null)
sb.append("BundleId: ").append(getBundleId()).append(",");
if (getUserData() != null)
sb.append("UserData: ").append(getUserData()).append(",");
if (getKeyPairName() != null)
sb.append("KeyPairName: ").append(getKeyPairName()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getAddOns() != null)
sb.append("AddOns: ").append(getAddOns()).append(",");
if (getIpAddressType() != null)
sb.append("IpAddressType: ").append(getIpAddressType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateInstancesRequest == false)
return false;
CreateInstancesRequest other = (CreateInstancesRequest) obj;
if (other.getInstanceNames() == null ^ this.getInstanceNames() == null)
return false;
if (other.getInstanceNames() != null && other.getInstanceNames().equals(this.getInstanceNames()) == 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.getCustomImageName() == null ^ this.getCustomImageName() == null)
return false;
if (other.getCustomImageName() != null && other.getCustomImageName().equals(this.getCustomImageName()) == false)
return false;
if (other.getBlueprintId() == null ^ this.getBlueprintId() == null)
return false;
if (other.getBlueprintId() != null && other.getBlueprintId().equals(this.getBlueprintId()) == false)
return false;
if (other.getBundleId() == null ^ this.getBundleId() == null)
return false;
if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == false)
return false;
if (other.getUserData() == null ^ this.getUserData() == null)
return false;
if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false)
return false;
if (other.getKeyPairName() == null ^ this.getKeyPairName() == null)
return false;
if (other.getKeyPairName() != null && other.getKeyPairName().equals(this.getKeyPairName()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getAddOns() == null ^ this.getAddOns() == null)
return false;
if (other.getAddOns() != null && other.getAddOns().equals(this.getAddOns()) == false)
return false;
if (other.getIpAddressType() == null ^ this.getIpAddressType() == null)
return false;
if (other.getIpAddressType() != null && other.getIpAddressType().equals(this.getIpAddressType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceNames() == null) ? 0 : getInstanceNames().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getCustomImageName() == null) ? 0 : getCustomImageName().hashCode());
hashCode = prime * hashCode + ((getBlueprintId() == null) ? 0 : getBlueprintId().hashCode());
hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode());
hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode());
hashCode = prime * hashCode + ((getKeyPairName() == null) ? 0 : getKeyPairName().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getAddOns() == null) ? 0 : getAddOns().hashCode());
hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode());
return hashCode;
}
@Override
public CreateInstancesRequest clone() {
return (CreateInstancesRequest) super.clone();
}
}