ScaleoutApplicationWithNewInstances - 代购实例并扩容到指定分组

更新时间:
复制 MD 格式

在EDAS中代购ECS实例,并将代购的实例扩容到指定的应用分组。

接口说明

限制说明

若应用配置并开启了弹性伸缩规则,在触发自动缩容时将优先移除此接口代购的实例。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

POST /pop/v5/scaling/scale_out HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

AppId

string

否

扩容的目标应用 ID,可通过调用 ListApplication 接口来获取,详情请参见 ListApplication 。

e370c17f-*****-3df0721a327

GroupId

string

否

扩容应用的目标分组 ID,可通过调用 ListDeployGroup 接口来获取,详情请参见 ListDeployGroup 。

e37**********-33df0721a327

ScalingNum

integer

是

此次扩容的实例数量。

2

TemplateId

string

否

ECS 启动模板 ID,可通过调用 DescribeLaunchTemplates 接口获取,详情请参见 DescribeLaunchTemplates 。

lt-****hy9s2

TemplateVersion

string

否

ECS 启动模板版本,可通过调用 DescribeLaunchTemplateVersions 接口获取,详情请参见 DescribeLaunchTemplateVersions 。

说明

设置为-1代表使用默认的启动模板版本。

-1

ScalingPolicy

string

否

指定伸缩组的回收模式,取值范围:

  • recycle:伸缩组的回收模式为停机回收模式。

  • release:伸缩组的回收模式为释放模式。

从一个伸缩组删除实例,详情请参见 RemoveInstances 。

release

TemplateInstanceId

string

否

扩容时使用的现有 ECS 实例 ID,若填写此项,将以指定的 ECS 实例的规格和配置为模板来购买新的 ECS 实例。

i-28wt4****

ClusterId

string

否

扩容的集群 ID,若指定了应用和分组进行扩容,此参数将被忽略。

e37**********-33df0721a327

InstanceChargeType

string

否

实例的付费方式。取值范围:

  • PrePaid:包年包月。

  • PostPaid(默认):按量付费。

PrePaid

InstanceChargePeriodUnit

string

否

包年包月计费方式的时长单位。取值范围:

  • Week:按周计费。

  • Month(默认):按月计费。

Month

InstanceChargePeriod

integer

否

购买资源的时长,单位由 InstanceChargePeriodUnit 指定。当参数 InstanceChargeType 取值为 PrePaid 时才生效。

  • InstanceChargePeriodUnit=Week 时,Period 取值:{“1”, “2”, “3”, “4”}。

  • InstanceChargePeriodUnit=Month 时,Period 取值:{“1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”, “12”, “24”, “36”, ”48”, ”60”}。

1

AutoRenew

boolean

否

是否要自动续费。当参数 InstanceChargeType 取值 PrePaid 时才生效。取值范围:

  • true:自动续费。

  • false(默认):不自动续费。

true

AutoRenewPeriod

integer

否

单次自动续费的续费时长。取值范围:

  • InstanceChargePeriodUnit=Week 时:{“1”, “2”, “3”}。

  • InstanceChargePeriodUnit=Month 时:{“1”, “2”, “3”, “6”, “12”, "24", "36", "48", "60"}。

默认值:1。

1

返回参数

名称

类型

描述

示例值

object

接口响应。

ChangeOrderId

string

应用扩容的变更记录 ID。

e370c17f-*****-3df0721a327

Code

integer

接口状态或 POP 错误码。

200

Message

string

附加消息。

success

RequestId

string

请求 ID。

e370c17f-*****-3df0721a327

InstanceIds

array

ECS 实例 ID 列表。

string

代购产生的 ECS 实例列表。

["i-28wt4****","i-28wt4****"]

示例

正常返回示例

JSON格式

{
  "ChangeOrderId": "e370c17f-*****-3df0721a327",
  "Code": 200,
  "Message": "success",
  "RequestId": "e370c17f-*****-3df0721a327",
  "InstanceIds": [
    "[\"i-28wt4****\",\"i-28wt4****\"]"
  ]
}

错误码

HTTP status code

错误码

错误信息

描述

500 Edas.errorcode.PermissionDenied.message You are not authorized to perform the operation. 无权限操作

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。