• Auto Scaling

as
  1. Help Center
  2. Auto Scaling
  3. API Reference
  4. API
  5. Instances in an AS Group
  6. Querying Instances in an AS Group

Querying Instances in an AS Group

Function

This interface is used to query information about instances in an AS group. The results are filtered based on the conditions you input and displayed by page.

URI

GET /autoscaling-api/v1/{project_id}/scaling_group_instance/{scaling_group_id}/list{?life_cycle_state,health_status,start_number,limit,protect_from_scaling_down}

NOTE:

You can type the question mark (?) and ampersand (&) at the end of the URI to define multiple search criteria. You can filter all non-mandatory parameters in the parameter description.

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.

life_cycle_state

No

String

Specifies the instance lifecycle status in the AS group.

  • INSERVICE: The instance in the AS group is in use.
  • PENDING: The instance is being added to the AS group.
  • REMOVING: The instance is being removed from the AS group.

health_status

No

String

Specifies the instance health status.

  • INITIALIZING: The instance is initializing.
  • NORMAL: The instance is normal.
  • ERROR: The instance is abnormal.

protect_from_scaling_down

No

String

Specifies the instance protection status.

  • true: Instance protection is enabled.
  • false: Instance protection is disabled.

start_number

No

Integer

Specifies the start line number. The default value is 0.

limit

No

Integer

Specifies the total number of query records. The default is 20 and the maximum is 100.

Request Message

  • Request parameters

    None

  • Example request

    None

Response Message

  • Response parameters
    Table 2 Response parameters

    Parameter

    Type

    Description

    total_number

    Integer

    Specifies the total number of query records.

    start_number

    Integer

    Specifies the start line number.

    limit

    Integer

    Specifies the maximum number of resources to be queried.

    scaling_group_instances

    List data structure

    Specifies details about the instances in the AS group.

    Table 3 scaling_group_instances field data structure description

    Parameter

    Type

    Description

    instance_id

    String

    Specifies the instance ID.

    instance_name

    String

    Specifies the instance name.

    scaling_group_id

    String

    Specifies the ID of the AS group to which the instance belongs.

    scaling_group_name

    String

    Specifies the name of the AS group to which the instance belongs.

    life_cycle_state

    String

    Specifies the instance lifecycle status in the AS group.

    • INSERVICE: The instance in the AS group is in use.
    • PENDING: The instance is being added to the AS group.
    • REMOVING: The instance is being removed from the AS group.

    health_status

    String

    Specifies the instance health status.

    The value can be INITAILIZING, NORMAL, and ERROR.

    scaling_configuration_name

    String

    Specifies the AS configuration name.

    scaling_configuration_id

    String

    Specifies the AS configuration ID. If no information is displayed, the instance is manually added to the AS group.

    create_time

    String

    Specifies the time when the instance is added to the AS group. The time format complies with UTC.

    protect_from_scaling_down

    Boolean

    Specifies the instance protection status.

  • Example response
    {
        "limit": 10,
        "total_number": 1,
        "start_number": 0,
        "scaling_group_instances": [
            {
                "instance_id": "b25c1589-c96c-465b-9fef-d06540d1945c",
                "scaling_group_id": "e5d27f5c-dd76-4a61-b4bc-a67c5686719a",
                "scaling_group_name": "discuz",
                "life_cycle_state": "INSERVICE",
                "health_status": "NORMAL",
                "scaling_configuration_name": "discuz",
                "scaling_configuration_id": "ca3dcd84-d197-4c4f-af2a-cf8ba39696ac",
                "create_time": "2015-07-23T06:47:33Z",
                "instance_name": "discuz_3D210808",
                "protect_from_scaling_down": false
            }
        ]
    }

Returned Value

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter the username and password to access the requested page.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The server could not find the requested page.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication so that the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the request is invalid.

    503 Service Unavailable

    Failed to complete the request because the system is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.

Error Codes

See section Error Codes.