Purchases Elastic Compute Service (ECS) instances in the Enterprise Distributed Application Service (EDAS) console and adds the purchased ECS instances to the specified instance group of an application.

Limits

Assume that the auto scaling feature is configured and enabled for an application. When an auto scale-in is triggered for the application, the ECS instances that are purchased by calling this operation are removed first.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation only uses the common request header. For more information, see Common request parameters.

Request syntax

POST /pop/v5/scaling/scale_out HTTPS|HTTP

Request parameters

Parameter Type Position Required Example Description
AppId String Query Yes e370c17f-*****-3df0721a327

The ID of the application that you want to scale out. You can call the ListApplication operation to query the application ID. For more information, see ListApplication.

GroupId String Query Yes e37**********-33df0721a327

The ID of the application instance group that you want to scale out. You can call the ListDeployGroup operation to query the group ID. For more information, see ListDeployGroup.

ScalingNum Integer Query Yes 2

The number of instances for the scale-out.

TemplateId String Query No lt-****hy9s2

The ID of the ECS instance launch template. You can call the DescribeLaunchTemplates operation to query the launch template ID. For more information, see DescribeLaunchTemplates.

TemplateVersion String Query No -1

The version of the ECS instance launch template. You can call the DescribeLaunchTemplateVersions operation to query the launch template version. For more information, see DescribeLaunchTemplateVersions.

Note If you set this parameter to -1, the version of the default launch template is used.
ScalingPolicy String Query No release

The reclaim mode of the scaling group. Valid values:

  • recycle: The scaling group is set to Shutdown and Reclaim Mode.
  • release: The scaling group is set to Release Mode.

For more information about how to remove instances from a specified scaling group, see RemoveInstances.

TemplateInstanceId String Query No i-28wt4****

The ID of the existing ECS instance used for the scale-out. If this parameter is specified, the specification and configuration of the specified ECS instance are used as a template to purchase new instances.

ClusterId String Query No e37**********-33df0721a327

The ID of the cluster to which you want to add ECS instances. If the application and instance group for the scale-out are specified, this parameter is ignored.

InstanceChargeType String Query No PrePaid

The billing method of the instance. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go. This is the default value.
InstanceChargePeriodUnit String Query No Month

The unit of the subscription period. Valid values:

  • Week
  • Month. This is the default value.
InstanceChargePeriod Integer Query No 1

The duration of the subscription. The unit of the subscription period is specified by the InstanceChargePeriodUnit parameter. This parameter only takes effect when the InstanceChargeType parameter is set to PrePaid.

  • If the InstanceChargePeriodUnit parameter is set to Week, the valid values of the InstanceChargePeriod parameter are 1, 2, 3, and 4.
  • If the InstanceChargePeriodUnit parameter is set to Month, the valid values of the InstanceChargePeriod parameter are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.
AutoRenew Boolean Query No true

Specifies whether to enable auto-renewal. This parameter only takes effect when the InstanceChargeType parameter is set to PrePaid. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal. This is the default value.
AutoRenewPeriod Integer Query No 1

The auto-renewal period of the instance. Valid values:

  • If the InstanceChargePeriodUnit parameter is set to Week, the valid values of the AutoRenewPeriod parameter are 1, 2, and 3.
  • If the InstanceChargePeriodUnit parameter is set to Month, the valid values of the AutoRenewPeriod parameter are 1, 2, 3, 6, 12, 24, 36, 48, and 60.

Default value: 1.

Response parameters

Parameter Type Example Description
ChangeOrderId String e370c17f-*****-3df0721a327

The ID of the change record for the application scale-out.

Code Integer 200

The returned HTTP status code.

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

The IDs of the purchased ECS instances.

Message String success

The additional information.

RequestId String e370c17f-*****-3df0721a327

The ID of the request.

Examples

Sample requests

POST /pop/v5/scaling/scale_out HTTP/1.1
Common request parameters
{
"AppId": "e370c17f-*****-3df0721a327",
"GroupId": "e37**********-33df0721a327",
"ScalingNum": "2",
"TemplateInstanceId": "i-28wt4****"
}

Sample success responses

XML format

<Message>success</Message>
<RequestId>e370c17f-*****-3df0721a327</RequestId>
<ChangeOrderId>e370c17f-*****-3df0721a327</ChangeOrderId>
<InstanceIds>i-28wt4****</InstanceIds>
<InstanceIds>i-28wt4****</InstanceIds>
<Code>200</Code>

JSON format

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

Error codes

HttpCode Error code Error message Description
500 Edas.errorcode.PermissionDenied.message You are not authorized to perform the operation. The error message returned because you are not authorized to perform the operation.

For a list of error codes, visit the API Error Center.