com.amazonaws.services.ec2.model.FleetData Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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;
/**
*
* Describes an EC2 Fleet.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FleetData implements Serializable, Cloneable {
/**
*
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests are
* placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or greater than
* its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is decreased, the status
* is pending_termination
while instances are terminating.
*
*/
private String activityStatus;
/**
*
* The creation date and time of the EC2 Fleet.
*
*/
private java.util.Date createTime;
/**
*
* The ID of the EC2 Fleet.
*
*/
private String fleetId;
/**
*
* The state of the EC2 Fleet.
*
*/
private String fleetState;
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* Idempotency.
*
*
* Constraints: Maximum 64 ASCII characters
*
*/
private String clientToken;
/**
*
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased
* below the current size of the EC2 Fleet.
*
*/
private String excessCapacityTerminationPolicy;
/**
*
* The number of units fulfilled by this request compared to the set target capacity.
*
*/
private Double fulfilledCapacity;
/**
*
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*/
private Double fulfilledOnDemandCapacity;
/**
*
* The launch template and overrides.
*
*/
private com.amazonaws.internal.SdkInternalList launchTemplateConfigs;
/**
*
* The number of units to request. You can choose to set the target capacity in terms of instances or a performance
* characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type
* is maintain
, you can specify a target capacity of 0 and add capacity later.
*
*/
private TargetCapacitySpecification targetCapacitySpecification;
/**
*
* Indicates whether running instances should be terminated when the EC2 Fleet expires.
*
*/
private Boolean terminateInstancesWithExpiration;
/**
*
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or also
* attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places the
* required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit
* requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2
* Fleet places the required requests to meet this target capacity. It also automatically replenishes any
* interrupted Spot Instances. Default: maintain
.
*
*/
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 instance requests are
* placed or able to fulfill the request. The default end date is 7 days from the current date.
*
*/
private java.util.Date validUntil;
/**
*
* Indicates whether EC2 Fleet should replace unhealthy instances.
*
*/
private Boolean replaceUnhealthyInstances;
/**
*
* The configuration of Spot Instances in an EC2 Fleet.
*
*/
private SpotOptions spotOptions;
/**
*
* The tags for an EC2 Fleet resource.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests are
* placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or greater than
* its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is decreased, the status
* is pending_termination
while instances are terminating.
*
*
* @param activityStatus
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests
* are placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or
* greater than its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is
* decreased, the status is pending_termination
while instances are terminating.
* @see FleetActivityStatus
*/
public void setActivityStatus(String activityStatus) {
this.activityStatus = activityStatus;
}
/**
*
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests are
* placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or greater than
* its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is decreased, the status
* is pending_termination
while instances are terminating.
*
*
* @return The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests
* are placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or
* greater than its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is
* decreased, the status is pending_termination
while instances are terminating.
* @see FleetActivityStatus
*/
public String getActivityStatus() {
return this.activityStatus;
}
/**
*
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests are
* placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or greater than
* its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is decreased, the status
* is pending_termination
while instances are terminating.
*
*
* @param activityStatus
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests
* are placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or
* greater than its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is
* decreased, the status is pending_termination
while instances are terminating.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetActivityStatus
*/
public FleetData withActivityStatus(String activityStatus) {
setActivityStatus(activityStatus);
return this;
}
/**
*
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests are
* placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or greater than
* its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is decreased, the status
* is pending_termination
while instances are terminating.
*
*
* @param activityStatus
* The progress of the EC2 Fleet. If there is an error, the status is error
. After all requests
* are placed, the status is pending_fulfillment
. If the size of the EC2 Fleet is equal to or
* greater than its target capacity, the status is fulfilled
. If the size of the EC2 Fleet is
* decreased, the status is pending_termination
while instances are terminating.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetActivityStatus
*/
public FleetData withActivityStatus(FleetActivityStatus activityStatus) {
this.activityStatus = activityStatus.toString();
return this;
}
/**
*
* The creation date and time of the EC2 Fleet.
*
*
* @param createTime
* The creation date and time of the EC2 Fleet.
*/
public void setCreateTime(java.util.Date createTime) {
this.createTime = createTime;
}
/**
*
* The creation date and time of the EC2 Fleet.
*
*
* @return The creation date and time of the EC2 Fleet.
*/
public java.util.Date getCreateTime() {
return this.createTime;
}
/**
*
* The creation date and time of the EC2 Fleet.
*
*
* @param createTime
* The creation date and time of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withCreateTime(java.util.Date createTime) {
setCreateTime(createTime);
return this;
}
/**
*
* The ID of the EC2 Fleet.
*
*
* @param fleetId
* The ID of the EC2 Fleet.
*/
public void setFleetId(String fleetId) {
this.fleetId = fleetId;
}
/**
*
* The ID of the EC2 Fleet.
*
*
* @return The ID of the EC2 Fleet.
*/
public String getFleetId() {
return this.fleetId;
}
/**
*
* The ID of the EC2 Fleet.
*
*
* @param fleetId
* The ID of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withFleetId(String fleetId) {
setFleetId(fleetId);
return this;
}
/**
*
* The state of the EC2 Fleet.
*
*
* @param fleetState
* The state of the EC2 Fleet.
* @see FleetStateCode
*/
public void setFleetState(String fleetState) {
this.fleetState = fleetState;
}
/**
*
* The state of the EC2 Fleet.
*
*
* @return The state of the EC2 Fleet.
* @see FleetStateCode
*/
public String getFleetState() {
return this.fleetState;
}
/**
*
* The state of the EC2 Fleet.
*
*
* @param fleetState
* The state of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetStateCode
*/
public FleetData withFleetState(String fleetState) {
setFleetState(fleetState);
return this;
}
/**
*
* The state of the EC2 Fleet.
*
*
* @param fleetState
* The state of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetStateCode
*/
public FleetData withFleetState(FleetStateCode fleetState) {
this.fleetState = fleetState.toString();
return this;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* Idempotency.
*
*
* Constraints: Maximum 64 ASCII characters
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* Idempotency.
*
* Constraints: Maximum 64 ASCII characters
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* Idempotency.
*
*
* Constraints: Maximum 64 ASCII characters
*
*
* @return Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* Idempotency.
*
* Constraints: Maximum 64 ASCII characters
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* Ensuring
* Idempotency.
*
*
* Constraints: Maximum 64 ASCII characters
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see Ensuring
* Idempotency.
*
* Constraints: Maximum 64 ASCII characters
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased
* below the current size of the EC2 Fleet.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
* @see FleetExcessCapacityTerminationPolicy
*/
public void setExcessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) {
this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy;
}
/**
*
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased
* below the current size of the EC2 Fleet.
*
*
* @return Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
* @see FleetExcessCapacityTerminationPolicy
*/
public String getExcessCapacityTerminationPolicy() {
return this.excessCapacityTerminationPolicy;
}
/**
*
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased
* below the current size of the EC2 Fleet.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetExcessCapacityTerminationPolicy
*/
public FleetData withExcessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) {
setExcessCapacityTerminationPolicy(excessCapacityTerminationPolicy);
return this;
}
/**
*
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is decreased
* below the current size of the EC2 Fleet.
*
*
* @param excessCapacityTerminationPolicy
* Indicates whether running instances should be terminated if the target capacity of the EC2 Fleet is
* decreased below the current size of the EC2 Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetExcessCapacityTerminationPolicy
*/
public FleetData withExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy excessCapacityTerminationPolicy) {
this.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy.toString();
return this;
}
/**
*
* The number of units fulfilled by this request compared to the set target capacity.
*
*
* @param fulfilledCapacity
* The number of units fulfilled by this request compared to the set target capacity.
*/
public void setFulfilledCapacity(Double fulfilledCapacity) {
this.fulfilledCapacity = fulfilledCapacity;
}
/**
*
* The number of units fulfilled by this request compared to the set target capacity.
*
*
* @return The number of units fulfilled by this request compared to the set target capacity.
*/
public Double getFulfilledCapacity() {
return this.fulfilledCapacity;
}
/**
*
* The number of units fulfilled by this request compared to the set target capacity.
*
*
* @param fulfilledCapacity
* The number of units fulfilled by this request compared to the set target capacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withFulfilledCapacity(Double fulfilledCapacity) {
setFulfilledCapacity(fulfilledCapacity);
return this;
}
/**
*
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*
* @param fulfilledOnDemandCapacity
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*/
public void setFulfilledOnDemandCapacity(Double fulfilledOnDemandCapacity) {
this.fulfilledOnDemandCapacity = fulfilledOnDemandCapacity;
}
/**
*
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*
* @return The number of units fulfilled by this request compared to the set target On-Demand capacity.
*/
public Double getFulfilledOnDemandCapacity() {
return this.fulfilledOnDemandCapacity;
}
/**
*
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*
* @param fulfilledOnDemandCapacity
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withFulfilledOnDemandCapacity(Double fulfilledOnDemandCapacity) {
setFulfilledOnDemandCapacity(fulfilledOnDemandCapacity);
return this;
}
/**
*
* The launch template and overrides.
*
*
* @return The launch template and overrides.
*/
public java.util.List getLaunchTemplateConfigs() {
if (launchTemplateConfigs == null) {
launchTemplateConfigs = new com.amazonaws.internal.SdkInternalList();
}
return launchTemplateConfigs;
}
/**
*
* The launch template and overrides.
*
*
* @param launchTemplateConfigs
* The launch template and overrides.
*/
public void setLaunchTemplateConfigs(java.util.Collection launchTemplateConfigs) {
if (launchTemplateConfigs == null) {
this.launchTemplateConfigs = null;
return;
}
this.launchTemplateConfigs = new com.amazonaws.internal.SdkInternalList(launchTemplateConfigs);
}
/**
*
* The launch template and overrides.
*
*
* 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 launch template and overrides.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withLaunchTemplateConfigs(FleetLaunchTemplateConfig... launchTemplateConfigs) {
if (this.launchTemplateConfigs == null) {
setLaunchTemplateConfigs(new com.amazonaws.internal.SdkInternalList(launchTemplateConfigs.length));
}
for (FleetLaunchTemplateConfig ele : launchTemplateConfigs) {
this.launchTemplateConfigs.add(ele);
}
return this;
}
/**
*
* The launch template and overrides.
*
*
* @param launchTemplateConfigs
* The launch template and overrides.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withLaunchTemplateConfigs(java.util.Collection launchTemplateConfigs) {
setLaunchTemplateConfigs(launchTemplateConfigs);
return this;
}
/**
*
* The number of units to request. You can choose to set the target capacity in terms of instances or a performance
* characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type
* is maintain
, you can specify a target capacity of 0 and add capacity later.
*
*
* @param targetCapacitySpecification
* The number of units to request. You can choose to set the target capacity in terms of instances or a
* performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O.
* If the request type is maintain
, you can specify a target capacity of 0 and add capacity
* later.
*/
public void setTargetCapacitySpecification(TargetCapacitySpecification targetCapacitySpecification) {
this.targetCapacitySpecification = targetCapacitySpecification;
}
/**
*
* The number of units to request. You can choose to set the target capacity in terms of instances or a performance
* characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type
* is maintain
, you can specify a target capacity of 0 and add capacity later.
*
*
* @return The number of units to request. You can choose to set the target capacity in terms of instances or a
* performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O.
* If the request type is maintain
, you can specify a target capacity of 0 and add capacity
* later.
*/
public TargetCapacitySpecification getTargetCapacitySpecification() {
return this.targetCapacitySpecification;
}
/**
*
* The number of units to request. You can choose to set the target capacity in terms of instances or a performance
* characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type
* is maintain
, you can specify a target capacity of 0 and add capacity later.
*
*
* @param targetCapacitySpecification
* The number of units to request. You can choose to set the target capacity in terms of instances or a
* performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O.
* If the request type is maintain
, you can specify a target capacity of 0 and add capacity
* later.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withTargetCapacitySpecification(TargetCapacitySpecification 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 FleetData 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 type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or also
* attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places the
* required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit
* requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2
* Fleet places the required requests to meet this target capacity. It also automatically replenishes any
* interrupted Spot Instances. Default: maintain
.
*
*
* @param type
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or
* also attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places
* the required requests; it does not attempt to replenish instances if capacity is diminished, and does not
* submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target
* capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically
* replenishes any interrupted Spot Instances. Default: maintain
.
* @see FleetType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or also
* attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places the
* required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit
* requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2
* Fleet places the required requests to meet this target capacity. It also automatically replenishes any
* interrupted Spot Instances. Default: maintain
.
*
*
* @return The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or
* also attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only
* places the required requests; it does not attempt to replenish instances if capacity is diminished, and
* does not submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain
* target capacity, EC2 Fleet places the required requests to meet this target capacity. It also
* automatically replenishes any interrupted Spot Instances. Default: maintain
.
* @see FleetType
*/
public String getType() {
return this.type;
}
/**
*
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or also
* attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places the
* required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit
* requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2
* Fleet places the required requests to meet this target capacity. It also automatically replenishes any
* interrupted Spot Instances. Default: maintain
.
*
*
* @param type
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or
* also attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places
* the required requests; it does not attempt to replenish instances if capacity is diminished, and does not
* submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target
* capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically
* replenishes any interrupted Spot Instances. Default: maintain
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetType
*/
public FleetData withType(String type) {
setType(type);
return this;
}
/**
*
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or also
* attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places the
* required requests; it does not attempt to replenish instances if capacity is diminished, and does not submit
* requests in alternative capacity pools if capacity is unavailable. To maintain a certain target capacity, EC2
* Fleet places the required requests to meet this target capacity. It also automatically replenishes any
* interrupted Spot Instances. Default: maintain
.
*
*
* @param type
* The type of request. Indicates whether the EC2 Fleet only requests
the target capacity, or
* also attempts to maintain
it. If you request a certain target capacity, EC2 Fleet only places
* the required requests; it does not attempt to replenish instances if capacity is diminished, and does not
* submit requests in alternative capacity pools if capacity is unavailable. To maintain a certain target
* capacity, EC2 Fleet places the required requests to meet this target capacity. It also automatically
* replenishes any interrupted Spot Instances. Default: maintain
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetType
*/
public FleetData 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 FleetData 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 instance requests are
* placed or able to fulfill the request. The default end date is 7 days from the current date.
*
*
* @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 instance requests
* are placed or able to fulfill the request. The default end date is 7 days from the current date.
*/
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 instance requests are
* placed or able to fulfill the request. The default end date is 7 days from the current date.
*
*
* @return The end date and time of the request, in UTC format (for example,
* YYYY-MM-DDTHH:MM:SSZ). At this point, no new instance requests
* are placed or able to fulfill the request. The default end date is 7 days from the current date.
*/
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 instance requests are
* placed or able to fulfill the request. The default end date is 7 days from the current date.
*
*
* @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 instance requests
* are placed or able to fulfill the request. The default end date is 7 days from the current date.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withValidUntil(java.util.Date validUntil) {
setValidUntil(validUntil);
return this;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy instances.
*
*
* @param replaceUnhealthyInstances
* Indicates whether EC2 Fleet should replace unhealthy instances.
*/
public void setReplaceUnhealthyInstances(Boolean replaceUnhealthyInstances) {
this.replaceUnhealthyInstances = replaceUnhealthyInstances;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy instances.
*
*
* @return Indicates whether EC2 Fleet should replace unhealthy instances.
*/
public Boolean getReplaceUnhealthyInstances() {
return this.replaceUnhealthyInstances;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy instances.
*
*
* @param replaceUnhealthyInstances
* Indicates whether EC2 Fleet should replace unhealthy instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withReplaceUnhealthyInstances(Boolean replaceUnhealthyInstances) {
setReplaceUnhealthyInstances(replaceUnhealthyInstances);
return this;
}
/**
*
* Indicates whether EC2 Fleet should replace unhealthy instances.
*
*
* @return Indicates whether EC2 Fleet should replace unhealthy instances.
*/
public Boolean isReplaceUnhealthyInstances() {
return this.replaceUnhealthyInstances;
}
/**
*
* The configuration of Spot Instances in an EC2 Fleet.
*
*
* @param spotOptions
* The configuration of Spot Instances in an EC2 Fleet.
*/
public void setSpotOptions(SpotOptions spotOptions) {
this.spotOptions = spotOptions;
}
/**
*
* The configuration of Spot Instances in an EC2 Fleet.
*
*
* @return The configuration of Spot Instances in an EC2 Fleet.
*/
public SpotOptions getSpotOptions() {
return this.spotOptions;
}
/**
*
* The configuration of Spot Instances in an EC2 Fleet.
*
*
* @param spotOptions
* 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 FleetData withSpotOptions(SpotOptions spotOptions) {
setSpotOptions(spotOptions);
return this;
}
/**
*
* The tags for an EC2 Fleet resource.
*
*
* @return The tags for an EC2 Fleet resource.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* The tags for an EC2 Fleet resource.
*
*
* @param tags
* The tags for an EC2 Fleet resource.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* The tags for an EC2 Fleet resource.
*
*
* 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.
*
*
* @param tags
* The tags for an EC2 Fleet resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The tags for an EC2 Fleet resource.
*
*
* @param tags
* The tags for an EC2 Fleet resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetData withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getActivityStatus() != null)
sb.append("ActivityStatus: ").append(getActivityStatus()).append(",");
if (getCreateTime() != null)
sb.append("CreateTime: ").append(getCreateTime()).append(",");
if (getFleetId() != null)
sb.append("FleetId: ").append(getFleetId()).append(",");
if (getFleetState() != null)
sb.append("FleetState: ").append(getFleetState()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getExcessCapacityTerminationPolicy() != null)
sb.append("ExcessCapacityTerminationPolicy: ").append(getExcessCapacityTerminationPolicy()).append(",");
if (getFulfilledCapacity() != null)
sb.append("FulfilledCapacity: ").append(getFulfilledCapacity()).append(",");
if (getFulfilledOnDemandCapacity() != null)
sb.append("FulfilledOnDemandCapacity: ").append(getFulfilledOnDemandCapacity()).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 (getSpotOptions() != null)
sb.append("SpotOptions: ").append(getSpotOptions()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FleetData == false)
return false;
FleetData other = (FleetData) obj;
if (other.getActivityStatus() == null ^ this.getActivityStatus() == null)
return false;
if (other.getActivityStatus() != null && other.getActivityStatus().equals(this.getActivityStatus()) == false)
return false;
if (other.getCreateTime() == null ^ this.getCreateTime() == null)
return false;
if (other.getCreateTime() != null && other.getCreateTime().equals(this.getCreateTime()) == false)
return false;
if (other.getFleetId() == null ^ this.getFleetId() == null)
return false;
if (other.getFleetId() != null && other.getFleetId().equals(this.getFleetId()) == false)
return false;
if (other.getFleetState() == null ^ this.getFleetState() == null)
return false;
if (other.getFleetState() != null && other.getFleetState().equals(this.getFleetState()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == 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.getFulfilledCapacity() == null ^ this.getFulfilledCapacity() == null)
return false;
if (other.getFulfilledCapacity() != null && other.getFulfilledCapacity().equals(this.getFulfilledCapacity()) == false)
return false;
if (other.getFulfilledOnDemandCapacity() == null ^ this.getFulfilledOnDemandCapacity() == null)
return false;
if (other.getFulfilledOnDemandCapacity() != null && other.getFulfilledOnDemandCapacity().equals(this.getFulfilledOnDemandCapacity()) == 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.getSpotOptions() == null ^ this.getSpotOptions() == null)
return false;
if (other.getSpotOptions() != null && other.getSpotOptions().equals(this.getSpotOptions()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActivityStatus() == null) ? 0 : getActivityStatus().hashCode());
hashCode = prime * hashCode + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
hashCode = prime * hashCode + ((getFleetId() == null) ? 0 : getFleetId().hashCode());
hashCode = prime * hashCode + ((getFleetState() == null) ? 0 : getFleetState().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getExcessCapacityTerminationPolicy() == null) ? 0 : getExcessCapacityTerminationPolicy().hashCode());
hashCode = prime * hashCode + ((getFulfilledCapacity() == null) ? 0 : getFulfilledCapacity().hashCode());
hashCode = prime * hashCode + ((getFulfilledOnDemandCapacity() == null) ? 0 : getFulfilledOnDemandCapacity().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 + ((getSpotOptions() == null) ? 0 : getSpotOptions().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public FleetData clone() {
try {
return (FleetData) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}