/* * Copyright (c) 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. */ namespace TencentCloud.As.V20180419.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class CreateAutoScalingGroupRequest : AbstractModel { /// /// 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 /// [JsonProperty("AutoScalingGroupName")] public string AutoScalingGroupName{ get; set; } /// /// 启动配置ID /// [JsonProperty("LaunchConfigurationId")] public string LaunchConfigurationId{ get; set; } /// /// 最大实例数,取值范围为0-2000。 /// [JsonProperty("MaxSize")] public ulong? MaxSize{ get; set; } /// /// 最小实例数,取值范围为0-2000。 /// [JsonProperty("MinSize")] public ulong? MinSize{ get; set; } /// /// VPC ID,基础网络则填空字符串 /// [JsonProperty("VpcId")] public string VpcId{ get; set; } /// /// 默认冷却时间,单位秒,默认值为300 /// [JsonProperty("DefaultCooldown")] public ulong? DefaultCooldown{ get; set; } /// /// 期望实例数,大小介于最小实例数和最大实例数之间 /// [JsonProperty("DesiredCapacity")] public ulong? DesiredCapacity{ get; set; } /// /// 传统负载均衡器ID列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 /// [JsonProperty("LoadBalancerIds")] public string[] LoadBalancerIds{ get; set; } /// /// 项目ID /// [JsonProperty("ProjectId")] public ulong? ProjectId{ get; set; } /// /// 应用型负载均衡器列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 /// [JsonProperty("ForwardLoadBalancers")] public ForwardLoadBalancer[] ForwardLoadBalancers{ get; set; } /// /// 子网ID列表,VPC场景下必须指定子网。多个子网以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 /// [JsonProperty("SubnetIds")] public string[] SubnetIds{ get; set; } /// /// 销毁策略,目前长度上限为1。取值包括 OLDEST_INSTANCE 和 NEWEST_INSTANCE,默认取值为 OLDEST_INSTANCE。 ///
  • OLDEST_INSTANCE 优先销毁伸缩组中最旧的实例。 ///
  • NEWEST_INSTANCE,优先销毁伸缩组中最新的实例。 ///
  • [JsonProperty("TerminationPolicies")] public string[] TerminationPolicies{ get; set; } /// /// 可用区列表,基础网络场景下必须指定可用区。多个可用区以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 /// [JsonProperty("Zones")] public string[] Zones{ get; set; } /// /// 重试策略,取值包括 IMMEDIATE_RETRY、 INCREMENTAL_INTERVALS、NO_RETRY,默认取值为 IMMEDIATE_RETRY。 ///
  • IMMEDIATE_RETRY,立即重试,在较短时间内快速重试,连续失败超过一定次数(5次)后不再重试。 ///
  • INCREMENTAL_INTERVALS,间隔递增重试,随着连续失败次数的增加,重试间隔逐渐增大,重试间隔从秒级到1天不等。 ///
  • NO_RETRY,不进行重试,直到再次收到用户调用或者告警信息后才会重试。 ///
  • [JsonProperty("RetryPolicy")] public string RetryPolicy{ get; set; } /// /// 可用区校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 ///
  • ALL,所有可用区(Zone)或子网(SubnetId)都可用则通过校验,否则校验报错。 ///
  • ANY,存在任何一个可用区(Zone)或子网(SubnetId)可用则通过校验,否则校验报错。 /// /// 可用区或子网不可用的常见原因包括该可用区CVM实例类型售罄、该可用区CBS云盘售罄、该可用区配额不足、该子网IP不足等。 /// 如果 Zones/SubnetIds 中可用区或者子网不存在,则无论 ZonesCheckPolicy 采用何种取值,都会校验报错。 ///
  • [JsonProperty("ZonesCheckPolicy")] public string ZonesCheckPolicy{ get; set; } /// /// 标签描述列表。通过指定该参数可以支持绑定标签到伸缩组。同时绑定标签到相应的资源实例, /// [JsonProperty("Tags")] public Tag[] Tags{ get; set; } /// /// 服务设置,包括云监控不健康替换等服务设置。 /// [JsonProperty("ServiceSettings")] public ServiceSettings ServiceSettings{ get; set; } /// /// 实例具有IPv6地址数量的配置,取值包括 0、1,默认值为0。 /// [JsonProperty("Ipv6AddressCount")] public long? Ipv6AddressCount{ get; set; } /// /// 多可用区/子网策略,取值包括 PRIORITY 和 EQUALITY,默认为 PRIORITY。 ///
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 ///
  • EQUALITY:每次选择当前实例数最少的可用区/子网进行扩容,使得每个可用区/子网都有机会发生扩容,多次扩容出的实例会打散到多个可用区/子网。 /// /// 与本策略相关的注意点: ///
  • 当伸缩组为基础网络时,本策略适用于多可用区;当伸缩组为VPC网络时,本策略适用于多子网,此时不再考虑可用区因素,例如四个子网ABCD,其中ABC处于可用区1,D处于可用区2,此时考虑子网ABCD进行排序,而不考虑可用区1、2。 ///
  • 本策略适用于多可用区/子网,不适用于启动配置的多机型。多机型按照优先级策略进行选择。 ///
  • 创建实例时,先保证多机型的策略,后保证多可用区/子网的策略。例如多机型A、B,多子网1、2、3(按照PRIORITY策略),会按照A1、A2、A3、B1、B2、B3 进行尝试,如果A1售罄,会尝试A2(而非B1)。 ///
  • 无论使用哪种策略,单次伸缩活动总是优先保持使用一种具体配置(机型 * 可用区/子网)。 ///
  • [JsonProperty("MultiZoneSubnetPolicy")] public string MultiZoneSubnetPolicy{ get; set; } /// /// For internal usage only. DO NOT USE IT. /// internal override void ToMap(Dictionary map, string prefix) { this.SetParamSimple(map, prefix + "AutoScalingGroupName", this.AutoScalingGroupName); this.SetParamSimple(map, prefix + "LaunchConfigurationId", this.LaunchConfigurationId); this.SetParamSimple(map, prefix + "MaxSize", this.MaxSize); this.SetParamSimple(map, prefix + "MinSize", this.MinSize); this.SetParamSimple(map, prefix + "VpcId", this.VpcId); this.SetParamSimple(map, prefix + "DefaultCooldown", this.DefaultCooldown); this.SetParamSimple(map, prefix + "DesiredCapacity", this.DesiredCapacity); this.SetParamArraySimple(map, prefix + "LoadBalancerIds.", this.LoadBalancerIds); this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId); this.SetParamArrayObj(map, prefix + "ForwardLoadBalancers.", this.ForwardLoadBalancers); this.SetParamArraySimple(map, prefix + "SubnetIds.", this.SubnetIds); this.SetParamArraySimple(map, prefix + "TerminationPolicies.", this.TerminationPolicies); this.SetParamArraySimple(map, prefix + "Zones.", this.Zones); this.SetParamSimple(map, prefix + "RetryPolicy", this.RetryPolicy); this.SetParamSimple(map, prefix + "ZonesCheckPolicy", this.ZonesCheckPolicy); this.SetParamArrayObj(map, prefix + "Tags.", this.Tags); this.SetParamObj(map, prefix + "ServiceSettings.", this.ServiceSettings); this.SetParamSimple(map, prefix + "Ipv6AddressCount", this.Ipv6AddressCount); this.SetParamSimple(map, prefix + "MultiZoneSubnetPolicy", this.MultiZoneSubnetPolicy); } } }