You need to enable JavaScript to run this app.
文档中心
弹性伸缩

弹性伸缩

复制全文
下载 pdf
伸缩组
ModifyScalingGroup - 修改一个伸缩组
复制全文
下载 pdf
ModifyScalingGroup - 修改一个伸缩组
修改一个伸缩组的基本信息和所属子网,可选参数如果不填则表示不修改该参数,操作说明请参见修改伸缩组的实例数量信息。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ModifyScalingGroup​
要执行的操作,取值:ModifyScalingGroup。​
​
Version string 必选 示例值:2020-01-01​
API的版本,取值:2020-01-01。​
​
HealthCheckType string 可选 示例值:ECS​
伸缩组的健康检查方式。取值范围:​
  • NONE(默认):不做实例健康状态检查。​
  • ECS:对伸缩组内的ECS实例做健康检查。​
​
MultiAZPolicy string 可选 示例值:PRIORITY​
多子网伸缩组的扩缩容策略。取值:​
  • PRIORITY:优先级策略。​
  • BALANCE:均衡分布策略。​
选择策略后的实例扩缩容情况请参见创建伸缩组中的“扩缩容”参数说明。​
​
InstancesDistribution.OnDemandBaseCapacity integer 可选 示例值:200​
伸缩组中按量计费实例个数的最小值,取值范围:0~2000。当组中按量计费实例个数少于该值时,将优先创建按量计费的实例。​
说明​
该参数仅当伸缩组绑定的伸缩配置来源的计费类型为抢占式类型时生效,且该参数不影响最终创建的实例数量,实例数量仍有最大/最小/期望实例数限制。​
​
LaunchTemplateOverrides.N.InstanceType string[] 可选 示例值:ecs.g2a.large​
指定实例规格。​
  • 参数 - N:表示实例规格的序号,取值为1 ~ 10。​
  • 取值 - InstanceType:表示实例规格。​
  • 多个实例规格之间用&分隔。​
  • 填写后,会覆盖启动模板中原本的实例规格。​
说明​
本参数仅当LaunchTemplateId参数存在取值时生有效。​
​
LaunchTemplateVersion string 可选 示例值:Default​
实例启动模板的版本。取值:​
  • 模板的某个版本号。​
  • Default:始终使用模板默认版本。​
  • Latest:始终使用模板最新版本。​
说明​
本参数仅当LaunchTemplateId参数存在取值时生有效。​
​
LaunchTemplateId string 可选 示例值:lt-yc5kwj1di33uw1qj****​
实例启动模板ID,配置后表示选择启动模版作为伸缩配置来源。​
​
ScalingGroupId string 必选 示例值:scg-yblhryq64wgh9zmp****​
伸缩组ID。您可以调用DescribeScalingGroups 接口查询伸缩组ID。​
​
SubnetIds.N string[] 可选 示例值:subnet-24sdlkdplsjkdjd****​
伸缩组中实例主网卡的子网ID列表,修改后与修改前的子网ID必须属于同一私有网络。您可以调用DescribeSubnets接口查询子网ID和子网所属的VPC信息。​
参数 - N:表示子网的序号,支持多选。多个子网需属于同一个VPC,同一可用区只允许选择一个子网。​
​
InstancesDistribution.CompensateWithOnDemand boolean 可选 示例值:false​
是否允许使用按量实例补充抢占式容量。当因价格、库存等原因无法创建足够的抢占式实例时,是否允许使用按量实例补充抢占式容量。取值:​
  • true: 允许。​
  • false: 不允许。​
​
InstancesDistribution.SpotInstanceRemedy boolean 可选 示例值:false​
是否允许抢占式实例到期替换。开启则表示在抢占式实例被回收前5分钟左右,伸缩组将主动新建新的抢占式实例替换掉当前抢占式实例。取值:​
  • true: 允许。​
  • false: 不允许。​
​
InstancesDistribution.OnDemandPercentageAboveBaseCapacity integer 可选 示例值:0​
伸缩组满足最小按量实例数要求后,超出的实例中按量实例应占的比例,取值范围:0~100。伸缩组满足最小按量实例数要求后,超出的实例中按量实例应占的比例,取值范围:0~100。​
说明​
该参数仅当伸缩组绑定的伸缩配置来源的计费类型为抢占式类型时生效。​
​
LaunchTemplateOverrides.N.PriceLimit float[] 可选 示例值:0.001​
指定抢占式实例规格每小时的最高价格。​
  • 参数 - N:表示实例规格的序号,取值为1 ~ 10。​
  • 取值 - PriceLimit:表示抢占式实例规格每小时的最高价格。取值:大于0,且最大不超过3位小数。​
  • 多个价格之间用&分隔。​
