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

com.amazonaws.services.autoscaling.model.InstancesDistribution Maven / Gradle / Ivy

/*
 * Copyright 2013-2018 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.autoscaling.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 * 

* Describes an instances distribution for an Auto Scaling group with MixedInstancesPolicy. *

*

* The instances distribution specifies the distribution of On-Demand Instances and Spot Instances, the maximum price to * pay for Spot Instances, and how the Auto Scaling group allocates instance types. *

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

* Indicates how to allocate instance types to fulfill On-Demand capacity. *

*

* The only valid value is prioritized, which is also the default value. This strategy uses the order * of instance types in the Overrides array of LaunchTemplate to define the launch priority of each * instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand * capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the * remaining capacity using the second priority instance type, and so on. *

*/ private String onDemandAllocationStrategy; /** *

* The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base * portion is provisioned first as your group scales. *

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a percentage of * the Auto Scaling group's desired capacity, per the OnDemandPercentageAboveBaseCapacity setting. *

*/ private Integer onDemandBaseCapacity; /** *

* Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity. *

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are 100% * for On-Demand Instances and 0% for Spot Instances. *

*/ private Integer onDemandPercentageAboveBaseCapacity; /** *

* Indicates how to allocate Spot capacity across Spot pools. *

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools that you * specify. *

*/ private String spotAllocationStrategy; /** *

* The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the different * instance types in the Overrides array of LaunchTemplate. *

*

* The range is 1–20 and the default is 2. *

*/ private Integer spotInstancePools; /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value blank * (which is the default), the maximum Spot price is set at the On-Demand price. *

