com.amazonaws.services.ec2.model.CreateFleetRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateFleetRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateFleetRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest {
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
*/
private String clientToken;
/**
*
* Describes the configuration of Spot Instances in an EC2 Fleet.
*
*/
private SpotOptionsRequest spotOptions;
/**
*
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
*
*/
private OnDemandOptionsRequest onDemandOptions;
/**
*
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
*
* Supported only for fleets of type maintain
.
*
*/
private String excessCapacityTerminationPolicy;
/**
*
* The configuration for the EC2 Fleet.
*
*/
private com.amazonaws.internal.SdkInternalList launchTemplateConfigs;
/**
*
* The number of units to request.
*
*/
private TargetCapacitySpecificationRequest targetCapacitySpecification;
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*/
private Boolean terminateInstancesWithExpiration;
/**
*
* The fleet type. The default value is maintain
.
*
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to
* maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does
* submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot
* capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns
* errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
*
*/
private String type;
/**
*
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request
* immediately.
*
*/
private java.util.Date validFrom;
/**
*
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are
* placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*/
private java.util.Date validUntil;
/**
*
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2
* Fleet health checks in the Amazon EC2 User Guide.
*
*/
private Boolean replaceUnhealthyInstances;
/**
*
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources.
*
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet or
* instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of fleet
* to tag the fleet. You cannot specify a resource type of instance
. To tag instances at launch,
* specify the tags in a launch template.
*
*/
private com.amazonaws.internal.SdkInternalList tagSpecifications;
/**
*
* Reserved.
*
*/
private String context;
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
*
* @param clientToken
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
*
* @return Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
*
*
* @param clientToken
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* idempotency.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* Describes the configuration of Spot Instances in an EC2 Fleet.
*
*
* @param spotOptions
* Describes the configuration of Spot Instances in an EC2 Fleet.
*/
public void setSpotOptions(SpotOptionsRequest spotOptions) {
this.spotOptions = spotOptions;
}
/**
*
* Describes the configuration of Spot Instances in an EC2 Fleet.
*
*
* @return Describes the configuration of Spot Instances in an EC2 Fleet.
*/
public SpotOptionsRequest getSpotOptions() {
return this.spotOptions;
}
/**
*
* Describes the configuration of Spot Instances in an EC2 Fleet.
*
*
* @param spotOptions
* Describes the configuration of Spot Instances in an EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withSpotOptions(SpotOptionsRequest spotOptions) {
setSpotOptions(spotOptions);
return this;
}
/**
*
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
*
*
* @param onDemandOptions
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
*/
public void setOnDemandOptions(OnDemandOptionsRequest onDemandOptions) {
this.onDemandOptions = onDemandOptions;
}
/**
*
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
*
*
* @return Describes the configuration of On-Demand Instances in an EC2 Fleet.
*/
public OnDemandOptionsRequest getOnDemandOptions() {
return this.onDemandOptions;
}
/**
*
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
*
*
* @param onDemandOptions
* Describes the configuration of On-Demand Instances in an EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withOnDemandOptions(OnDemandOptionsRequest onDemandOptions) {
setOnDemandOptions(onDemandOptions);
return this;
}
/**
*
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
*
* Supported only for fleets of type maintain
.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
* Supported only for fleets of type maintain
.
* @see FleetExcessCapacityTerminationPolicy
*/
public void setExcessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) {
this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy;
}
/**
*
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
*
* Supported only for fleets of type maintain
.
*
*
* @return Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
* Supported only for fleets of type maintain
.
* @see FleetExcessCapacityTerminationPolicy
*/
public String getExcessCapacityTerminationPolicy() {
return this.excessCapacityTerminationPolicy;
}
/**
*
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
*
* Supported only for fleets of type maintain
.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
* Supported only for fleets of type maintain
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetExcessCapacityTerminationPolicy
*/
public CreateFleetRequest withExcessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) {
setExcessCapacityTerminationPolicy(excessCapacityTerminationPolicy);
return this;
}
/**
*
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
*
* Supported only for fleets of type maintain
.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
*
* Supported only for fleets of type maintain
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetExcessCapacityTerminationPolicy
*/
public CreateFleetRequest withExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy excessCapacityTerminationPolicy) {
this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy.toString();
return this;
}
/**
*
* The configuration for the EC2 Fleet.
*
*
* @return The configuration for the EC2 Fleet.
*/
public java.util.List getLaunchTemplateConfigs() {
if (launchTemplateConfigs == null) {
launchTemplateConfigs = new com.amazonaws.internal.SdkInternalList();
}
return launchTemplateConfigs;
}
/**
*
* The configuration for the EC2 Fleet.
*
*
* @param launchTemplateConfigs
* The configuration for the EC2 Fleet.
*/
public void setLaunchTemplateConfigs(java.util.Collection launchTemplateConfigs) {
if (launchTemplateConfigs == null) {
this.launchTemplateConfigs = null;
return;
}
this.launchTemplateConfigs = new com.amazonaws.internal.SdkInternalList(launchTemplateConfigs);
}
/**
*
* The configuration for the EC2 Fleet.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLaunchTemplateConfigs(java.util.Collection)} or
* {@link #withLaunchTemplateConfigs(java.util.Collection)} if you want to override the existing values.
*
*
* @param launchTemplateConfigs
* The configuration for the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withLaunchTemplateConfigs(FleetLaunchTemplateConfigRequest... launchTemplateConfigs) {
if (this.launchTemplateConfigs == null) {
setLaunchTemplateConfigs(new com.amazonaws.internal.SdkInternalList(launchTemplateConfigs.length));
}
for (FleetLaunchTemplateConfigRequest ele : launchTemplateConfigs) {
this.launchTemplateConfigs.add(ele);
}
return this;
}
/**
*
* The configuration for the EC2 Fleet.
*
*
* @param launchTemplateConfigs
* The configuration for the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withLaunchTemplateConfigs(java.util.Collection launchTemplateConfigs) {
setLaunchTemplateConfigs(launchTemplateConfigs);
return this;
}
/**
*
* The number of units to request.
*
*
* @param targetCapacitySpecification
* The number of units to request.
*/
public void setTargetCapacitySpecification(TargetCapacitySpecificationRequest targetCapacitySpecification) {
this.targetCapacitySpecification = targetCapacitySpecification;
}
/**
*
* The number of units to request.
*
*
* @return The number of units to request.
*/
public TargetCapacitySpecificationRequest getTargetCapacitySpecification() {
return this.targetCapacitySpecification;
}
/**
*
* The number of units to request.
*
*
* @param targetCapacitySpecification
* The number of units to request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withTargetCapacitySpecification(TargetCapacitySpecificationRequest targetCapacitySpecification) {
setTargetCapacitySpecification(targetCapacitySpecification);
return this;
}
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*
* @param terminateInstancesWithExpiration
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*/
public void setTerminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) {
this.terminateInstancesWithExpiration = terminateInstancesWithExpiration;
}
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*
* @return Indicates whether running instances should be terminated when the EC2 Fleet expires.
*/
public Boolean getTerminateInstancesWithExpiration() {
return this.terminateInstancesWithExpiration;
}
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*
* @param terminateInstancesWithExpiration
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withTerminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) {
setTerminateInstancesWithExpiration(terminateInstancesWithExpiration);
return this;
}
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*
* @return Indicates whether running instances should be terminated when the EC2 Fleet expires.
*/
public Boolean isTerminateInstancesWithExpiration() {
return this.terminateInstancesWithExpiration;
}
/**
*
* The fleet type. The default value is maintain
.
*
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to
* maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does
* submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot
* capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns
* errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
*
*
* @param type
* The fleet type. The default value is maintain
.
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and
* continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity,
* but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not
* maintain Spot capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and
* returns errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
* @see FleetType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The fleet type. The default value is maintain
.
*
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to
* maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does
* submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot
* capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns
* errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
*
*
* @return The fleet type. The default value is maintain
.
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and
* continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity,
* but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not
* maintain Spot capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and
* returns errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
* @see FleetType
*/
public String getType() {
return this.type;
}
/**
*
* The fleet type. The default value is maintain
.
*
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to
* maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does
* submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot
* capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns
* errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
*
*
* @param type
* The fleet type. The default value is maintain
.
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and
* continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity,
* but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not
* maintain Spot capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and
* returns errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetType
*/
public CreateFleetRequest withType(String type) {
setType(type);
return this;
}
/**
*
* The fleet type. The default value is maintain
.
*
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to
* maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does
* submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot
* capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns
* errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
*
*
* @param type
* The fleet type. The default value is maintain
.
*
* -
*
* maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and
* continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.
*
*
* -
*
* request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity,
* but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not
* maintain Spot capacity if Spot Instances are interrupted.
*
*
* -
*
* instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and
* returns errors for any instances that could not be launched.
*
*
*
*
* For more information, see EC2 Fleet request
* types in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetType
*/
public CreateFleetRequest withType(FleetType type) {
this.type = type.toString();
return this;
}
/**
*
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request
* immediately.
*
*
* @param validFrom
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the
* request immediately.
*/
public void setValidFrom(java.util.Date validFrom) {
this.validFrom = validFrom;
}
/**
*
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request
* immediately.
*
*
* @return The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the
* request immediately.
*/
public java.util.Date getValidFrom() {
return this.validFrom;
}
/**
*
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request
* immediately.
*
*
* @param validFrom
* The start date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the
* request immediately.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withValidFrom(java.util.Date validFrom) {
setValidFrom(validFrom);
return this;
}
/**
*
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are
* placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*
* @param validUntil
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests
* are placed or able to fulfill the request. If no value is specified, the request remains until you cancel
* it.
*/
public void setValidUntil(java.util.Date validUntil) {
this.validUntil = validUntil;
}
/**
*
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are
* placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*
* @return The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests
* are placed or able to fulfill the request. If no value is specified, the request remains until you cancel
* it.
*/
public java.util.Date getValidUntil() {
return this.validUntil;
}
/**
*
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are
* placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*
* @param validUntil
* The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests
* are placed or able to fulfill the request. If no value is specified, the request remains until you cancel
* it.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withValidUntil(java.util.Date validUntil) {
setValidUntil(validUntil);
return this;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2
* Fleet health checks in the Amazon EC2 User Guide.
*
*
* @param replaceUnhealthyInstances
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide.
*/
public void setReplaceUnhealthyInstances(Boolean replaceUnhealthyInstances) {
this.replaceUnhealthyInstances = replaceUnhealthyInstances;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2
* Fleet health checks in the Amazon EC2 User Guide.
*
*
* @return Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide.
*/
public Boolean getReplaceUnhealthyInstances() {
return this.replaceUnhealthyInstances;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2
* Fleet health checks in the Amazon EC2 User Guide.
*
*
* @param replaceUnhealthyInstances
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withReplaceUnhealthyInstances(Boolean replaceUnhealthyInstances) {
setReplaceUnhealthyInstances(replaceUnhealthyInstances);
return this;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2
* Fleet health checks in the Amazon EC2 User Guide.
*
*
* @return Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of type
* maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide.
*/
public Boolean isReplaceUnhealthyInstances() {
return this.replaceUnhealthyInstances;
}
/**
*
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources.
*
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet or
* instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of fleet
* to tag the fleet. You cannot specify a resource type of instance
. To tag instances at launch,
* specify the tags in a launch template.
*
*
* @return The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your
* resources.
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet
* or instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of
* fleet
to tag the fleet. You cannot specify a resource type of instance
. To tag
* instances at launch, specify the tags in a launch template.
*/
public java.util.List getTagSpecifications() {
if (tagSpecifications == null) {
tagSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return tagSpecifications;
}
/**
*
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources.
*
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet or
* instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of fleet
* to tag the fleet. You cannot specify a resource type of instance
. To tag instances at launch,
* specify the tags in a launch template.
*
*
* @param tagSpecifications
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your
* resources.
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet
* or instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of
* fleet
to tag the fleet. You cannot specify a resource type of instance
. To tag
* instances at launch, specify the tags in a launch template.
*/
public void setTagSpecifications(java.util.Collection tagSpecifications) {
if (tagSpecifications == null) {
this.tagSpecifications = null;
return;
}
this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(tagSpecifications);
}
/**
*
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources.
*
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet or
* instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of fleet
* to tag the fleet. You cannot specify a resource type of instance
. To tag instances at launch,
* specify the tags in a launch template.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param tagSpecifications
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your
* resources.
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet
* or instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of
* fleet
to tag the fleet. You cannot specify a resource type of instance
. To tag
* instances at launch, specify the tags in a launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withTagSpecifications(TagSpecification... tagSpecifications) {
if (this.tagSpecifications == null) {
setTagSpecifications(new com.amazonaws.internal.SdkInternalList(tagSpecifications.length));
}
for (TagSpecification ele : tagSpecifications) {
this.tagSpecifications.add(ele);
}
return this;
}
/**
*
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources.
*
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet or
* instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of fleet
* to tag the fleet. You cannot specify a resource type of instance
. To tag instances at launch,
* specify the tags in a launch template.
*
*
* @param tagSpecifications
* The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your
* resources.
*
* If the fleet type is instant
, specify a resource type of fleet
to tag the fleet
* or instance
to tag the instances at launch.
*
*
* If the fleet type is maintain
or request
, specify a resource type of
* fleet
to tag the fleet. You cannot specify a resource type of instance
. To tag
* instances at launch, specify the tags in a launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withTagSpecifications(java.util.Collection tagSpecifications) {
setTagSpecifications(tagSpecifications);
return this;
}
/**
*
* Reserved.
*
*
* @param context
* Reserved.
*/
public void setContext(String context) {
this.context = context;
}
/**
*
* Reserved.
*
*
* @return Reserved.
*/
public String getContext() {
return this.context;
}
/**
*
* Reserved.
*
*
* @param context
* Reserved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateFleetRequest withContext(String context) {
setContext(context);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
@Override
public Request getDryRunRequest() {
Request request = new CreateFleetRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* 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 (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getSpotOptions() != null)
sb.append("SpotOptions: ").append(getSpotOptions()).append(",");
if (getOnDemandOptions() != null)
sb.append("OnDemandOptions: ").append(getOnDemandOptions()).append(",");
if (getExcessCapacityTerminationPolicy() != null)
sb.append("ExcessCapacityTerminationPolicy: ").append(getExcessCapacityTerminationPolicy()).append(",");
if (getLaunchTemplateConfigs() != null)
sb.append("LaunchTemplateConfigs: ").append(getLaunchTemplateConfigs()).append(",");
if (getTargetCapacitySpecification() != null)
sb.append("TargetCapacitySpecification: ").append(getTargetCapacitySpecification()).append(",");
if (getTerminateInstancesWithExpiration() != null)
sb.append("TerminateInstancesWithExpiration: ").append(getTerminateInstancesWithExpiration()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getValidFrom() != null)
sb.append("ValidFrom: ").append(getValidFrom()).append(",");
if (getValidUntil() != null)
sb.append("ValidUntil: ").append(getValidUntil()).append(",");
if (getReplaceUnhealthyInstances() != null)
sb.append("ReplaceUnhealthyInstances: ").append(getReplaceUnhealthyInstances()).append(",");
if (getTagSpecifications() != null)
sb.append("TagSpecifications: ").append(getTagSpecifications()).append(",");
if (getContext() != null)
sb.append("Context: ").append(getContext());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateFleetRequest == false)
return false;
CreateFleetRequest other = (CreateFleetRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getSpotOptions() == null ^ this.getSpotOptions() == null)
return false;
if (other.getSpotOptions() != null && other.getSpotOptions().equals(this.getSpotOptions()) == false)
return false;
if (other.getOnDemandOptions() == null ^ this.getOnDemandOptions() == null)
return false;
if (other.getOnDemandOptions() != null && other.getOnDemandOptions().equals(this.getOnDemandOptions()) == false)
return false;
if (other.getExcessCapacityTerminationPolicy() == null ^ this.getExcessCapacityTerminationPolicy() == null)
return false;
if (other.getExcessCapacityTerminationPolicy() != null
&& other.getExcessCapacityTerminationPolicy().equals(this.getExcessCapacityTerminationPolicy()) == false)
return false;
if (other.getLaunchTemplateConfigs() == null ^ this.getLaunchTemplateConfigs() == null)
return false;
if (other.getLaunchTemplateConfigs() != null && other.getLaunchTemplateConfigs().equals(this.getLaunchTemplateConfigs()) == false)
return false;
if (other.getTargetCapacitySpecification() == null ^ this.getTargetCapacitySpecification() == null)
return false;
if (other.getTargetCapacitySpecification() != null && other.getTargetCapacitySpecification().equals(this.getTargetCapacitySpecification()) == false)
return false;
if (other.getTerminateInstancesWithExpiration() == null ^ this.getTerminateInstancesWithExpiration() == null)
return false;
if (other.getTerminateInstancesWithExpiration() != null
&& other.getTerminateInstancesWithExpiration().equals(this.getTerminateInstancesWithExpiration()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getValidFrom() == null ^ this.getValidFrom() == null)
return false;
if (other.getValidFrom() != null && other.getValidFrom().equals(this.getValidFrom()) == false)
return false;
if (other.getValidUntil() == null ^ this.getValidUntil() == null)
return false;
if (other.getValidUntil() != null && other.getValidUntil().equals(this.getValidUntil()) == false)
return false;
if (other.getReplaceUnhealthyInstances() == null ^ this.getReplaceUnhealthyInstances() == null)
return false;
if (other.getReplaceUnhealthyInstances() != null && other.getReplaceUnhealthyInstances().equals(this.getReplaceUnhealthyInstances()) == false)
return false;
if (other.getTagSpecifications() == null ^ this.getTagSpecifications() == null)
return false;
if (other.getTagSpecifications() != null && other.getTagSpecifications().equals(this.getTagSpecifications()) == false)
return false;
if (other.getContext() == null ^ this.getContext() == null)
return false;
if (other.getContext() != null && other.getContext().equals(this.getContext()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getSpotOptions() == null) ? 0 : getSpotOptions().hashCode());
hashCode = prime * hashCode + ((getOnDemandOptions() == null) ? 0 : getOnDemandOptions().hashCode());
hashCode = prime * hashCode + ((getExcessCapacityTerminationPolicy() == null) ? 0 : getExcessCapacityTerminationPolicy().hashCode());
hashCode = prime * hashCode + ((getLaunchTemplateConfigs() == null) ? 0 : getLaunchTemplateConfigs().hashCode());
hashCode = prime * hashCode + ((getTargetCapacitySpecification() == null) ? 0 : getTargetCapacitySpecification().hashCode());
hashCode = prime * hashCode + ((getTerminateInstancesWithExpiration() == null) ? 0 : getTerminateInstancesWithExpiration().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getValidFrom() == null) ? 0 : getValidFrom().hashCode());
hashCode = prime * hashCode + ((getValidUntil() == null) ? 0 : getValidUntil().hashCode());
hashCode = prime * hashCode + ((getReplaceUnhealthyInstances() == null) ? 0 : getReplaceUnhealthyInstances().hashCode());
hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode());
hashCode = prime * hashCode + ((getContext() == null) ? 0 : getContext().hashCode());
return hashCode;
}
@Override
public CreateFleetRequest clone() {
return (CreateFleetRequest) super.clone();
}
}