/* * 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; /** *

* Describes a Capacity Reservation. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CapacityReservation implements Serializable, Cloneable { /** *

* The ID of the Capacity Reservation. *

*/ private String capacityReservationId; /** *

* The ID of the Amazon Web Services account that owns the Capacity Reservation. *

*/ private String ownerId; /** *

* The Amazon Resource Name (ARN) of the Capacity Reservation. *

*/ private String capacityReservationArn; /** *

* The Availability Zone ID of the Capacity Reservation. *

*/ private String availabilityZoneId; /** *

* The type of instance for which the Capacity Reservation reserves capacity. *

*/ private String instanceType; /** *

* The type of operating system for which the Capacity Reservation reserves capacity. *

*/ private String instancePlatform; /** *

* The Availability Zone in which the capacity is reserved. *

*/ private String availabilityZone; /** *

* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy * settings: *

* */ private String tenancy; /** *

* The total number of instances for which the Capacity Reservation reserves capacity. *

*/ private Integer totalInstanceCount; /** *

* The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation. *

*/ private Integer availableInstanceCount; /** *

* 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 current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states: *

* */ private String state; /** *

* The date and time at which the Capacity Reservation was started. *

*/ private java.util.Date startDate; /** *

* 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. *

*/ 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: *

* */ private String endDateType; /** *

* Indicates the type of instance launches that the Capacity Reservation accepts. The options include: *

* */ private String instanceMatchCriteria; /** *

* The date and time at which the Capacity Reservation was created. *

*/ private java.util.Date createDate; /** *

* Any tags assigned to the Capacity Reservation. *

*/ private com.amazonaws.internal.SdkInternalList tags; /** *

* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created. *

*/ private String outpostArn; /** *

* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity * Reservations that were created by a Capacity Reservation Fleet. *

*/ private String capacityReservationFleetId; /** *

* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For * more information, see Capacity * Reservations for cluster placement groups in the Amazon EC2 User Guide. *

*/ private String placementGroupArn; /** *

* Information about instance capacity usage. *

*/ private com.amazonaws.internal.SdkInternalList capacityAllocations; /** *

* The ID of the Capacity Reservation. *

* * @param capacityReservationId * The ID of the Capacity Reservation. */ public void setCapacityReservationId(String capacityReservationId) { this.capacityReservationId = capacityReservationId; } /** *

* The ID of the Capacity Reservation. *

* * @return The ID of the Capacity Reservation. */ public String getCapacityReservationId() { return this.capacityReservationId; } /** *

* The ID of the Capacity Reservation. *

* * @param capacityReservationId * The ID of the Capacity Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withCapacityReservationId(String capacityReservationId) { setCapacityReservationId(capacityReservationId); return this; } /** *

* The ID of the Amazon Web Services account that owns the Capacity Reservation. *

* * @param ownerId * The ID of the Amazon Web Services account that owns the Capacity Reservation. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** *

* The ID of the Amazon Web Services account that owns the Capacity Reservation. *

* * @return The ID of the Amazon Web Services account that owns the Capacity Reservation. */ public String getOwnerId() { return this.ownerId; } /** *

* The ID of the Amazon Web Services account that owns the Capacity Reservation. *

* * @param ownerId * The ID of the Amazon Web Services account that owns the Capacity Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withOwnerId(String ownerId) { setOwnerId(ownerId); return this; } /** *

* The Amazon Resource Name (ARN) of the Capacity Reservation. *

* * @param capacityReservationArn * The Amazon Resource Name (ARN) of the Capacity Reservation. */ public void setCapacityReservationArn(String capacityReservationArn) { this.capacityReservationArn = capacityReservationArn; } /** *

* The Amazon Resource Name (ARN) of the Capacity Reservation. *

* * @return The Amazon Resource Name (ARN) of the Capacity Reservation. */ public String getCapacityReservationArn() { return this.capacityReservationArn; } /** *

* The Amazon Resource Name (ARN) of the Capacity Reservation. *

* * @param capacityReservationArn * The Amazon Resource Name (ARN) of the Capacity Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withCapacityReservationArn(String capacityReservationArn) { setCapacityReservationArn(capacityReservationArn); return this; } /** *

* The Availability Zone ID of the Capacity Reservation. *

* * @param availabilityZoneId * The Availability Zone ID of the Capacity Reservation. */ public void setAvailabilityZoneId(String availabilityZoneId) { this.availabilityZoneId = availabilityZoneId; } /** *

* The Availability Zone ID of the Capacity Reservation. *

* * @return The Availability Zone ID of the Capacity Reservation. */ public String getAvailabilityZoneId() { return this.availabilityZoneId; } /** *

* The Availability Zone ID of the Capacity Reservation. *

* * @param availabilityZoneId * The Availability Zone ID of the Capacity Reservation. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withAvailabilityZoneId(String availabilityZoneId) { setAvailabilityZoneId(availabilityZoneId); return this; } /** *

* The type of instance for which the Capacity Reservation reserves capacity. *

* * @param instanceType * The type of instance for which the Capacity Reservation reserves capacity. */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** *

* The type of instance for which the Capacity Reservation reserves capacity. *

* * @return The type of instance for which the Capacity Reservation reserves capacity. */ public String getInstanceType() { return this.instanceType; } /** *

* The type of instance for which the Capacity Reservation reserves capacity. *

* * @param instanceType * The type of instance for which the Capacity Reservation reserves capacity. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** *

* The type of operating system for which the Capacity Reservation reserves capacity. *

* * @param instancePlatform * The type of operating system for which the Capacity Reservation reserves capacity. * @see CapacityReservationInstancePlatform */ public void setInstancePlatform(String instancePlatform) { this.instancePlatform = instancePlatform; } /** *

* The type of operating system for which the Capacity Reservation reserves capacity. *

* * @return The type of operating system for which the Capacity Reservation reserves capacity. * @see CapacityReservationInstancePlatform */ public String getInstancePlatform() { return this.instancePlatform; } /** *

* The type of operating system for which the Capacity Reservation reserves capacity. *

* * @param instancePlatform * The type of operating system for which the Capacity Reservation reserves capacity. * @return Returns a reference to this object so that method calls can be chained together. * @see CapacityReservationInstancePlatform */ public CapacityReservation withInstancePlatform(String instancePlatform) { setInstancePlatform(instancePlatform); return this; } /** *

* The type of operating system for which the Capacity Reservation reserves capacity. *

* * @param instancePlatform * The type of operating system for which the Capacity Reservation reserves capacity. * @return Returns a reference to this object so that method calls can be chained together. * @see CapacityReservationInstancePlatform */ public CapacityReservation withInstancePlatform(CapacityReservationInstancePlatform instancePlatform) { this.instancePlatform = instancePlatform.toString(); return this; } /** *

* The Availability Zone in which the capacity is reserved. *

* * @param availabilityZone * The Availability Zone in which the capacity is reserved. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *

* The Availability Zone in which the capacity is reserved. *

* * @return The Availability Zone in which the capacity is reserved. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *

* The Availability Zone in which the capacity is reserved. *

* * @param availabilityZone * The Availability Zone in which the capacity is reserved. * @return Returns a reference to this object so that method calls can be chained together. */ public CapacityReservation withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** *

* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy * settings: *

* * * @param tenancy * Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following * tenancy settings:

*