Querying AS Groups
Function
This API is used to list AS groups based on search criteria. The results are displayed by page.
- Search criteria can be the AS group name, AS configuration ID, AS group status, enterprise project ID, start line number, and number of records.
- If no search criteria are specified, a maximum of 20 AS groups can be listed by default.
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:scalingGroup:list
list
-
as:groups:list
-
URI
GET /autoscaling-api/v1/{project_id}/scaling_group
You can type the question mark (?) and ampersand (&) at the end of the URI to define multiple search criteria. AS groups can be searched by all optional parameters in the following table. For details, see the example request.
| 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_group_name | No | String | Definition Specifies the AS group name. Fuzzy match is supported. Constraints N/A Range It contains 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Default Value N/A |
| scaling_configuration_id | No | String | Definition Specifies the AS configuration ID, which can be obtained using the API for listing AS configurations. For details, see Querying AS Configurations. Constraints N/A Range N/A Default Value N/A |
| scaling_group_status | No | String | Definition Specifies the AS group status. Constraints N/A Range The value can be:
Default Value N/A |
| start_number | No | Integer | Definition Specifies the start line number. Constraints N/A Range The minimum value is 0, and there is no limit on the maximum value. Default Value 0 |
| limit | No | Integer | Definition Specifies the number of records to be returned. Constraints N/A Range 0–100 Default Value 20 |
| enterprise_project_id | No | String | Definition Specifies the enterprise project ID. If all_granted_eps is specified, AS groups in all enterprise projects you have permissions to are listed. For how to obtain an enterprise project ID, see Listing Enterprise Projects. NOTE: An account of Huawei Cloud and its IAM users assigned with global permissions can view all the AS groups in the account. If an IAM user is assigned with permissions to more than 100 enterprise projects, the user can only view the AS groups in the first 100 enterprise projects. Constraints If an enterprise project is configured for an AS group, ECSs created in this AS group also belong to this enterprise project. Otherwise, the default enterprise project is used. Range
Default Value N/A |
Request
None
Example Request
GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group?scaling_group_name=as-group-test&scaling_configuration_id=1d281494-6085-4579-b817-c1f813be835f Response
| Parameter | Type | Description |
|---|---|---|
| total_number | Integer | Definition Specifies the total number of query records. Range N/A |
| start_number | Integer | Definition Specifies the start number of query records. Range The minimum value is 0, and there is no limit on the maximum value. |
| limit | Integer | Definition Specifies the number of query records. Range N/A |
| scaling_groups | Array of scaling_groups objects | Definition Specifies the AS group list. |
| Parameter | Type | Description |
|---|---|---|
| scaling_group_name | String | Definition Specifies the AS group name. Range It contains 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| scaling_group_id | String | Definition Specifies the AS group ID. Range N/A |
| scaling_group_status | String | Definition Specifies the AS group status. Range The value can be:
|
| scaling_configuration_id | String | Definition Specifies the AS configuration ID. Range N/A |
| scaling_configuration_name | String | Definition Specifies the AS configuration name. Range The value can contain 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| current_instance_number | Integer | Definition Specifies the number of current instances in the AS group. Range N/A |
| desire_instance_number | Integer | Definition Specifies the expected number of instances in the AS group. Range N/A |
| min_instance_number | Integer | Definition Specifies the minimum number of instances in the AS group. Range N/A |
| max_instance_number | Integer | Definition Specifies the maximum number of instances in the AS group. Range An integer from 0 to 300 |
| cool_down_time | Integer | Definition Specifies the cooldown period, in seconds. Range 0s to 86,400s |
| lb_listener_id | String | Definition Specifies the ID of a typical ELB listener. ELB listener IDs are separated using a comma (,). Range N/A |
| lbaas_listeners | Array of lbaas_listeners objects | Definition Specifies enhanced load balancers. For details, see Table 4. |
| available_zones | Array of strings | Definition Specifies AZ information. The ECSs added in a scaling action will be created in a specified AZ. If you do not specify an AZ, the system automatically specifies one. For details, see Regions and Endpoints. You can change the AZ of an AS group only when no scaling action is being performed in the group. |
| networks | Array of networks objects | Definition Specifies network information. For details, see Table 5. |
| security_groups | Array of security_groups objects | Definition Specifies security group information. For details, see Table 8. |
| create_time | String | Definition Specifies the time when an AS group was created. The time format complies with UTC. Range N/A |
| vpc_id | String | Definition Specifies the ID of the VPC that the AS group belongs to. Range N/A |
| detail | String | Definition Specifies details about the AS group. If a scaling action fails, this parameter is used to record errors. Range N/A |
| is_scaling | Boolean | Definition Specifies the scaling flag of the AS group. Range
|
| health_periodic_audit_method | String | Definition Specifies the health check method. Range ELB_AUDIT and NOVA_AUDIT
|
| health_periodic_audit_time | Integer | Definition Specifies the health check interval, in minutes. Range The value can be 1, 5, 15, 60, or 180 minutes. If the value is set to 0, health check can be performed every 10 seconds. |
| health_periodic_audit_grace_period | Integer | Definition Specifies the grace period for health check, in seconds. Range 0s to 86,400s |
| instance_terminate_policy | String | Definition Specifies the instance removal policy. Range
|
| delete_publicip | Boolean | Definition Specifies whether to delete the EIP bound to the ECS when deleting the ECS. Range
|
| delete_volume | Boolean | Definition Specifies whether to delete the data disks attached to the ECS when deleting the ECS. Range
|
| cloud_location_id | String | Definition Specifies the cloud location that the AS group belongs to. This parameter is reserved. Range N/A |
| enterprise_project_id | String | Definition Specifies the enterprise project ID. Range N/A |
| activity_type | String | Definition Specifies the type of the AS action. Range
|
| multi_az_priority_policy | String | Definition Specifies the priority policy used to select target AZs when adjusting the number of instances in an AS group. Range
|
| description | String | Definition Specifies the description of the AS group. Range 1 to 256 characters, with no restrictions on character types |
| iam_agency_name | String | Definition Specifies the agency name. An agency is created by a tenant administrator in Identity and Access Management (IAM) to provide temporary credentials for the ECS service to access other cloud services. Range 1 to 64 characters, with no restrictions on character types |
| tags | Array of tags objects | Definition Specifies the tags added to the AS group. For details, see Table 9. |
| Parameter | Type | Description |
|---|---|---|
| listener_id | String | Definition Specifies the listener ID. Range N/A |
| pool_id | String | Definition Specifies the backend server group ID. For details about how to obtain it, see Querying Backend Server Groups. Range N/A |
| protocol_port | Integer | Definition Specifies the backend protocol port, that is, the port that backend ECSs listen on. Range [1, 65535] |
| weight | Integer | Definition Specifies the weight, which determines the portion of requests a backend ECS processes when being compared to other backend ECSs added to the same listener. Range [0, 100] |
| protocol_version | String | Definition Specifies the version of IP addresses used by the backend server group with load balancing configured. Range
|
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Specifies the subnet ID. Range N/A |
| ipv6_enable | Boolean | Definition Whether to enable IPv6. Range
|
| ipv6_bandwidth | ipv6_bandwidth object | Definition Specifies the shared bandwidth of an IPv6 address. This parameter is left blank by default, indicating that no IPv6 shared bandwidth is bound. This parameter is reserved. For details, see Table 6. |
| allowed_address_pairs | Array of allowed_address_pairs objects | Definition Specifies whether to enable source/destination check. For details, see Table 7. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Specifies the ID of the shared bandwidth of an IPv6 address. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| ip_address | String | Definition Specifies whether to enable source/destination check for IP addresses. Source/destination check is enabled by default. This parameter cannot be left blank. Range
|
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Specifies the security group ID. Range N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition Specifies the tag key. Range
|
| value | No | String | Definition Specifies the tag value. Range
|
Example Response
{
"limit": 20,
"scaling_groups": [
{
"networks": [
{
"id": "a8327883-6b07-4497-9c61-68d03ee193a",
"ipv6_enable": true,
"ipv6_bandwidth":
{
"id": "076ee2ff-f23e-4338-b8ac-1bc7278532d5"
}
}
],
"available_zones": [
"XXXa",
"XXXb"
],
"detail": null,
"scaling_group_name": "as-group-test",
"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": 100,
"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,
"enterprise_project_id": "c92b1a5d-6f20-43f2-b1b7-7ce35e58e413",
"multi_az_priority_policy": "PICK_FIRST",
"iam_agency_name":"test"
}
],
"total_number": 1,
"start_number": 0
} Returned Values
- Normal
- 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.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot