• Auto Scaling

as
  1. Help Center
  2. Auto Scaling
  3. API Reference
  4. API
  5. AS Groups
  6. Querying AS Groups

Querying AS Groups

Function

This interface is used to query AS groups based on conditions you input. The results are displayed by page.

URI

GET /autoscaling-api/v1/{project_id}/scaling_group{?scaling_group_name,scaling_configuration_id,scaling_group_status,start_number,limit}

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_name

No

String

Specifies the AS group name.

scaling_configuration_id

No

String

Specifies the AS configuration ID. You can obtain its value from the API used to query AS configurations. For details, see Querying AS Configurations.

scaling_group_status

No

String

Specifies the AS group status. The value can be INSERVICE, PAUSED, ERROR, or DELETING.

start_number

No

Integer

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

limit

No

Integer

Specifies the number of query records. The default value is 20.

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 number of query records.

    limit

    Integer

    Specifies the number of query records.

    scaling_groups

    List data structure

    Specifies the scaling group list.

    Table 3 scaling_groups field data structure description

    Parameter

    Type

    Description

    scaling_group_name

    String

    Specifies the name of the AS group.

    scaling_group_id

    String

    Specifies the AS group ID.

    scaling_group_status

    String

    Specifies the status of the AS group.

    scaling_configuration_id

    String

    Specifies the AS configuration ID.

    scaling_configuration_name

    String

    Specifies the AS configuration name.

    current_instance_number

    Integer

    Specifies the number of current instances in the AS group.

    desire_instance_number

    Integer

    Specifies the expected number of instances in the AS group.

    min_instance_number

    Integer

    Specifies the minimum number of instances in the AS group.

    max_instance_number

    Integer

    Specifies the maximum number of instances in the AS group.

    cool_down_time

    Integer

    Specifies the cooldown period (s).

    lb_listener_id

    String

    Specifies the ID of a typical ELB listener. ELB listener IDs are separated using a comma (,).

    lbaas_listeners

    List data structure

    Specifies the information on an enhanced ELB.

    available_zones

    List<String>

    Specifies the AZ information.

    networks

    List data structure

    Specifies network information.

    security_groups

    List data structure

    Specifies the security group information.

    create_time

    String

    Specifies the time when an AS group was created. The time format complies with UTC.

    vpc_id

    String

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

    detail

    String

    Specifies details about the AS group.

    is_scaling

    Boolean

    Specifies the scaling flag of the AS group.

    health_periodic_audit_method

    String

    Specifies the health check method.

    health_periodic_audit_time

    Integer

    Specifies the health check interval.

    health_periodic_audit_grace_period

    Integer

    Specifies the grace period for health check.

    instance_terminate_policy

    String

    Specifies the instance removal policy.

    notifications

    List<String>

    Specifies the notification mode.

    EMAIL refers to notification by email.

    delete_publicip

    Boolean

    Specifies whether to delete the EIP bound to the ECS when deleting the ECS.

    cloud_location_id

    String

    This field is reserved.

    Table 4 lbaas_listeners field data structure description

    Parameter

    Type

    Description

    listener_id

    String

    Specifies the listener ID.

    pool_id

    String

    Specifies the backend ECS group ID.

    protocol_port

    Integer

    Specifies the backend protocol, which is the port on which a backend ECS listens for traffic.

    weight

    Integer

    Specifies the weight, which determines the portion of requests a backend ECS processes compared to other backend ECSs added to the same listener.

    Table 5 networks field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the network ID.

    Table 6 security_groups field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the security group ID.

  • Example response
    {
        "limit": 20,
        "scaling_groups": [
            {
                "networks": [
                    {
                        "id": " a8327883-6b07-4497-9c61-68d03ee193a "
                    }
                ],
                "detail": null,
                "scaling_group_name": "healthCheck",
                "scaling_group_id": "77a7a397-7d2f-4e79-9da9-6a35e2709150",
                "scaling_group_status": "INSERVICE",
                "scaling_configuration_id": "1d281494-6085-4579-b817-c1f813be835f",
                "scaling_configuration_name": "healthCheck",
                "current_instance_number": 0,
                "desire_instance_number": 1,
                "min_instance_number": 0,
                "max_instance_number": 500,
                "cool_down_time": 300,
                "lb_listener_id": "f06c0112570743b51c0e8fbe1f235bab",
                "security_groups": [
                    {
                        "id": "8a4b1d5b-0054-419f-84b1-5c8a59ebc829"
                    }
                ],
                "create_time": "2015-07-23T02:46:29Z",
                "vpc_id": "863ccae2-ee85-4d27-bc5b-3ba2a198a9e2",
                "health_periodic_audit_method": "ELB_AUDIT",
                "health_periodic_audit_time": 5,
                "health_periodic_audit_grace_period": 600,
                "instance_terminate_policy": "OLD_CONFIG_OLD_INSTANCE",
                "is_scaling": false,
                "delete_publicip": false,
                "notifications": [
                    "EMAIL"
                ]
              
            }
        ],
        "total_number": 1,
        "start_number": 0
    }

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.