Updated on 2026-10-13 GMT+08:00

Querying an AS Policy

Function

This API is used to query details about a specified AS policy by policy ID.

Authorization

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    as:scalingPolicy:get

    read

    scalingPolicy*

    g:EnterpriseProjectId

    as:policies:get

    -

URI

GET /autoscaling-api/v1/{project_id}/scaling_policy/{scaling_policy_id}

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Specifies the project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

scaling_policy_id

Yes

String

Definition

Specifies the AS policy ID. For details about how to obtain it, see Querying AS Policies Bound to an AS Group.

Constraints

N/A

Range

N/A

Default Value

N/A

Request

None

Example Request

This example queries the details about the AS policy with ID fd7d63ce-8f5c-443e-b9a0-bef9386b23b3.

GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_policy/fd7d63ce-8f5c-443e-b9a0-bef9386b23b3

Response

Table 2 Response parameters

Parameter

Type

Description

scaling_policy

scaling_policy object

Definition

Specifies details about the AS policy. For details, see Table 3.

Table 3 scaling_policy field description

Parameter

Type

Description

scaling_group_id

String

Definition

Specifies the AS group ID, which can be obtained using the API for querying AS groups. For details, see Querying AS Groups.

Range

N/A

scaling_policy_name

String

Definition

Specifies the AS policy name.

Fuzzy match is supported.

Range

The value can contain 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

scaling_policy_id

String

Definition

Specifies the AS policy ID.

Range

N/A

policy_status

String

Definition

Specifies the AS policy status.

Range

  • INSERVICE: The AS policy is enabled.
  • PAUSED: The AS policy is disabled.
  • EXECUTING: The AS policy is being executed.

scaling_policy_type

String

Definition

Specifies the AS policy type.

Range

  • ALARM: indicates that the scaling action is triggered by an alarm. A value is returned for alarm_id, and no value is returned for scheduled_policy.
  • SCHEDULED: indicates that the scaling action is triggered as scheduled. A value is returned for scheduled_policy, and no value is returned for alarm_id, recurrence_type, recurrence_value, start_time, or end_time.
  • RECURRENCE: indicates that the scaling action is triggered periodically. Values are returned for scheduled_policy, recurrence_type, recurrence_value, start_time, and end_time, and no value is returned for alarm_id.

alarm_id

String

Definition

Specifies the alarm ID.

Range

N/A

scheduled_policy

scheduled_policy object

Definition

Specifies the periodic or scheduled AS policy. For details, see Table 4.

scaling_policy_action

scaling_policy_action object

Definition

Specifies the scaling action of the AS policy. For details, see Table 5.

cool_down_time

Integer

Definition

Specifies the cooldown period, in seconds.

Range

0s to 86,400s

create_time

String

Definition

Specifies the time when an AS policy was created. The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ, for example, 2015-07-24T01:09:30Z.

Range

N/A

Table 4 scheduled_policy field description

Parameter

Type

Description

launch_time

String

Definition

Specifies the time when the scaling action is triggered. The time format complies with UTC.

  • If scaling_policy_type is set to SCHEDULED, the time format is YYYY-MM-DDThh:mmZ.
  • If scaling_policy_type is set to RECURRENCE, the time format is hh:mm.

Range

N/A

recurrence_type

String

Definition

Specifies the type of a periodically triggered scaling action.

Range

  • Daily: The scaling action is triggered once a day.
  • Weekly: The scaling action is triggered once a week.
  • Monthly: The scaling action is triggered once a month.

recurrence_value

String

Definition

Specifies the day when a periodic scaling action is triggered.

Range

  • If recurrence_type is set to Daily, the value is null, indicating that the scaling action is triggered once a day.
  • If recurrence_type is set to Weekly, the value ranges from 1 (Sunday) to 7 (Saturday). The digits refer to dates in each week and separated by a comma, such as 1,3,5.
  • If recurrence_type is set to Monthly, the value ranges from 1 to 31. The digits refer to the dates in each month and separated by a comma, such as 1,10,13,28.

start_time

String

Definition

Specifies the start time of the scaling action triggered periodically. The time format complies with UTC.

The time format is YYYY-MM-DDThh:mmZ.

Range

N/A

end_time

String

Definition

Specifies the end time of the scaling action triggered periodically. The time format complies with UTC.

The time format is YYYY-MM-DDThh:mmZ.

Range

N/A

Table 5 scaling_policy_action field description

Parameter

Type

Description

operation

String

Definition

Specifies the operation to be performed.

Range

  • If scaling_resource_type is set to SCALING_GROUP, the following operations are supported:
    • ADD: adds instances to the AS group.
    • REMOVE/REDUCE: removes or reduces instances from the AS group.
    • SET: sets the number of instances in the AS group.
  • If scaling_resource_type is set to BANDWIDTH, the following operations are supported:
    • ADD: increases the bandwidth.
    • REDUCE: decreases the bandwidth.
    • SET: sets the bandwidth to a fixed value.

instance_number

Integer

Definition

Specifies the number of instances to be operated.

Range

  • If operation is set to SET, the value ranges from 0 to 300.
  • If operation is set to ADD, REMOVE, or REDUCE, the value ranges from 1 to 300.

instance_percentage

Integer

Definition

Specifies the percentage of instances to be operated.

Range

  • If operation is set to ADD, REMOVE, or REDUCE, the value is an integer ranging from 1 to 20000.
  • If operation is set to SET, the value is an integer ranging from 0 to 20000.

Example Response

{
    "scaling_policy": {
        "scaling_policy_id": "fd7d63ce-8f5c-443e-b9a0-bef9386b23b3",
        "scaling_group_id": "e5d27f5c-dd76-4a61-b4bc-a67c5686719a",
"scaling_policy_name": "Scheduled 1",
        "scaling_policy_type": "SCHEDULED",
        "scheduled_policy": {
            "launch_time": "2015-07-24T01:21Z"
        },
        "cool_down_time": 300,
        "scaling_policy_action": {
            "operation": "REMOVE",
            "instance_number": 1
        },
        "policy_status": "INSERVICE",
        "create_time": "2015-07-24T01:09:30Z"
    }
}

Returned Values

  • 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 to process the request.

    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.