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

com.tencentcloudapi.as.v20180419.models.SpotMixedAllocationPolicy Maven / Gradle / Ivy

/*
 * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.tencentcloudapi.as.v20180419.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class SpotMixedAllocationPolicy extends AbstractModel{

    /**
    * The minimum number of the scaling group’s capacity that must be fulfilled by pay-as-you-go instances. It defaults to 0 if not specified. Its value cannot exceed the max capacity of the scaling group.
Note: this field may return `null`, indicating that no valid value can be obtained.
    */
    @SerializedName("BaseCapacity")
    @Expose
    private Long BaseCapacity;

    /**
    * Controls the percentage of pay-as-you-go instances for the additional capacity beyond `BaseCapacity`. Valid range: 0-100. The value 0 indicates that only spot instances are provisioned, while the value 100 indicates that only pay-as-you-go instances are provisioned. It defaults to 70 if not specified. The number of pay-as-you-go instances calculated on the percentage should be rounded up.
For example, if the desired capacity is 3, the `BaseCapacity` is set to 1, and the `OnDemandPercentageAboveBaseCapacity` is set to 1, the scaling group will have 2 pay-as-you-go instance (one comes from the base capacity, and the other comes from the rounded up value of the proportion), and 1 spot instance.
Note: this field may return `null`, indicating that no valid value can be obtained.
    */
    @SerializedName("OnDemandPercentageAboveBaseCapacity")
    @Expose
    private Long OnDemandPercentageAboveBaseCapacity;

    /**
    * Specifies how to assign spot instances in a mixed instance mode. Valid values: `COST_OPTIMIZED` and `CAPACITY_OPTIMIZED`; default value: `COST_OPTIMIZED`.

  • `COST_OPTIMIZED`: the lowest cost policy. For each model in the launch configuration, AS tries to purchase it based on the lowest unit price per core in each availability zone. If the purchase failed, try the second-lowest unit price.
  • `CAPACITY_OPTIMIZED`: the optimal capacity policy. For each model in the launch configuration, AS tries to purchase it based on the largest stock in each availability zone, minimizing the automatic repossession probability of spot instances. Note: this field may return `null`, indicating that no valid value can be obtained. */ @SerializedName("SpotAllocationStrategy") @Expose private String SpotAllocationStrategy; /** * Whether to replace with pay-as-you go instances. Valid values:
  • `TRUE`: yes. After the purchase of spot instances failed due to insufficient stock and other reasons, purchase pay-as-you-go instances.
  • `FALSE`: no. The scaling group only tries the configured model of spot instances when it needs to add spot instances. Default value: `TRUE`. Note: this field may return `null`, indicating that no valid value can be obtained. */ @SerializedName("CompensateWithBaseInstance") @Expose private Boolean CompensateWithBaseInstance; /** * Get The minimum number of the scaling group’s capacity that must be fulfilled by pay-as-you-go instances. It defaults to 0 if not specified. Its value cannot exceed the max capacity of the scaling group. Note: this field may return `null`, indicating that no valid value can be obtained. * @return BaseCapacity The minimum number of the scaling group’s capacity that must be fulfilled by pay-as-you-go instances. It defaults to 0 if not specified. Its value cannot exceed the max capacity of the scaling group. Note: this field may return `null`, indicating that no valid value can be obtained. */ public Long getBaseCapacity() { return this.BaseCapacity; } /** * Set The minimum number of the scaling group’s capacity that must be fulfilled by pay-as-you-go instances. It defaults to 0 if not specified. Its value cannot exceed the max capacity of the scaling group. Note: this field may return `null`, indicating that no valid value can be obtained. * @param BaseCapacity The minimum number of the scaling group’s capacity that must be fulfilled by pay-as-you-go instances. It defaults to 0 if not specified. Its value cannot exceed the max capacity of the scaling group. Note: this field may return `null`, indicating that no valid value can be obtained. */ public void setBaseCapacity(Long BaseCapacity) { this.BaseCapacity = BaseCapacity; } /** * Get Controls the percentage of pay-as-you-go instances for the additional capacity beyond `BaseCapacity`. Valid range: 0-100. The value 0 indicates that only spot instances are provisioned, while the value 100 indicates that only pay-as-you-go instances are provisioned. It defaults to 70 if not specified. The number of pay-as-you-go instances calculated on the percentage should be rounded up. For example, if the desired capacity is 3, the `BaseCapacity` is set to 1, and the `OnDemandPercentageAboveBaseCapacity` is set to 1, the scaling group will have 2 pay-as-you-go instance (one comes from the base capacity, and the other comes from the rounded up value of the proportion), and 1 spot instance. Note: this field may return `null`, indicating that no valid value can be obtained. * @return OnDemandPercentageAboveBaseCapacity Controls the percentage of pay-as-you-go instances for the additional capacity beyond `BaseCapacity`. Valid range: 0-100. The value 0 indicates that only spot instances are provisioned, while the value 100 indicates that only pay-as-you-go instances are provisioned. It defaults to 70 if not specified. The number of pay-as-you-go instances calculated on the percentage should be rounded up. For example, if the desired capacity is 3, the `BaseCapacity` is set to 1, and the `OnDemandPercentageAboveBaseCapacity` is set to 1, the scaling group will have 2 pay-as-you-go instance (one comes from the base capacity, and the other comes from the rounded up value of the proportion), and 1 spot instance. Note: this field may return `null`, indicating that no valid value can be obtained. */ public Long getOnDemandPercentageAboveBaseCapacity() { return this.OnDemandPercentageAboveBaseCapacity; } /** * Set Controls the percentage of pay-as-you-go instances for the additional capacity beyond `BaseCapacity`. Valid range: 0-100. The value 0 indicates that only spot instances are provisioned, while the value 100 indicates that only pay-as-you-go instances are provisioned. It defaults to 70 if not specified. The number of pay-as-you-go instances calculated on the percentage should be rounded up. For example, if the desired capacity is 3, the `BaseCapacity` is set to 1, and the `OnDemandPercentageAboveBaseCapacity` is set to 1, the scaling group will have 2 pay-as-you-go instance (one comes from the base capacity, and the other comes from the rounded up value of the proportion), and 1 spot instance. Note: this field may return `null`, indicating that no valid value can be obtained. * @param OnDemandPercentageAboveBaseCapacity Controls the percentage of pay-as-you-go instances for the additional capacity beyond `BaseCapacity`. Valid range: 0-100. The value 0 indicates that only spot instances are provisioned, while the value 100 indicates that only pay-as-you-go instances are provisioned. It defaults to 70 if not specified. The number of pay-as-you-go instances calculated on the percentage should be rounded up. For example, if the desired capacity is 3, the `BaseCapacity` is set to 1, and the `OnDemandPercentageAboveBaseCapacity` is set to 1, the scaling group will have 2 pay-as-you-go instance (one comes from the base capacity, and the other comes from the rounded up value of the proportion), and 1 spot instance. Note: this field may return `null`, indicating that no valid value can be obtained. */ public void setOnDemandPercentageAboveBaseCapacity(Long OnDemandPercentageAboveBaseCapacity) { this.OnDemandPercentageAboveBaseCapacity = OnDemandPercentageAboveBaseCapacity; } /** * Get Specifies how to assign spot instances in a mixed instance mode. Valid values: `COST_OPTIMIZED` and `CAPACITY_OPTIMIZED`; default value: `COST_OPTIMIZED`.
  • `COST_OPTIMIZED`: the lowest cost policy. For each model in the launch configuration, AS tries to purchase it based on the lowest unit price per core in each availability zone. If the purchase failed, try the second-lowest unit price.
  • `CAPACITY_OPTIMIZED`: the optimal capacity policy. For each model in the launch configuration, AS tries to purchase it based on the largest stock in each availability zone, minimizing the automatic repossession probability of spot instances. Note: this field may return `null`, indicating that no valid value can be obtained. * @return SpotAllocationStrategy Specifies how to assign spot instances in a mixed instance mode. Valid values: `COST_OPTIMIZED` and `CAPACITY_OPTIMIZED`; default value: `COST_OPTIMIZED`.
  • `COST_OPTIMIZED`: the lowest cost policy. For each model in the launch configuration, AS tries to purchase it based on the lowest unit price per core in each availability zone. If the purchase failed, try the second-lowest unit price.
  • `CAPACITY_OPTIMIZED`: the optimal capacity policy. For each model in the launch configuration, AS tries to purchase it based on the largest stock in each availability zone, minimizing the automatic repossession probability of spot instances. Note: this field may return `null`, indicating that no valid value can be obtained. */ public String getSpotAllocationStrategy() { return this.SpotAllocationStrategy; } /** * Set Specifies how to assign spot instances in a mixed instance mode. Valid values: `COST_OPTIMIZED` and `CAPACITY_OPTIMIZED`; default value: `COST_OPTIMIZED`.
  • `COST_OPTIMIZED`: the lowest cost policy. For each model in the launch configuration, AS tries to purchase it based on the lowest unit price per core in each availability zone. If the purchase failed, try the second-lowest unit price.
  • `CAPACITY_OPTIMIZED`: the optimal capacity policy. For each model in the launch configuration, AS tries to purchase it based on the largest stock in each availability zone, minimizing the automatic repossession probability of spot instances. Note: this field may return `null`, indicating that no valid value can be obtained. * @param SpotAllocationStrategy Specifies how to assign spot instances in a mixed instance mode. Valid values: `COST_OPTIMIZED` and `CAPACITY_OPTIMIZED`; default value: `COST_OPTIMIZED`.
  • `COST_OPTIMIZED`: the lowest cost policy. For each model in the launch configuration, AS tries to purchase it based on the lowest unit price per core in each availability zone. If the purchase failed, try the second-lowest unit price.
  • `CAPACITY_OPTIMIZED`: the optimal capacity policy. For each model in the launch configuration, AS tries to purchase it based on the largest stock in each availability zone, minimizing the automatic repossession probability of spot instances. Note: this field may return `null`, indicating that no valid value can be obtained. */ public void setSpotAllocationStrategy(String SpotAllocationStrategy) { this.SpotAllocationStrategy = SpotAllocationStrategy; } /** * Get Whether to replace with pay-as-you go instances. Valid values:
  • `TRUE`: yes. After the purchase of spot instances failed due to insufficient stock and other reasons, purchase pay-as-you-go instances.
  • `FALSE`: no. The scaling group only tries the configured model of spot instances when it needs to add spot instances. Default value: `TRUE`. Note: this field may return `null`, indicating that no valid value can be obtained. * @return CompensateWithBaseInstance Whether to replace with pay-as-you go instances. Valid values:
  • `TRUE`: yes. After the purchase of spot instances failed due to insufficient stock and other reasons, purchase pay-as-you-go instances.
  • `FALSE`: no. The scaling group only tries the configured model of spot instances when it needs to add spot instances. Default value: `TRUE`. Note: this field may return `null`, indicating that no valid value can be obtained. */ public Boolean getCompensateWithBaseInstance() { return this.CompensateWithBaseInstance; } /** * Set Whether to replace with pay-as-you go instances. Valid values:
  • `TRUE`: yes. After the purchase of spot instances failed due to insufficient stock and other reasons, purchase pay-as-you-go instances.
  • `FALSE`: no. The scaling group only tries the configured model of spot instances when it needs to add spot instances. Default value: `TRUE`. Note: this field may return `null`, indicating that no valid value can be obtained. * @param CompensateWithBaseInstance Whether to replace with pay-as-you go instances. Valid values:
  • `TRUE`: yes. After the purchase of spot instances failed due to insufficient stock and other reasons, purchase pay-as-you-go instances.
  • `FALSE`: no. The scaling group only tries the configured model of spot instances when it needs to add spot instances. Default value: `TRUE`. Note: this field may return `null`, indicating that no valid value can be obtained. */ public void setCompensateWithBaseInstance(Boolean CompensateWithBaseInstance) { this.CompensateWithBaseInstance = CompensateWithBaseInstance; } public SpotMixedAllocationPolicy() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public SpotMixedAllocationPolicy(SpotMixedAllocationPolicy source) { if (source.BaseCapacity != null) { this.BaseCapacity = new Long(source.BaseCapacity); } if (source.OnDemandPercentageAboveBaseCapacity != null) { this.OnDemandPercentageAboveBaseCapacity = new Long(source.OnDemandPercentageAboveBaseCapacity); } if (source.SpotAllocationStrategy != null) { this.SpotAllocationStrategy = new String(source.SpotAllocationStrategy); } if (source.CompensateWithBaseInstance != null) { this.CompensateWithBaseInstance = new Boolean(source.CompensateWithBaseInstance); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap map, String prefix) { this.setParamSimple(map, prefix + "BaseCapacity", this.BaseCapacity); this.setParamSimple(map, prefix + "OnDemandPercentageAboveBaseCapacity", this.OnDemandPercentageAboveBaseCapacity); this.setParamSimple(map, prefix + "SpotAllocationStrategy", this.SpotAllocationStrategy); this.setParamSimple(map, prefix + "CompensateWithBaseInstance", this.CompensateWithBaseInstance); } }




  • © 2015 - 2025 Weber Informatics LLC | Privacy Policy