Querying Instance Suspension

Function

After a lifecycle hook is added, when an AS group performs a scaling action, the lifecycle hook suspends the target instance and sets it to be in waiting state. You can query the instance suspension based on search criteria.

URI

GET /autoscaling-api/v1/{project_id}/scaling_instance_hook/{scaling_group_id}/list

You can type the question mark (?) and ampersand (&) at the end of the URI to define multiple search criteria. Instance suspension can be searched by all optional parameters in the following table. For details, see the example request.

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.

instance_id

No

String

Specifies the AS instance ID.

Request

None

Example Request

This example queries the suspension of the instance with ID b25c1589-c96c-465b-9fef-d06540d1945c in the AS group with ID e5d27f5c-dd76-4a61-b4bc-a67c5686719a.
GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_instance_hook/e5d27f5c-dd76-4a61-b4bc-a67c5686719a/list?instance_id=b25c1589-c96c-465b-9fef-d06540d1945c

Response

Table 2 Response parameters

Parameter

Type

Description

instance_hanging_info

Array of instance_hanging_info objects

Specifies lifecycle hook information about an AS instance.

Table 3 instance_hanging_info field description

Parameter

Type

Description

lifecycle_hook_name

String

Specifies the lifecycle hook name.

lifecycle_action_key

String

Specifies the lifecycle action key, which determines the lifecycle callback object.

instance_id

String

Specifies the AS instance ID.

scaling_group_id

String

Specifies the AS group ID.

lifecycle_hook_status

String

Specifies the lifecycle hook status.

  • HANGING: suspends the instance.
  • CONTINUE: continues the instance.
  • ABANDON: terminates the instance.

timeout

String

Specifies the timeout duration in the format of "YYYY-MM-DDThh:mm:ssZ". The time is UTC-compliant.

default_result

String

Specifies the default lifecycle hook callback operation.

Example Response

{
    "instance_hanging_info": [
        {
            "instance_id": "b25c1589-c96c-465b-9fef-d06540d1945c",
            "scaling_group_id": "e5d27f5c-dd76-4a61-b4bc-a67c5686719a",
            "lifecycle_hook_name": "hook-test",
            "lifecycle_action_key": "6ebe6e72-4b09-4adb-ae4a-a91dc0560069",
            "default_result": "ABANDON",
            "timeout": "2016-11-15T06:43:41Z",
            "lifecycle_hook_status": "HANGING"
        }
    ]
}

Returned Values

Error Codes

See Error Codes.