/* * 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 overrides for a launch template. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class FleetLaunchTemplateOverridesRequest implements Serializable, Cloneable { /** ** The instance type. *
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
*
* The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example,
* subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type instant
can have
* only one subnet ID.
*
* The Availability Zone in which to launch the instances. *
*/ private String availabilityZone; /** ** The number of units provided by the specified instance type. *
*/ private Double weightedCapacity; /** ** The priority for the launch template override. The highest priority is launched first. *
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2 Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* The location where the instance launched, if applicable. *
*/ private Placement placement; /** ** The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with those attributes. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The ID of the AMI. An AMI is required to launch an instance. This parameter is only available for fleets of type
* instant
. For fleets of type maintain
and request
, you must specify the AMI
* ID in the launch template.
*
* The instance type. *
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* The instance type. *
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* The instance type. *
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* The instance type. *
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* mac1.metal
is not supported as a launch template override.
*
* If you specify InstanceType
, you can't specify InstanceRequirements
.
*
* The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
*/ public void setMaxPrice(String maxPrice) { this.maxPrice = maxPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
*/ public String getMaxPrice() { return this.maxPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this * parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the * current Spot price. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify * this parameter. *
** If you specify a maximum price, your instances will be interrupted more frequently than if you do not * specify this parameter. *
* @return Returns a reference to this object so that method calls can be chained together. */ public FleetLaunchTemplateOverridesRequest withMaxPrice(String maxPrice) { setMaxPrice(maxPrice); return this; } /** *
* The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example,
* subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type instant
can have
* only one subnet ID.
*
subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type
* instant
can have only one subnet ID.
*/
public void setSubnetId(String subnetId) {
this.subnetId = subnetId;
}
/**
*
* The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example,
* subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type instant
can have
* only one subnet ID.
*
subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type
* instant
can have only one subnet ID.
*/
public String getSubnetId() {
return this.subnetId;
}
/**
*
* The IDs of the subnets in which to launch the instances. Separate multiple subnet IDs using commas (for example,
* subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type instant
can have
* only one subnet ID.
*
subnet-1234abcdeexample1, subnet-0987cdef6example2
). A request of type
* instant
can have only one subnet ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateOverridesRequest withSubnetId(String subnetId) {
setSubnetId(subnetId);
return this;
}
/**
* * The Availability Zone in which to launch the instances. *
* * @param availabilityZone * The Availability Zone in which to launch the instances. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** ** The Availability Zone in which to launch the instances. *
* * @return The Availability Zone in which to launch the instances. */ public String getAvailabilityZone() { return this.availabilityZone; } /** ** The Availability Zone in which to launch the instances. *
* * @param availabilityZone * The Availability Zone in which to launch the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public FleetLaunchTemplateOverridesRequest withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** ** The number of units provided by the specified instance type. *
* * @param weightedCapacity * The number of units provided by the specified instance type. */ public void setWeightedCapacity(Double weightedCapacity) { this.weightedCapacity = weightedCapacity; } /** ** The number of units provided by the specified instance type. *
* * @return The number of units provided by the specified instance type. */ public Double getWeightedCapacity() { return this.weightedCapacity; } /** ** The number of units provided by the specified instance type. *
* * @param weightedCapacity * The number of units provided by the specified instance type. * @return Returns a reference to this object so that method calls can be chained together. */ public FleetLaunchTemplateOverridesRequest withWeightedCapacity(Double weightedCapacity) { setWeightedCapacity(weightedCapacity); return this; } /** ** The priority for the launch template override. The highest priority is launched first. *
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2 Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses
* priority to determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
*/
public void setPriority(Double priority) {
this.priority = priority;
}
/**
*
* The priority for the launch template override. The highest priority is launched first. *
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2 Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses
* priority to determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
*/
public Double getPriority() {
return this.priority;
}
/**
*
* The priority for the launch template override. The highest priority is launched first. *
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses priority to
* determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2 Fleet uses
* priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity,
* but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority. If no
* number is set, the launch template override has the lowest priority. You can set the same priority for different
* launch template overrides.
*
* If the On-Demand AllocationStrategy
is set to prioritized
, EC2 Fleet uses
* priority to determine which launch template override to use first in fulfilling On-Demand capacity.
*
* If the Spot AllocationStrategy
is set to capacity-optimized-prioritized
, EC2
* Fleet uses priority on a best-effort basis to determine which launch template override to use in
* fulfilling Spot capacity, but optimizes for capacity first.
*
* Valid values are whole numbers starting at 0
. The lower the number, the higher the priority.
* If no number is set, the launch template override has the lowest priority. You can set the same priority
* for different launch template overrides.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateOverridesRequest withPriority(Double priority) {
setPriority(priority);
return this;
}
/**
*
* The location where the instance launched, if applicable. *
* * @param placement * The location where the instance launched, if applicable. */ public void setPlacement(Placement placement) { this.placement = placement; } /** ** The location where the instance launched, if applicable. *
* * @return The location where the instance launched, if applicable. */ public Placement getPlacement() { return this.placement; } /** ** The location where the instance launched, if applicable. *
* * @param placement * The location where the instance launched, if applicable. * @return Returns a reference to this object so that method calls can be chained together. */ public FleetLaunchTemplateOverridesRequest withPlacement(Placement placement) { setPlacement(placement); return this; } /** ** The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with those attributes. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with those attributes. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance * types with those attributes. *
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* If you specify InstanceRequirements
, you can't specify InstanceType
.
*
* The ID of the AMI. An AMI is required to launch an instance. This parameter is only available for fleets of type
* instant
. For fleets of type maintain
and request
, you must specify the AMI
* ID in the launch template.
*
instant
. For fleets of type maintain
and request
, you must
* specify the AMI ID in the launch template.
*/
public void setImageId(String imageId) {
this.imageId = imageId;
}
/**
*
* The ID of the AMI. An AMI is required to launch an instance. This parameter is only available for fleets of type
* instant
. For fleets of type maintain
and request
, you must specify the AMI
* ID in the launch template.
*
instant
. For fleets of type maintain
and request
, you must
* specify the AMI ID in the launch template.
*/
public String getImageId() {
return this.imageId;
}
/**
*
* The ID of the AMI. An AMI is required to launch an instance. This parameter is only available for fleets of type
* instant
. For fleets of type maintain
and request
, you must specify the AMI
* ID in the launch template.
*
instant
. For fleets of type maintain
and request
, you must
* specify the AMI ID in the launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateOverridesRequest withImageId(String imageId) {
setImageId(imageId);
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 (getMaxPrice() != null)
sb.append("MaxPrice: ").append(getMaxPrice()).append(",");
if (getSubnetId() != null)
sb.append("SubnetId: ").append(getSubnetId()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getWeightedCapacity() != null)
sb.append("WeightedCapacity: ").append(getWeightedCapacity()).append(",");
if (getPriority() != null)
sb.append("Priority: ").append(getPriority()).append(",");
if (getPlacement() != null)
sb.append("Placement: ").append(getPlacement()).append(",");
if (getInstanceRequirements() != null)
sb.append("InstanceRequirements: ").append(getInstanceRequirements()).append(",");
if (getImageId() != null)
sb.append("ImageId: ").append(getImageId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FleetLaunchTemplateOverridesRequest == false)
return false;
FleetLaunchTemplateOverridesRequest other = (FleetLaunchTemplateOverridesRequest) obj;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getMaxPrice() == null ^ this.getMaxPrice() == null)
return false;
if (other.getMaxPrice() != null && other.getMaxPrice().equals(this.getMaxPrice()) == false)
return false;
if (other.getSubnetId() == null ^ this.getSubnetId() == null)
return false;
if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == 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.getWeightedCapacity() == null ^ this.getWeightedCapacity() == null)
return false;
if (other.getWeightedCapacity() != null && other.getWeightedCapacity().equals(this.getWeightedCapacity()) == false)
return false;
if (other.getPriority() == null ^ this.getPriority() == null)
return false;
if (other.getPriority() != null && other.getPriority().equals(this.getPriority()) == false)
return false;
if (other.getPlacement() == null ^ this.getPlacement() == null)
return false;
if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false)
return false;
if (other.getInstanceRequirements() == null ^ this.getInstanceRequirements() == null)
return false;
if (other.getInstanceRequirements() != null && other.getInstanceRequirements().equals(this.getInstanceRequirements()) == false)
return false;
if (other.getImageId() == null ^ this.getImageId() == null)
return false;
if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == 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 + ((getMaxPrice() == null) ? 0 : getMaxPrice().hashCode());
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getWeightedCapacity() == null) ? 0 : getWeightedCapacity().hashCode());
hashCode = prime * hashCode + ((getPriority() == null) ? 0 : getPriority().hashCode());
hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
hashCode = prime * hashCode + ((getInstanceRequirements() == null) ? 0 : getInstanceRequirements().hashCode());
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
return hashCode;
}
@Override
public FleetLaunchTemplateOverridesRequest clone() {
try {
return (FleetLaunchTemplateOverridesRequest) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}