*/ private String spotMaxPrice; /** *

* Indicates how to allocate instance types to fulfill On-Demand capacity. *

*

* The only valid value is prioritized, which is also the default value. This strategy uses the order * of instance types in the Overrides array of LaunchTemplate to define the launch priority of each * instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand * capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the * remaining capacity using the second priority instance type, and so on. *

* * @param onDemandAllocationStrategy * Indicates how to allocate instance types to fulfill On-Demand capacity.

*

* The only valid value is prioritized, which is also the default value. This strategy uses the * order of instance types in the Overrides array of LaunchTemplate to define the launch * priority of each instance type. The first instance type in the array is prioritized higher than the last. * If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then the Auto * Scaling groups launches the remaining capacity using the second priority instance type, and so on. */ public void setOnDemandAllocationStrategy(String onDemandAllocationStrategy) { this.onDemandAllocationStrategy = onDemandAllocationStrategy; } /** *

* Indicates how to allocate instance types to fulfill On-Demand capacity. *

*

* The only valid value is prioritized, which is also the default value. This strategy uses the order * of instance types in the Overrides array of LaunchTemplate to define the launch priority of each * instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand * capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the * remaining capacity using the second priority instance type, and so on. *

* * @return Indicates how to allocate instance types to fulfill On-Demand capacity.

*

* The only valid value is prioritized, which is also the default value. This strategy uses the * order of instance types in the Overrides array of LaunchTemplate to define the launch * priority of each instance type. The first instance type in the array is prioritized higher than the last. * If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then the Auto * Scaling groups launches the remaining capacity using the second priority instance type, and so on. */ public String getOnDemandAllocationStrategy() { return this.onDemandAllocationStrategy; } /** *

* Indicates how to allocate instance types to fulfill On-Demand capacity. *

*

* The only valid value is prioritized, which is also the default value. This strategy uses the order * of instance types in the Overrides array of LaunchTemplate to define the launch priority of each * instance type. The first instance type in the array is prioritized higher than the last. If all your On-Demand * capacity cannot be fulfilled using your highest priority instance, then the Auto Scaling groups launches the * remaining capacity using the second priority instance type, and so on. *

* * @param onDemandAllocationStrategy * Indicates how to allocate instance types to fulfill On-Demand capacity.

*

* The only valid value is prioritized, which is also the default value. This strategy uses the * order of instance types in the Overrides array of LaunchTemplate to define the launch * priority of each instance type. The first instance type in the array is prioritized higher than the last. * If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then the Auto * Scaling groups launches the remaining capacity using the second priority instance type, and so on. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withOnDemandAllocationStrategy(String onDemandAllocationStrategy) { setOnDemandAllocationStrategy(onDemandAllocationStrategy); return this; } /** *

* The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base * portion is provisioned first as your group scales. *

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a percentage of * the Auto Scaling group's desired capacity, per the OnDemandPercentageAboveBaseCapacity setting. *

* * @param onDemandBaseCapacity * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. * This base portion is provisioned first as your group scales.

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a * percentage of the Auto Scaling group's desired capacity, per the * OnDemandPercentageAboveBaseCapacity setting. */ public void setOnDemandBaseCapacity(Integer onDemandBaseCapacity) { this.onDemandBaseCapacity = onDemandBaseCapacity; } /** *

* The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base * portion is provisioned first as your group scales. *

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a percentage of * the Auto Scaling group's desired capacity, per the OnDemandPercentageAboveBaseCapacity setting. *

* * @return The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. * This base portion is provisioned first as your group scales.

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a * percentage of the Auto Scaling group's desired capacity, per the * OnDemandPercentageAboveBaseCapacity setting. */ public Integer getOnDemandBaseCapacity() { return this.onDemandBaseCapacity; } /** *

* The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base * portion is provisioned first as your group scales. *

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a percentage of * the Auto Scaling group's desired capacity, per the OnDemandPercentageAboveBaseCapacity setting. *

* * @param onDemandBaseCapacity * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. * This base portion is provisioned first as your group scales.

*

* The default value is 0. If you leave this parameter set to 0, On-Demand Instances are launched as a * percentage of the Auto Scaling group's desired capacity, per the * OnDemandPercentageAboveBaseCapacity setting. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withOnDemandBaseCapacity(Integer onDemandBaseCapacity) { setOnDemandBaseCapacity(onDemandBaseCapacity); return this; } /** *

* Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity. *

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are 100% * for On-Demand Instances and 0% for Spot Instances. *

* * @param onDemandPercentageAboveBaseCapacity * Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity.

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are * 100% for On-Demand Instances and 0% for Spot Instances. */ public void setOnDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity) { this.onDemandPercentageAboveBaseCapacity = onDemandPercentageAboveBaseCapacity; } /** *

* Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity. *

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are 100% * for On-Demand Instances and 0% for Spot Instances. *

* * @return Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity.

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are * 100% for On-Demand Instances and 0% for Spot Instances. */ public Integer getOnDemandPercentageAboveBaseCapacity() { return this.onDemandPercentageAboveBaseCapacity; } /** *

* Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity. *

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are 100% * for On-Demand Instances and 0% for Spot Instances. *

* * @param onDemandPercentageAboveBaseCapacity * Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond * OnDemandBaseCapacity.

*

* The range is 0–100. The default value is 100. If you leave this parameter set to 100, the percentages are * 100% for On-Demand Instances and 0% for Spot Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withOnDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity) { setOnDemandPercentageAboveBaseCapacity(onDemandPercentageAboveBaseCapacity); return this; } /** *

* Indicates how to allocate Spot capacity across Spot pools. *

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools that you * specify. *

* * @param spotAllocationStrategy * Indicates how to allocate Spot capacity across Spot pools.

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools * that you specify. */ public void setSpotAllocationStrategy(String spotAllocationStrategy) { this.spotAllocationStrategy = spotAllocationStrategy; } /** *

* Indicates how to allocate Spot capacity across Spot pools. *

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools that you * specify. *

* * @return Indicates how to allocate Spot capacity across Spot pools.

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling * group selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot * pools that you specify. */ public String getSpotAllocationStrategy() { return this.spotAllocationStrategy; } /** *

* Indicates how to allocate Spot capacity across Spot pools. *

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools that you * specify. *

* * @param spotAllocationStrategy * Indicates how to allocate Spot capacity across Spot pools.

*

* The only valid value is lowest-price, which is also the default value. The Auto Scaling group * selects the cheapest Spot pools and evenly allocates your Spot capacity across the number of Spot pools * that you specify. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withSpotAllocationStrategy(String spotAllocationStrategy) { setSpotAllocationStrategy(spotAllocationStrategy); return this; } /** *

* The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the different * instance types in the Overrides array of LaunchTemplate. *

*

* The range is 1–20 and the default is 2. *

* * @param spotInstancePools * The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the * different instance types in the Overrides array of LaunchTemplate.

*

* The range is 1–20 and the default is 2. */ public void setSpotInstancePools(Integer spotInstancePools) { this.spotInstancePools = spotInstancePools; } /** *

* The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the different * instance types in the Overrides array of LaunchTemplate. *

*

* The range is 1–20 and the default is 2. *

* * @return The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the * different instance types in the Overrides array of LaunchTemplate.

*

* The range is 1–20 and the default is 2. */ public Integer getSpotInstancePools() { return this.spotInstancePools; } /** *

* The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the different * instance types in the Overrides array of LaunchTemplate. *

*

* The range is 1–20 and the default is 2. *

* * @param spotInstancePools * The number of Spot pools to use to allocate your Spot capacity. The Spot pools are determined from the * different instance types in the Overrides array of LaunchTemplate.

*

* The range is 1–20 and the default is 2. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withSpotInstancePools(Integer spotInstancePools) { setSpotInstancePools(spotInstancePools); return this; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value blank * (which is the default), the maximum Spot price is set at the On-Demand price. *

* * @param spotMaxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value * blank (which is the default), the maximum Spot price is set at the On-Demand price. */ public void setSpotMaxPrice(String spotMaxPrice) { this.spotMaxPrice = spotMaxPrice; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value blank * (which is the default), the maximum Spot price is set at the On-Demand price. *

* * @return The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value * blank (which is the default), the maximum Spot price is set at the On-Demand price. */ public String getSpotMaxPrice() { return this.spotMaxPrice; } /** *

* The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value blank * (which is the default), the maximum Spot price is set at the On-Demand price. *

* * @param spotMaxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. If you leave this value * blank (which is the default), the maximum Spot price is set at the On-Demand price. * @return Returns a reference to this object so that method calls can be chained together. */ public InstancesDistribution withSpotMaxPrice(String spotMaxPrice) { setSpotMaxPrice(spotMaxPrice); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getOnDemandAllocationStrategy() != null) sb.append("OnDemandAllocationStrategy: ").append(getOnDemandAllocationStrategy()).append(","); if (getOnDemandBaseCapacity() != null) sb.append("OnDemandBaseCapacity: ").append(getOnDemandBaseCapacity()).append(","); if (getOnDemandPercentageAboveBaseCapacity() != null) sb.append("OnDemandPercentageAboveBaseCapacity: ").append(getOnDemandPercentageAboveBaseCapacity()).append(","); if (getSpotAllocationStrategy() != null) sb.append("SpotAllocationStrategy: ").append(getSpotAllocationStrategy()).append(","); if (getSpotInstancePools() != null) sb.append("SpotInstancePools: ").append(getSpotInstancePools()).append(","); if (getSpotMaxPrice() != null) sb.append("SpotMaxPrice: ").append(getSpotMaxPrice()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InstancesDistribution == false) return false; InstancesDistribution other = (InstancesDistribution) obj; if (other.getOnDemandAllocationStrategy() == null ^ this.getOnDemandAllocationStrategy() == null) return false; if (other.getOnDemandAllocationStrategy() != null && other.getOnDemandAllocationStrategy().equals(this.getOnDemandAllocationStrategy()) == false) return false; if (other.getOnDemandBaseCapacity() == null ^ this.getOnDemandBaseCapacity() == null) return false; if (other.getOnDemandBaseCapacity() != null && other.getOnDemandBaseCapacity().equals(this.getOnDemandBaseCapacity()) == false) return false; if (other.getOnDemandPercentageAboveBaseCapacity() == null ^ this.getOnDemandPercentageAboveBaseCapacity() == null) return false; if (other.getOnDemandPercentageAboveBaseCapacity() != null && other.getOnDemandPercentageAboveBaseCapacity().equals(this.getOnDemandPercentageAboveBaseCapacity()) == false) return false; if (other.getSpotAllocationStrategy() == null ^ this.getSpotAllocationStrategy() == null) return false; if (other.getSpotAllocationStrategy() != null && other.getSpotAllocationStrategy().equals(this.getSpotAllocationStrategy()) == false) return false; if (other.getSpotInstancePools() == null ^ this.getSpotInstancePools() == null) return false; if (other.getSpotInstancePools() != null && other.getSpotInstancePools().equals(this.getSpotInstancePools()) == false) return false; if (other.getSpotMaxPrice() == null ^ this.getSpotMaxPrice() == null) return false; if (other.getSpotMaxPrice() != null && other.getSpotMaxPrice().equals(this.getSpotMaxPrice()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOnDemandAllocationStrategy() == null) ? 0 : getOnDemandAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getOnDemandBaseCapacity() == null) ? 0 : getOnDemandBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getOnDemandPercentageAboveBaseCapacity() == null) ? 0 : getOnDemandPercentageAboveBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getSpotAllocationStrategy() == null) ? 0 : getSpotAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getSpotInstancePools() == null) ? 0 : getSpotInstancePools().hashCode()); hashCode = prime * hashCode + ((getSpotMaxPrice() == null) ? 0 : getSpotMaxPrice().hashCode()); return hashCode; } @Override public InstancesDistribution clone() { try { return (InstancesDistribution) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy