/*
* 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.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.CreateCapacityReservationFleetRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateCapacityReservationFleetRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest
* The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use.
* Currently, only the
* Valid values:
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensure
* Idempotency.
*
* Information about the instance types for which to reserve the capacity.
*
* Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this
* tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings:
*
*
*
* The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with
* the instance type weights that you assign to each instance type used by the Fleet determine the number of
* instances for which the Fleet reserves capacity. Both values are based on units that make sense for your
* workload. For more information, see Total target
* capacity in the Amazon EC2 User Guide.
*
* The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires,
* its state changes to
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify
*
* Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in
* the Fleet inherit this instance matching criteria.
*
* Currently, Capacity Reservation Fleets support
* The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity
* Reservations in the Fleet.
*
* The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use.
* Currently, only the
* Valid values: prioritized
allocation strategy is supported. For more information, see Allocation
* strategy in the Amazon EC2 User Guide.
* prioritized
*
*
*/
private String tenancy;
/**
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web
* Services accounts.
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
* expired
and all of the Capacity Reservations in the Fleet expire.
* 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to expire between
* 13:30:55
and 14:30:55
on 5/31/2019
.
* open
instance matching criteria only. This means that
* instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity
* Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its
* reserved capacity.
* prioritized
allocation strategy is supported. For more information, see Allocation
* strategy in the Amazon EC2 User Guide.
* prioritized
* prioritized
allocation strategy is supported. For more information,
* see
* Allocation strategy in the Amazon EC2 User Guide.
* Valid values: prioritized
*/
public void setAllocationStrategy(String allocationStrategy) {
this.allocationStrategy = allocationStrategy;
}
/**
*
* The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use.
* Currently, only the prioritized
allocation strategy is supported. For more information, see Allocation
* strategy in the Amazon EC2 User Guide.
*
* Valid values: prioritized
*
prioritized
allocation strategy is supported. For more information,
* see
* Allocation strategy in the Amazon EC2 User Guide.
*
* Valid values: prioritized
*/
public String getAllocationStrategy() {
return this.allocationStrategy;
}
/**
*
* The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use.
* Currently, only the prioritized
allocation strategy is supported. For more information, see Allocation
* strategy in the Amazon EC2 User Guide.
*
* Valid values: prioritized
*
prioritized
allocation strategy is supported. For more information,
* see
* Allocation strategy in the Amazon EC2 User Guide.
*
* Valid values: prioritized
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationFleetRequest withAllocationStrategy(String allocationStrategy) {
setAllocationStrategy(allocationStrategy);
return this;
}
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more * information, see Ensure * Idempotency. *
* * @param clientToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more * information, see Ensure * 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 Ensure * Idempotency. *
* * @return Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more * information, see Ensure * 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 Ensure * Idempotency. *
* * @param clientToken * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more * information, see Ensure * Idempotency. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withClientToken(String clientToken) { setClientToken(clientToken); return this; } /** ** Information about the instance types for which to reserve the capacity. *
* * @return Information about the instance types for which to reserve the capacity. */ public java.util.List* Information about the instance types for which to reserve the capacity. *
* * @param instanceTypeSpecifications * Information about the instance types for which to reserve the capacity. */ public void setInstanceTypeSpecifications(java.util.Collection* Information about the instance types for which to reserve the capacity. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setInstanceTypeSpecifications(java.util.Collection)} or * {@link #withInstanceTypeSpecifications(java.util.Collection)} if you want to override the existing values. *
* * @param instanceTypeSpecifications * Information about the instance types for which to reserve the capacity. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withInstanceTypeSpecifications(ReservationFleetInstanceSpecification... instanceTypeSpecifications) { if (this.instanceTypeSpecifications == null) { setInstanceTypeSpecifications(new com.amazonaws.internal.SdkInternalList* Information about the instance types for which to reserve the capacity. *
* * @param instanceTypeSpecifications * Information about the instance types for which to reserve the capacity. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withInstanceTypeSpecifications( java.util.Collection* Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this * tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: *
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web
* Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other
* Amazon Web Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
* Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this * tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: *
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web
* Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other
* Amazon Web Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is
* dedicated to a single Amazon Web Services account.
*
* Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this * tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: *
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web
* Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other
* Amazon Web Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
* Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this * tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: *
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web
* Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
* default
- The Capacity Reservation Fleet is created on hardware that is shared with other
* Amazon Web Services accounts.
*
* dedicated
- The Capacity Reservations are created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
* The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with * the instance type weights that you assign to each instance type used by the Fleet determine the number of * instances for which the Fleet reserves capacity. Both values are based on units that make sense for your * workload. For more information, see Total target * capacity in the Amazon EC2 User Guide. *
* * @param totalTargetCapacity * The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together * with the instance type weights that you assign to each instance type used by the Fleet determine the * number of instances for which the Fleet reserves capacity. Both values are based on units that make sense * for your workload. For more information, see Total * target capacity in the Amazon EC2 User Guide. */ public void setTotalTargetCapacity(Integer totalTargetCapacity) { this.totalTargetCapacity = totalTargetCapacity; } /** ** The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with * the instance type weights that you assign to each instance type used by the Fleet determine the number of * instances for which the Fleet reserves capacity. Both values are based on units that make sense for your * workload. For more information, see Total target * capacity in the Amazon EC2 User Guide. *
* * @return The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together * with the instance type weights that you assign to each instance type used by the Fleet determine the * number of instances for which the Fleet reserves capacity. Both values are based on units that make sense * for your workload. For more information, see Total * target capacity in the Amazon EC2 User Guide. */ public Integer getTotalTargetCapacity() { return this.totalTargetCapacity; } /** ** The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with * the instance type weights that you assign to each instance type used by the Fleet determine the number of * instances for which the Fleet reserves capacity. Both values are based on units that make sense for your * workload. For more information, see Total target * capacity in the Amazon EC2 User Guide. *
* * @param totalTargetCapacity * The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together * with the instance type weights that you assign to each instance type used by the Fleet determine the * number of instances for which the Fleet reserves capacity. Both values are based on units that make sense * for your workload. For more information, see Total * target capacity in the Amazon EC2 User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withTotalTargetCapacity(Integer totalTargetCapacity) { setTotalTargetCapacity(totalTargetCapacity); return this; } /** *
* The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires,
* its state changes to expired
and all of the Capacity Reservations in the Fleet expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify
* 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to expire between
* 13:30:55
and 14:30:55
on 5/31/2019
.
*
expired
and all of the Capacity Reservations in the Fleet
* expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you
* specify 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to
* expire between 13:30:55
and 14:30:55
on 5/31/2019
.
*/
public void setEndDate(java.util.Date endDate) {
this.endDate = endDate;
}
/**
*
* The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires,
* its state changes to expired
and all of the Capacity Reservations in the Fleet expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify
* 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to expire between
* 13:30:55
and 14:30:55
on 5/31/2019
.
*
expired
and all of the Capacity Reservations in the Fleet
* expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you
* specify 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to
* expire between 13:30:55
and 14:30:55
on 5/31/2019
.
*/
public java.util.Date getEndDate() {
return this.endDate;
}
/**
*
* The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires,
* its state changes to expired
and all of the Capacity Reservations in the Fleet expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify
* 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to expire between
* 13:30:55
and 14:30:55
on 5/31/2019
.
*
expired
and all of the Capacity Reservations in the Fleet
* expire.
*
* The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you
* specify 5/31/2019
, 13:30:55
, the Capacity Reservation Fleet is guaranteed to
* expire between 13:30:55
and 14:30:55
on 5/31/2019
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationFleetRequest withEndDate(java.util.Date endDate) {
setEndDate(endDate);
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in * the Fleet inherit this instance matching criteria. *
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This means that
* instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity
* Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its
* reserved capacity.
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This
* means that instances that have matching attributes (instance type, platform, and Availability Zone) run in
* the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation
* Fleet to use its reserved capacity.
* @see FleetInstanceMatchCriteria
*/
public void setInstanceMatchCriteria(String instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in * the Fleet inherit this instance matching criteria. *
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This means that
* instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity
* Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its
* reserved capacity.
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This
* means that instances that have matching attributes (instance type, platform, and Availability Zone) run
* in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity
* Reservation Fleet to use its reserved capacity.
* @see FleetInstanceMatchCriteria
*/
public String getInstanceMatchCriteria() {
return this.instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in * the Fleet inherit this instance matching criteria. *
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This means that
* instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity
* Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its
* reserved capacity.
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This
* means that instances that have matching attributes (instance type, platform, and Availability Zone) run in
* the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation
* Fleet to use its reserved capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetInstanceMatchCriteria
*/
public CreateCapacityReservationFleetRequest withInstanceMatchCriteria(String instanceMatchCriteria) {
setInstanceMatchCriteria(instanceMatchCriteria);
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in * the Fleet inherit this instance matching criteria. *
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This means that
* instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity
* Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its
* reserved capacity.
*
* Currently, Capacity Reservation Fleets support open
instance matching criteria only. This
* means that instances that have matching attributes (instance type, platform, and Availability Zone) run in
* the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation
* Fleet to use its reserved capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FleetInstanceMatchCriteria
*/
public CreateCapacityReservationFleetRequest withInstanceMatchCriteria(FleetInstanceMatchCriteria instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria.toString();
return this;
}
/**
*
* The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. *
* * @return The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. */ public java.util.List* The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. *
* * @param tagSpecifications * The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. */ public void setTagSpecifications(java.util.Collection* The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. *
** 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 tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withTagSpecifications(TagSpecification... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList* The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. *
* * @param tagSpecifications * The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity * Reservations in the Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateCapacityReservationFleetRequest withTagSpecifications(java.util.Collection