Batch Managing Instances

Function

  • A batch operation can be performed on a maximum of 10 instances at a time. After instances are added to an AS group, the number of instances in the AS group cannot be greater than the maximum number of instances. After instances are removed from an AS group, the number of instances in the AS group cannot be less than the minimum number of instances.
  • Instances can be added to an AS group only when the AS group is in the INSERVICE state and has no scaling action in progress.
  • You can remove instances from an AS group only when no scaling action is in progress.
  • To add instances to an AS group, ensure that the AZ of the instances falls within that of the AS group.
  • Only instances in INSERVICE state can be removed from an AS group. Instance protection can be enabled or disabled only for INSERVICE instances.
  • When the capacity of an AS group is automatically decreased, the instances with instance protection enabled will not be removed from the AS group.
  • If the listener bound to the instance to be removed is the same as the listener in the AS group, the listener will be unbound from the instance. If the listener bound to the instance to be removed is different from the listener in the AS group, the binding relationship between the listener and instance will be reserved.

URI

POST /autoscaling-api/v1/{project_id}/scaling_group_instance/{scaling_group_id}/action

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

scaling_group_id

Yes

String

Specifies the AS group ID.

Request

Table 2 Request parameters

Parameter

Mandatory

Type

Description

instances_id

Yes

Array of strings

Specifies the ECS ID.

instance_delete

No

String

Specifies whether to delete an instance when it is removed from an AS group.

Options:

  • no (default): The instance will not be deleted.
  • yes: The instance will be deleted.

    If the instances were manually added to an AS group, they are removed from the AS group but are not deleted.

This parameter takes effect only when the action is set to REMOVE.

action

Yes

String

Specifies an action to be performed on instances in batches. The options are as follows:

  • ADD: adds instances to the AS group.
  • REMOVE: removes instances from the AS group.
  • PROTECT: enables instance protection.
  • UNPROTECT: disables instance protection.

Example Request

Response

None

Example Response

None

Returned Values

Error Codes

See Error Codes.