说明​
本参数仅当LaunchTemplateId参数存在取值,且启动模版的计费模式为设置出价上限的抢占式实例(即SpotWithPriceLimit)时有效。​
​
ActiveScalingConfigurationId string 可选 示例值:scc-yblhz5oxzml8j1gv****​
伸缩组绑定的伸缩配置的ID。您可以调用DescribeScalingConfigurations 接口查询伸缩配置ID。​
​
DefaultCooldown integer 可选 示例值:300​
执行一次伸缩活动(添加或移出ECS实例)结束后的冷却时间。​
冷却时间内,该伸缩组不执行其它的伸缩活动,仅针对云监控报警任务触发的伸缩活动和伸缩规则有效。​
取值范围:5 ~ 86400,单位:秒。​
​
DesireInstanceNumber integer 可选 示例值:2​
伸缩组中期望运行的实例个数。更多介绍请参见 期望实例数。​
  • 修改期望实例数后,将立即触发一次健康检查行为,组中的实例个数也将会随之变化。​
  • 取值:不小于最小实例数MinInstanceNumber且不大于最大实例数MaxInstanceNumber。​
​
InstanceTerminatePolicy string 可选 示例值:NewestInstance​
实例移除策略,取值:​
  • OldestInstance:移出最早加入 (包括自动创建和手动添加)伸缩组的实例。​
  • NewestInstance:移出最晚加入(包括自动创建和手动添加)伸缩组的实例。​
  • OldestScalingConfigurationWithOldestInstance(默认):移出最早与伸缩组绑定的伸缩配置中,最早由伸缩组 自动创建 的实例。​
  • OldestScalingConfigurationWithNewestInstance:移出 最早与伸缩组绑定的伸缩配置中,最晚由伸缩组 自动创建 的实例。​
​
MaxInstanceNumber integer 可选 示例值:3​
伸缩组中实例个数的最大值,默认取值0 ~ 100。​
​
MinInstanceNumber integer 可选 示例值:1​
伸缩组中实例个数的最小值,默认取值0 ~ 100。​
​
ScalingGroupName string 可选 示例值:scaling-group-test​
伸缩组名称,同一地域下伸缩组名称唯一,取值:​
  • 只能以中文、字母开头。​
  • 只能包含中文、字母、数字、下划线和中划线。​
  • 长度限制为1 ~ 128个字符 。​
  • 暂不支持特殊字符。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
