![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.ec2.model.ReservationFleetInstanceSpecification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Information about an instance type to use in a Capacity Reservation Fleet.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReservationFleetInstanceSpecification implements Serializable, Cloneable {
/**
*
* The instance type for which the Capacity Reservation Fleet reserves capacity.
*
*/
private String instanceType;
/**
*
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
*
*/
private String instancePlatform;
/**
*
* The number of capacity units provided by the specified instance type. This value, together with the total target
* capacity that you specify for 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.
*
*/
private Double weight;
/**
*
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet
* can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same
* Availability Zone.
*
*/
private String availabilityZone;
/**
*
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet
* must use the same Availability Zone.
*
*/
private String availabilityZoneId;
/**
*
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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
* EBS-optimized instance types.
*
*/
private Boolean ebsOptimized;
/**
*
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type
* priority in the Amazon EC2 User Guide.
*
*/
private Integer priority;
/**
*
* The instance type for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instanceType
* The instance type for which the Capacity Reservation Fleet reserves capacity.
* @see InstanceType
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type for which the Capacity Reservation Fleet reserves capacity.
*
*
* @return The instance type for which the Capacity Reservation Fleet reserves capacity.
* @see InstanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The instance type for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instanceType
* The instance type for which the Capacity Reservation Fleet reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public ReservationFleetInstanceSpecification withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The instance type for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instanceType
* The instance type for which the Capacity Reservation Fleet reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public ReservationFleetInstanceSpecification withInstanceType(InstanceType instanceType) {
this.instanceType = instanceType.toString();
return this;
}
/**
*
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
* @see CapacityReservationInstancePlatform
*/
public void setInstancePlatform(String instancePlatform) {
this.instancePlatform = instancePlatform;
}
/**
*
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
*
*
* @return The type of operating system for which the Capacity Reservation Fleet reserves capacity.
* @see CapacityReservationInstancePlatform
*/
public String getInstancePlatform() {
return this.instancePlatform;
}
/**
*
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public ReservationFleetInstanceSpecification withInstancePlatform(String instancePlatform) {
setInstancePlatform(instancePlatform);
return this;
}
/**
*
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation Fleet reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public ReservationFleetInstanceSpecification withInstancePlatform(CapacityReservationInstancePlatform instancePlatform) {
this.instancePlatform = instancePlatform.toString();
return this;
}
/**
*
* The number of capacity units provided by the specified instance type. This value, together with the total target
* capacity that you specify for 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 weight
* The number of capacity units provided by the specified instance type. This value, together with the total
* target capacity that you specify for 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 setWeight(Double weight) {
this.weight = weight;
}
/**
*
* The number of capacity units provided by the specified instance type. This value, together with the total target
* capacity that you specify for 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 number of capacity units provided by the specified instance type. This value, together with the total
* target capacity that you specify for 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 Double getWeight() {
return this.weight;
}
/**
*
* The number of capacity units provided by the specified instance type. This value, together with the total target
* capacity that you specify for 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 weight
* The number of capacity units provided by the specified instance type. This value, together with the total
* target capacity that you specify for 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 ReservationFleetInstanceSpecification withWeight(Double weight) {
setWeight(weight);
return this;
}
/**
*
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet
* can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same
* Availability Zone.
*
*
* @param availabilityZone
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the
* Fleet must use the same Availability Zone.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet
* can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same
* Availability Zone.
*
*
* @return The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for
* the Fleet must use the same Availability Zone.
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity Reservation Fleet
* can't span Availability Zones. All instance type specifications that you specify for the Fleet must use the same
* Availability Zone.
*
*
* @param availabilityZone
* The Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the
* Fleet must use the same Availability Zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReservationFleetInstanceSpecification withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
*
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet
* must use the same Availability Zone.
*
*
* @param availabilityZoneId
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the
* Fleet must use the same Availability Zone.
*/
public void setAvailabilityZoneId(String availabilityZoneId) {
this.availabilityZoneId = availabilityZoneId;
}
/**
*
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet
* must use the same Availability Zone.
*
*
* @return The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for
* the Fleet must use the same Availability Zone.
*/
public String getAvailabilityZoneId() {
return this.availabilityZoneId;
}
/**
*
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the Fleet
* must use the same Availability Zone.
*
*
* @param availabilityZoneId
* The ID of the Availability Zone in which the Capacity Reservation Fleet reserves the capacity. A Capacity
* Reservation Fleet can't span Availability Zones. All instance type specifications that you specify for the
* Fleet must use the same Availability Zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReservationFleetInstanceSpecification withAvailabilityZoneId(String availabilityZoneId) {
setAvailabilityZoneId(availabilityZoneId);
return this;
}
/**
*
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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
* EBS-optimized instance types.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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 EBS-optimized instance types.
*/
public void setEbsOptimized(Boolean ebsOptimized) {
this.ebsOptimized = ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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
* EBS-optimized instance types.
*
*
* @return Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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 EBS-optimized instance types.
*/
public Boolean getEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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
* EBS-optimized instance types.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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 EBS-optimized instance types.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReservationFleetInstanceSpecification withEbsOptimized(Boolean ebsOptimized) {
setEbsOptimized(ebsOptimized);
return this;
}
/**
*
* Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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
* EBS-optimized instance types.
*
*
* @return Indicates whether the Capacity Reservation Fleet supports EBS-optimized instances types. 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 EBS-optimized instance types.
*/
public Boolean isEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type
* priority in the Amazon EC2 User Guide.
*
*
* @param priority
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type priority in the Amazon EC2 User Guide.
*/
public void setPriority(Integer priority) {
this.priority = priority;
}
/**
*
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type
* priority in the Amazon EC2 User Guide.
*
*
* @return The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type priority in the Amazon EC2 User Guide.
*/
public Integer getPriority() {
return this.priority;
}
/**
*
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type
* priority in the Amazon EC2 User Guide.
*
*
* @param priority
* The priority to assign to the instance type. This value is used to determine which of the instance types
* specified for the Fleet should be prioritized for use. A lower value indicates a high priority. For more
* information, see Instance type priority in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReservationFleetInstanceSpecification withPriority(Integer priority) {
setPriority(priority);
return this;
}
/**
* 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 (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getInstancePlatform() != null)
sb.append("InstancePlatform: ").append(getInstancePlatform()).append(",");
if (getWeight() != null)
sb.append("Weight: ").append(getWeight()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getAvailabilityZoneId() != null)
sb.append("AvailabilityZoneId: ").append(getAvailabilityZoneId()).append(",");
if (getEbsOptimized() != null)
sb.append("EbsOptimized: ").append(getEbsOptimized()).append(",");
if (getPriority() != null)
sb.append("Priority: ").append(getPriority());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReservationFleetInstanceSpecification == false)
return false;
ReservationFleetInstanceSpecification other = (ReservationFleetInstanceSpecification) obj;
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.getWeight() == null ^ this.getWeight() == null)
return false;
if (other.getWeight() != null && other.getWeight().equals(this.getWeight()) == 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.getEbsOptimized() == null ^ this.getEbsOptimized() == null)
return false;
if (other.getEbsOptimized() != null && other.getEbsOptimized().equals(this.getEbsOptimized()) == false)
return false;
if (other.getPriority() == null ^ this.getPriority() == null)
return false;
if (other.getPriority() != null && other.getPriority().equals(this.getPriority()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getInstancePlatform() == null) ? 0 : getInstancePlatform().hashCode());
hashCode = prime * hashCode + ((getWeight() == null) ? 0 : getWeight().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZoneId() == null) ? 0 : getAvailabilityZoneId().hashCode());
hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
hashCode = prime * hashCode + ((getPriority() == null) ? 0 : getPriority().hashCode());
return hashCode;
}
@Override
public ReservationFleetInstanceSpecification clone() {
try {
return (ReservationFleetInstanceSpecification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}