All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.FleetLaunchTemplateOverridesRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2016-2021 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. *

*/ private String instanceType; /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. *

*/ private String maxPrice; /** *

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

*/ private String subnetId; /** *

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

*/ private Double priority; /** *

* The location where the instance launched, if applicable. *

*/ private Placement placement; /** *

* The instance type. *

* * @param instanceType * The instance type. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** *

* The instance type. *

* * @return The instance type. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** *

* The instance type. *

* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public FleetLaunchTemplateOverridesRequest withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** *

* The instance type. *

* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public FleetLaunchTemplateOverridesRequest withInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. *

* * @param maxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. */ public void setMaxPrice(String maxPrice) { this.maxPrice = maxPrice; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. *

* * @return The maximum price per unit hour that you are willing to pay for a Spot Instance. */ public String getMaxPrice() { return this.maxPrice; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. *

* * @param maxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. * @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. *

* * @param 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. */ 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. *

* * @return 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. */ 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. *

* * @param 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. * @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 first 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. *

* * @param 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 first 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 first 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 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 first 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 first 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. *

* * @param 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 first 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; } /** * 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()); 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; 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()); 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); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy