• Auto Scaling

as
  1. Help Center
  2. Auto Scaling
  3. API Reference
  4. API
  5. Scaling Action Logs
  6. Querying Scaling Action Logs (V2)

Querying Scaling Action Logs (V2)

Function

This interface is used to query scaling action logs. The results are filtered based on the conditions you input and displayed by page.

URI

GET /autoscaling-api/v2/{project_id}/scaling_activity_log/{scaling_group_id}{?start_time,end_time,start_number,limit,type}

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.

start_time

No

String

Specifies the start time for querying scaling action logs. The format of the start time is yyyy-MM-ddThh:mm:ssZ.

end_time

No

String

Specifies the end time for querying scaling action logs. The format of the end time is yyyy-MM-ddThh:mm:ssZ.

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 value is 20 and the maximum value is 100.

type

No

String

Specifies the types of the scaling actions to be queried. Different types are separated by commas (,).

  • NORMAL: indicates a common scaling action.
  • MANNUAL_REMOVE: indicates manually removing instances from an AS group.
  • MANNUAL_DELETE: indicates manually removing instances from an AS group and deleting the instances
  • MANNUAL_ADD: indicates manually adding instances to an AS group.
  • ELB_CHECK_DELETE: indicates that instances are removed from an AS group and deleted based on the ELB health check result.
  • AUDIT_CHECK_DELETE: indicates that instances are removed from an AS group and deleted based on the OpenStack audit.
  • DIFF: indicates that the number of expected instances is different from the actual number of instances.
  • MODIFY_ELB: indicates the load balancer migration.

Request

  • Request parameters

    None

  • Example request

    None

Response

  • 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_activity_log

    List data structure

    Specifies the scaling action log list.

    Table 3 scaling_activity_log field data structure description

    Parameter

    Type

    Description

    status

    String

    Specifies the status of the scaling action.

    SUCCESS: indicates the scaling action is successfully performed.

    FAIL: indicates the action failed to be performed.

    DOING: indicates the scaling action is being performed.

    start_time

    String

    Specifies the start time of the scaling action. The time format must comply with UTC.

    end_time

    String

    Specifies the end time of the scaling action. The time format must comply with UTC.

    id

    String

    Specifies the scaling action log ID.

    instance_removed_list

    List<scaling_instance>

    Specifies the name list of the instances removed from the AS group after the scaling action is complete. The instance names are separated by commas (,).

    instance_deleted_list

    List<scaling_instance>

    Specifies the name list of the instances deleted from the AS group and deleted after the scaling action is complete. The instance names are separated by commas (,).

    instance_added_list

    List<scaling_instance>

    Specifies the name list of the instances added to the AS group after the scaling action is complete. The instance names are separated by commas (,).

    instance_failed_list

    List<scaling_instance>

    Specifies the ECSs for which the scaling action fails.

    scaling_value

    String

    Specifies the number of added or deleted instances during the scaling.

    description

    String

    Specifies the description of the scaling action.

    instance_value

    Integer

    Specifies the number of instances in the AS group.

    desire_value

    Integer

    Specifies the expected number of instances in the scaling action.

    lb_bind_success_list

    List<modify_lb>

    Specifies the load balancers that are successfully bound to the AS group.

    lb_bind_failed_list

    List<modify_lb>

    Specifies the load balancers that failed to be bound to the AS group.

    lb_unbind_success_list

    List<modify_lb>

    Specifies the load balancers that are successfully unbound from the AS group.

    lb_unbind_failed_list

    List<modify_lb>

    Specifies the load balancers that failed to be unbound from the AS group.

    type

    String

    Specifies the type of the scaling action.

    Table 4 scaling_instance field data structure description

    Parameter

    Type

    Description

    instance_name

    String

    Specifies the ECS name.

    instance_id

    String

    Specifies the ECS ID.

    failed_reason

    String

    Specifies the cause of the instance scaling failure.

    failed_details

    String

    Specifies details of the instance scaling failure.

    Table 5 modify_lb field data structure description

    Parameter

    Type

    Description

    lbaas_listener

    Dictionary data structure

    Specifies information about an enhanced load balancer.

    listener

    String

    Specifies information about a classic load balancer.

    failed_reason

    String

    Specifies the cause of a load balancer migration failure.

    failed_details

    String

    Specifies the details of a load balancer migration failure.

    Table 6 lbaas_listener 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 port, 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.

  • Example response
    {
        "limit": 20,
        "scaling_activity_log": [
        {
          "id": "8753a18c-931d-4cb8-8d49-6c99396af348",
          "instance_value": 0,
          "desire_value": 0,
          "scaling_value": 0,
          "start_time": "2018-11-22T13:46:20Z",
          "end_time": "2018-11-22T13:47:38Z",
          "status": "SUCCESS",
          "lb_bind_success_list": [
            {
              "lbaas_listener": {
                "weight": 1,
                "listener_id": null,
                "pool_id": "0f0a9dd8-2e1d-4432-8ca2-49adc75aa662",
                "protocol_port": 82
              }
            }
          ],
          "lb_bind_failed_list": [],
          "lb_unbind_success_list": [],
          "lb_unbind_failed_list": [],
          "type": "MODIFY_ELB"
        },
        {
          "id": "44152cf2-a005-4507-b6e9-66a2a64eff52",
          "instance_value": 0,
          "desire_value": 1,
          "scaling_value": 1,
          "start_time": "2018-11-22T13:44:22Z",
          "end_time": "2018-11-22T13:46:02Z",
          "instance_added_list": [
            {
              "instance_id": "8e273bac-d303-46dc-9883-628be2294bdf",
              "instance_name": "as-config-t66a_9W8L9SSK"
            }
          ],
          "instance_deleted_list": [],
          "instance_removed_list": [],
          "instance_failed_list": [],
          "status": "SUCCESS",
          "description": "{\"reason\":[{\"change_reason\":\"MANNUAL\",\"old_value\":0,\"change_time\":\"2018-11-22T13:44:19Z\",\"new_value\":1}]}",
          "type": "NORMAL"
        }
    ],
        "total_number": 2,
        "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 Error Codes.