com.amazonaws.services.ec2.model.CreateCapacityReservationRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* 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.CreateCapacityReservationRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateCapacityReservationRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more
* information, see Ensure
* Idempotency.
*
*/
private String clientToken;
/**
*
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*
*/
private String instanceType;
/**
*
* The type of operating system for which to reserve capacity.
*
*/
private String instancePlatform;
/**
*
* The Availability Zone in which to create the Capacity Reservation.
*
*/
private String availabilityZone;
/**
*
* The ID of the Availability Zone in which to create the Capacity Reservation.
*
*/
private String availabilityZoneId;
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*/
private String tenancy;
/**
*
* The number of instances for which to reserve capacity.
*
*
* Valid range: 1 - 1000
*
*/
private Integer instanceCount;
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*/
private Boolean ebsOptimized;
/**
*
* Deprecated.
*
*/
private Boolean ephemeralStorage;
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour
* from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed
* to end between 13:30:55 and 14:30:55 on 5/31/2019.
*
*/
private java.util.Date endDate;
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide
* an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You must
* provide an EndDate
value if the EndDateType
value is limited
.
*
*
*
*/
private String endDateType;
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
*
*/
private String instanceMatchCriteria;
/**
*
* The tags to apply to the Capacity Reservation during launch.
*
*/
private com.amazonaws.internal.SdkInternalList tagSpecifications;
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*
*/
private String outpostArn;
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*/
private String placementGroupArn;
/**
*
* 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 CreateCapacityReservationRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*
*
* @param instanceType
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*
*
* @return The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
*
*
* @param instanceType
* The instance type for which to reserve capacity. For more information, see Instance types in the
* Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The type of operating system for which to reserve capacity.
*
*
* @param instancePlatform
* The type of operating system for which to reserve capacity.
* @see CapacityReservationInstancePlatform
*/
public void setInstancePlatform(String instancePlatform) {
this.instancePlatform = instancePlatform;
}
/**
*
* The type of operating system for which to reserve capacity.
*
*
* @return The type of operating system for which to reserve capacity.
* @see CapacityReservationInstancePlatform
*/
public String getInstancePlatform() {
return this.instancePlatform;
}
/**
*
* The type of operating system for which to reserve capacity.
*
*
* @param instancePlatform
* The type of operating system for which to reserve capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public CreateCapacityReservationRequest withInstancePlatform(String instancePlatform) {
setInstancePlatform(instancePlatform);
return this;
}
/**
*
* The type of operating system for which to reserve capacity.
*
*
* @param instancePlatform
* The type of operating system for which to reserve capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public CreateCapacityReservationRequest withInstancePlatform(CapacityReservationInstancePlatform instancePlatform) {
this.instancePlatform = instancePlatform.toString();
return this;
}
/**
*
* The Availability Zone in which to create the Capacity Reservation.
*
*
* @param availabilityZone
* The Availability Zone in which to create the Capacity Reservation.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* The Availability Zone in which to create the Capacity Reservation.
*
*
* @return The Availability Zone in which to create the Capacity Reservation.
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* The Availability Zone in which to create the Capacity Reservation.
*
*
* @param availabilityZone
* The Availability Zone in which to create the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
*
* The ID of the Availability Zone in which to create the Capacity Reservation.
*
*
* @param availabilityZoneId
* The ID of the Availability Zone in which to create the Capacity Reservation.
*/
public void setAvailabilityZoneId(String availabilityZoneId) {
this.availabilityZoneId = availabilityZoneId;
}
/**
*
* The ID of the Availability Zone in which to create the Capacity Reservation.
*
*
* @return The ID of the Availability Zone in which to create the Capacity Reservation.
*/
public String getAvailabilityZoneId() {
return this.availabilityZoneId;
}
/**
*
* The ID of the Availability Zone in which to create the Capacity Reservation.
*
*
* @param availabilityZoneId
* The ID of the Availability Zone in which to create the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withAvailabilityZoneId(String availabilityZoneId) {
setAvailabilityZoneId(availabilityZoneId);
return this;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @see CapacityReservationTenancy
*/
public void setTenancy(String tenancy) {
this.tenancy = tenancy;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @return Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @see CapacityReservationTenancy
*/
public String getTenancy() {
return this.tenancy;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationTenancy
*/
public CreateCapacityReservationRequest withTenancy(String tenancy) {
setTenancy(tenancy);
return this;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationTenancy
*/
public CreateCapacityReservationRequest withTenancy(CapacityReservationTenancy tenancy) {
this.tenancy = tenancy.toString();
return this;
}
/**
*
* The number of instances for which to reserve capacity.
*
*
* Valid range: 1 - 1000
*
*
* @param instanceCount
* The number of instances for which to reserve capacity.
*
* Valid range: 1 - 1000
*/
public void setInstanceCount(Integer instanceCount) {
this.instanceCount = instanceCount;
}
/**
*
* The number of instances for which to reserve capacity.
*
*
* Valid range: 1 - 1000
*
*
* @return The number of instances for which to reserve capacity.
*
* Valid range: 1 - 1000
*/
public Integer getInstanceCount() {
return this.instanceCount;
}
/**
*
* The number of instances for which to reserve capacity.
*
*
* Valid range: 1 - 1000
*
*
* @param instanceCount
* The number of instances for which to reserve capacity.
*
* Valid range: 1 - 1000
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withInstanceCount(Integer instanceCount) {
setInstanceCount(instanceCount);
return this;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public void setEbsOptimized(Boolean ebsOptimized) {
this.ebsOptimized = ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @return Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public Boolean getEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withEbsOptimized(Boolean ebsOptimized) {
setEbsOptimized(ebsOptimized);
return this;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @return Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public Boolean isEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Deprecated.
*
*
* @param ephemeralStorage
* Deprecated.
*/
public void setEphemeralStorage(Boolean ephemeralStorage) {
this.ephemeralStorage = ephemeralStorage;
}
/**
*
* Deprecated.
*
*
* @return Deprecated.
*/
public Boolean getEphemeralStorage() {
return this.ephemeralStorage;
}
/**
*
* Deprecated.
*
*
* @param ephemeralStorage
* Deprecated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withEphemeralStorage(Boolean ephemeralStorage) {
setEphemeralStorage(ephemeralStorage);
return this;
}
/**
*
* Deprecated.
*
*
* @return Deprecated.
*/
public Boolean isEphemeralStorage() {
return this.ephemeralStorage;
}
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour
* from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed
* to end between 13:30:55 and 14:30:55 on 5/31/2019.
*
*
* @param endDate
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an
* hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is
* guaranteed to end 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 expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour
* from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed
* to end between 13:30:55 and 14:30:55 on 5/31/2019.
*
*
* @return The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an
* hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation
* is guaranteed to end 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 expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour
* from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed
* to end between 13:30:55 and 14:30:55 on 5/31/2019.
*
*
* @param endDate
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
*
* You must provide an EndDate
value if EndDateType
is limited
. Omit
* EndDate
if EndDateType
is unlimited
.
*
*
* If the EndDateType
is limited
, the Capacity Reservation is cancelled within an
* hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is
* guaranteed to end 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 CreateCapacityReservationRequest withEndDate(java.util.Date endDate) {
setEndDate(endDate);
return this;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide
* an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You must
* provide an EndDate
value if the EndDateType
value is limited
.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not
* provide an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You
* must provide an EndDate
value if the EndDateType
value is limited
.
*
*
* @see EndDateType
*/
public void setEndDateType(String endDateType) {
this.endDateType = endDateType;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide
* an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You must
* provide an EndDate
value if the EndDateType
value is limited
.
*
*
*
*
* @return Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not
* provide an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You
* must provide an EndDate
value if the EndDateType
value is limited
.
*
*
* @see EndDateType
*/
public String getEndDateType() {
return this.endDateType;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide
* an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You must
* provide an EndDate
value if the EndDateType
value is limited
.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not
* provide an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You
* must provide an EndDate
value if the EndDateType
value is limited
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndDateType
*/
public CreateCapacityReservationRequest withEndDateType(String endDateType) {
setEndDateType(endDateType);
return this;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide
* an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You must
* provide an EndDate
value if the EndDateType
value is limited
.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not
* provide an EndDate
if the EndDateType
is unlimited
.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time. You
* must provide an EndDate
value if the EndDateType
value is limited
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndDateType
*/
public CreateCapacityReservationRequest withEndDateType(EndDateType endDateType) {
this.endDateType = endDateType.toString();
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching
* attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run
* in the Capacity Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
* @see InstanceMatchCriteria
*/
public void setInstanceMatchCriteria(String instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
*
*
* @return Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching
* attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run
* in the Capacity Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
* @see InstanceMatchCriteria
*/
public String getInstanceMatchCriteria() {
return this.instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching
* attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run
* in the Capacity Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMatchCriteria
*/
public CreateCapacityReservationRequest withInstanceMatchCriteria(String instanceMatchCriteria) {
setInstanceMatchCriteria(instanceMatchCriteria);
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation automatically matches all instances that have matching
* attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run
* in the Capacity Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
*
*
* Default: open
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMatchCriteria
*/
public CreateCapacityReservationRequest withInstanceMatchCriteria(InstanceMatchCriteria instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria.toString();
return this;
}
/**
*
* The tags to apply to the Capacity Reservation during launch.
*
*
* @return The tags to apply to the Capacity Reservation during launch.
*/
public java.util.List getTagSpecifications() {
if (tagSpecifications == null) {
tagSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return tagSpecifications;
}
/**
*
* The tags to apply to the Capacity Reservation during launch.
*
*
* @param tagSpecifications
* The tags to apply to the Capacity Reservation during launch.
*/
public void setTagSpecifications(java.util.Collection tagSpecifications) {
if (tagSpecifications == null) {
this.tagSpecifications = null;
return;
}
this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(tagSpecifications);
}
/**
*
* The tags to apply to the Capacity Reservation during launch.
*
*
* 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 apply to the Capacity Reservation during launch.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest 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 tags to apply to the Capacity Reservation during launch.
*
*
* @param tagSpecifications
* The tags to apply to the Capacity Reservation during launch.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withTagSpecifications(java.util.Collection tagSpecifications) {
setTagSpecifications(tagSpecifications);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*/
public void setOutpostArn(String outpostArn) {
this.outpostArn = outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*
*
* @return The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*/
public String getOutpostArn() {
return this.outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withOutpostArn(String outpostArn) {
setOutpostArn(outpostArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @param placementGroupArn
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.
* For more information, see
* Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
*/
public void setPlacementGroupArn(String placementGroupArn) {
this.placementGroupArn = placementGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @return The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity
* Reservation. For more information, see Capacity Reservations for cluster
* placement groups in the Amazon EC2 User Guide.
*/
public String getPlacementGroupArn() {
return this.placementGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @param placementGroupArn
* The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.
* For more information, see
* Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCapacityReservationRequest withPlacementGroupArn(String placementGroupArn) {
setPlacementGroupArn(placementGroupArn);
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 CreateCapacityReservationRequestMarshaller().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 (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getInstancePlatform() != null)
sb.append("InstancePlatform: ").append(getInstancePlatform()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getAvailabilityZoneId() != null)
sb.append("AvailabilityZoneId: ").append(getAvailabilityZoneId()).append(",");
if (getTenancy() != null)
sb.append("Tenancy: ").append(getTenancy()).append(",");
if (getInstanceCount() != null)
sb.append("InstanceCount: ").append(getInstanceCount()).append(",");
if (getEbsOptimized() != null)
sb.append("EbsOptimized: ").append(getEbsOptimized()).append(",");
if (getEphemeralStorage() != null)
sb.append("EphemeralStorage: ").append(getEphemeralStorage()).append(",");
if (getEndDate() != null)
sb.append("EndDate: ").append(getEndDate()).append(",");
if (getEndDateType() != null)
sb.append("EndDateType: ").append(getEndDateType()).append(",");
if (getInstanceMatchCriteria() != null)
sb.append("InstanceMatchCriteria: ").append(getInstanceMatchCriteria()).append(",");
if (getTagSpecifications() != null)
sb.append("TagSpecifications: ").append(getTagSpecifications()).append(",");
if (getOutpostArn() != null)
sb.append("OutpostArn: ").append(getOutpostArn()).append(",");
if (getPlacementGroupArn() != null)
sb.append("PlacementGroupArn: ").append(getPlacementGroupArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateCapacityReservationRequest == false)
return false;
CreateCapacityReservationRequest other = (CreateCapacityReservationRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getInstancePlatform() == null ^ this.getInstancePlatform() == null)
return false;
if (other.getInstancePlatform() != null && other.getInstancePlatform().equals(this.getInstancePlatform()) == false)
return false;
if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
if (other.getAvailabilityZoneId() == null ^ this.getAvailabilityZoneId() == null)
return false;
if (other.getAvailabilityZoneId() != null && other.getAvailabilityZoneId().equals(this.getAvailabilityZoneId()) == false)
return false;
if (other.getTenancy() == null ^ this.getTenancy() == null)
return false;
if (other.getTenancy() != null && other.getTenancy().equals(this.getTenancy()) == false)
return false;
if (other.getInstanceCount() == null ^ this.getInstanceCount() == null)
return false;
if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == false)
return false;
if (other.getEbsOptimized() == null ^ this.getEbsOptimized() == null)
return false;
if (other.getEbsOptimized() != null && other.getEbsOptimized().equals(this.getEbsOptimized()) == false)
return false;
if (other.getEphemeralStorage() == null ^ this.getEphemeralStorage() == null)
return false;
if (other.getEphemeralStorage() != null && other.getEphemeralStorage().equals(this.getEphemeralStorage()) == false)
return false;
if (other.getEndDate() == null ^ this.getEndDate() == null)
return false;
if (other.getEndDate() != null && other.getEndDate().equals(this.getEndDate()) == false)
return false;
if (other.getEndDateType() == null ^ this.getEndDateType() == null)
return false;
if (other.getEndDateType() != null && other.getEndDateType().equals(this.getEndDateType()) == false)
return false;
if (other.getInstanceMatchCriteria() == null ^ this.getInstanceMatchCriteria() == null)
return false;
if (other.getInstanceMatchCriteria() != null && other.getInstanceMatchCriteria().equals(this.getInstanceMatchCriteria()) == 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.getOutpostArn() == null ^ this.getOutpostArn() == null)
return false;
if (other.getOutpostArn() != null && other.getOutpostArn().equals(this.getOutpostArn()) == false)
return false;
if (other.getPlacementGroupArn() == null ^ this.getPlacementGroupArn() == null)
return false;
if (other.getPlacementGroupArn() != null && other.getPlacementGroupArn().equals(this.getPlacementGroupArn()) == 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 + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getInstancePlatform() == null) ? 0 : getInstancePlatform().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZoneId() == null) ? 0 : getAvailabilityZoneId().hashCode());
hashCode = prime * hashCode + ((getTenancy() == null) ? 0 : getTenancy().hashCode());
hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode());
hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
hashCode = prime * hashCode + ((getEphemeralStorage() == null) ? 0 : getEphemeralStorage().hashCode());
hashCode = prime * hashCode + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
hashCode = prime * hashCode + ((getEndDateType() == null) ? 0 : getEndDateType().hashCode());
hashCode = prime * hashCode + ((getInstanceMatchCriteria() == null) ? 0 : getInstanceMatchCriteria().hashCode());
hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode());
hashCode = prime * hashCode + ((getOutpostArn() == null) ? 0 : getOutpostArn().hashCode());
hashCode = prime * hashCode + ((getPlacementGroupArn() == null) ? 0 : getPlacementGroupArn().hashCode());
return hashCode;
}
@Override
public CreateCapacityReservationRequest clone() {
return (CreateCapacityReservationRequest) super.clone();
}
}