Performing Operations on Instances in Batches

Scenario

Precautions

Involved APIs

Procedure

  1. For details about token authentication, see Token Authentication.
  1. Send GET https://AS endpoint/autoscaling-api/v1/{tenant_id}/scaling_group to obtain AS groups. Use the ID of one of the AS groups as the URI parameter scaling_group_id for querying instances in an AS group. For the response parameters of the API used to query AS groups, see section Response Parameters for Querying AS Groups.
  2. Send GET https://AS endpoint/autoscaling-api/v1/{tenant_id}/scaling_group_instance/{scaling_group_id}/list to obtain instances of a specified AS group, such as instance_id_1 and instance_id_2. For the response parameters of the API used to query instances of an AS group, see section Response Parameters for Querying Instances in an AS Group.
  3. Send POST https://AS endpoint/autoscaling-api/v1/{tenant_id}/scaling_group_instance/{scaling_group_id}/action to remove instances from an AS group in batches. For detailed parameters, see section "Performing Operations on Instances in Batches" in the Auto Scaling API Reference.
    Specify the following parameters in the request body:
    {
        "action": "REMOVE",
        "instances_id": [
            "instance_id_1",
            "instance_id_2"
        ],
        "instance_delete": "yes"
    }