ScalingGroupId string 示例值:scg-yblhryq64wgh9zmp****​
伸缩组ID。​
​
​
​
请求示例​
​
GET /?Action=ModifyScalingGroup&ScalingGroupId=scg-yblhryq64wp****&Version=2020-01-01 HTTP/1.1​
Host: auto-scaling.cn-beijing.volcengineapi.com​
X-Date: 20240507T092959Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240507/cn-beijing/auto_scaling/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2024050717301203918304911202AAF7",​
"Version": "2020-01-01",​
"Service": "auto_scaling",​
"Region": "cn-beijing"​
},​
"Result": {​
"ScalingGroupId": "scg-yblhryq64wgh9zmp****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidScalingGroup.InvalidStatus​
The specified ScalingGroup is not in the correct status.​
指定的伸缩组当前状态不支持该操作。​
400​
MissingParameter.ScalingGroupId​
The required parameter ScalingGroupId is not supplied.​
伸缩组ID不能为空。​
400​
InvalidScalingGroupName.Malformed​
The specified ScalingGroupName is malformed.​
指定的伸缩组名称不合法。​
400​
InvalidDefaultCooldown.Malformed​
The specified DefaultCooldown is malformed.​
指定的冷却时间不合法。​
400​
InvalidHealthCheckType​
The specified HealthCheckType is unsupported.​
指定的健康检查类型不支持。​
400​
InvalidLoadBalancerHealthCheckGracePeriod.Malformed​
The specified LoadBalancerHealthCheckGracePeriod is malformed.​
负载均衡宽限时间不合法.​
400​
LimitExceeded.SubnetIds​
You've reached the limit on the number of SubnetIds.​
已达到子网ID数量上限。​
400​
InvalidScalingConfiguration.ScalingGroupMismatch​
The specified ScalingConfiguration [%s] does not match ScalingGroup [%s].​
指定的伸缩配置和伸缩组不匹配。​
400​
InvalidScalingConfigurationAndLaunchTemplate.Conflict​
The specified ScalingConfiguration conflicts with LaunchTemplate.​
伸缩配置和启动模版重复。​
400​
InvalidOnDemandPercentageAboveBaseCapacity.Malformed​
The specified OnDemandPercentageAboveBaseCapacity is malformed.​
指定的超出实例中按量实例占比不合法。​
400​
InvalidOnDemandBaseCapacity.Malformed​
The specified OnDemandBaseCapacity is malformed.​
指定的按量计费实例个数最小值不合法。​
400​
InvalidMinInstanceNumber.Malformed​
The specified MinInstanceNumber is malformed.​
指定的最小实例数不合法。​
400​
InvalidMultiAZPolicy​
The specified MultiAZPolicy is unsupported.​
指定的多可用区策略不支持。​
400​
InvalidDesireInstanceNumber.Malformed​
The specified DesireInstanceNumber is malformed.​
指定的期望实例数不合法。​
400​
InvalidInstanceTerminatePolicy​
The specified InstanceTerminatePolicy is unsupported.​
指定的实例移除策略不支持。​
400​
InvalidMaxInstanceNumber.Malformed​
The specified MaxInstanceNumber is malformed.​
指定的最大实例数不合法。​
400​
LimitExceeded.LaunchTemplateOverrides​
You've reached the limit on the number of LaunchTemplateOverrides.​
已达到启动模版扩展参数数量上限。​
400​
InvalidLaunchTemplateVolumeSize.ImageSizeMismatch​
The specified LaunchTemplate VolumeSize is smaller than the ImageSize.​
指定启动模版中系统盘大小小于镜像大小。​
400​
InvalidLaunchTemplateHostName.Malformed​
The specified LaunchTemplate HostName is malformed.​
指定启动模版的宿主机名称不合法。​
400​
MissingParameter.LaunchTemplateVolumes​
The required parameter LaunchTemplate Volumes is not supplied.​
指定启动模版的磁盘信息不能为空。​
400​
MissingParameter.LaunchTemplateInstanceType​
The required parameter LaunchTemplate InstanceType is not supplied.​
指定启动模版中实例规格不能为空。​
400​
MissingParameter.LaunchTemplateImageId​
The required parameter LaunchTemplate ImageId is not supplied.​
指定启动模版中镜像ID不能为空。​
400​
InvalidLaunchTemplateId.VersionMismatch​
The specified LaunchTemplateId [%s] and LaunchTemplateVersion [%s] are mismatched.​
指定的启动模版ID和版本不匹配。​
400​
InvalidLaunchTemplateVersion.Malformed​
The specified LaunchTemplateVersion is malformed.​
指定的启动模版版本不合法。​
400​
MissingParameter.LaunchTemplateId​
The required LaunchTemplateId is not supplied.​
启动模版的ID不能为空。​
400​
MissingParameter.LaunchTemplateVersion​
The required LaunchTemplateVersion is not supplied.​
启动模版的版本不能为空。​
400​
MissingParameter.LaunchTemplateInstanceName​
The required parameter LaunchTemplate InstanceName is not supplied.​
指定的启动模版中实例名称不能为空。​
400​
InvalidMaxInstanceNumber.ScheduledInstanceExceed​
The MaxInstanceNumber is malformed due to the ScheduledInstance existing.​
由于弹性预约实例存在,最大实例数不合法。​
400​
MissingParameter.SubnetIds​
The required parameter SubnetIds is not supplied.​
子网ID不能为空。​
400​
InvalidLaunchTemplate.VpcIDMismatch​
The specified LaunchTemplate VpcId is different from ScalingGroup VpcId.​
指定的启动模版和伸缩组不在同一个VPC。​
404​
InvalidScalingGroupId.NotFound​
The specified ScalingGroup [%s] does not exist.​
指定的伸缩组不存在。​
404​
InvalidSubnetId.NotFound​
The specified SubnetId [%s] does not exist.​
指定的子网ID不存在。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
404​
InvalidLaunchTemplateImageId.NotFound​
The specified LaunchTemplate ImageId does not exist.​
指定启动模版的镜像ID不存在。​
404​
InvalidScalingConfiguration.NotFound​
The specified ScalingConfiguration [%s] does not exist.​
指定的伸缩配置不存在。​
409​
InvalidScalingGroupName.Conflict​
The specified ScalingGroupName already existed.​
指定的伸缩组名称已存在。​
409​
InvalidSubnetId.Conflict​
The specified SubnetId [%s] already existed.​
指定的子网ID已存在。​
412​
OperationDenied.ResourceLocked​
The specified operation is denied as your resource is locked for another operation.​
指定的操作被拒绝,因为您的资源已被其他操作锁定。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.08.27 19:18:31
这个页面对您有帮助吗?
有用
有用
无用
无用