Modifying an AS Group
Function
This API is used to modify a specified AS group.
- When the AS configuration of an AS group is changed, the existing instances created using the original AS configuration are not affected.
- If no scaling action is being performed, you can modify its subnet, ELB, and AZ configurations.
- Changing the number of expected instances in an AS group will trigger a scaling action to add or remove instances to or from the AS group. The number of expected instances must be greater than or equal to the minimum number of instances and less than or equal to the maximum number of instances.
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:update
write
-
as:groups:update
-
URI
PUT /autoscaling-api/v1/{project_id}/scaling_group/{scaling_group_id}
| 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_id | Yes | String | Definition Specifies the AS group ID. For details about how to obtain it, see Querying AS Groups. Constraints N/A Range N/A Default Value N/A |
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| scaling_group_name | No | String | Definition Specifies the AS group name. Constraints N/A Range It contains 1 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Default Value N/A |
| desire_instance_number | No | Integer | Definition Specifies the expected number of instances. Constraints Minimum number of instances ≤ Expected number of instances ≤ Maximum number of instances Range N/A Default Value N/A |
| min_instance_number | No | Integer | Definition Specifies the minimum number of instances. Constraints N/A Range N/A Default Value N/A |
| max_instance_number | No | Integer | Definition Specifies the maximum number of instances. Constraints The value must be greater than or equal to the minimum number of instances. Range An integer from 0 to 300 Default Value 1 |
| cool_down_time | No | Integer | Definition Specifies the cooldown period, in seconds. Constraints During the cooldown period, AS denies all scaling requests triggered by alarm-based policies. Scaling requests triggered manually or by scheduled or periodic policies are not affected. Range 0s to 86,400s Default Value 300 |
| available_zones | No | Array of strings | Definition Specifies the AZ ID. 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. Constraints AZ information can be modified only when all the following conditions are met:
|
| networks | No | Array of networks objects | Definition Specifies network information. The first subnet you specify is where ECS primary NICs are created by default. That is, the NIC associated with the first subnet is the primary NIC. Other subnets are for ECS extended NICs. For details about how to obtain subnet information, see Querying Subnets. For details about the data structure, see Table 4. Constraints
|
| security_groups | No | Array of security_groups objects | Definition Specifies security group information. A maximum of one security group can be selected. For how to obtain security group information, see Querying Security Groups. For information about the data structure, see Table 7. Constraints
|
| lb_listener_id | No | String | Definition Specifies the load balancer listener ID. For details about how to obtain the listener ID, see Querying Load Balancers. Constraints
Range N/A Default Value N/A |
| lbaas_listeners | No | Array of lbaas_listeners objects | Definition Specifies load balancers. This parameter is in list data structure. For details, see Table 3. For how to obtain information about an enhanced load balancer, see Querying Backend Server Groups. Constraints A maximum of six load balancers can be added. |
| health_periodic_audit_method | No | String | Definition Specifies the health check method for instances in the AS group. Constraints If ELB is not configured for an AS group, the ELB_AUDIT method cannot be used. Range
Default Value When load balancing is configured for an AS group, the default value is ELB_AUDIT. Otherwise, the default value is NOVA_AUDIT. |
| health_periodic_audit_time | No | Integer | Definition Specifies the health check interval, in minutes. Constraints N/A 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. Default Value 5 minutes |
| instance_terminate_policy | No | String | Definition Specifies the instance removal policy. Constraints N/A Range
Default Value OLD_CONFIG_OLD_INSTANCE: The earlier-created instances based on the earlier-created AS configurations are removed first. |
| health_periodic_audit_grace_period | No | Integer | Definition Specifies the health check grace period, in seconds. Constraints
Range 0s to 86,400s Default Value 600 |
| scaling_configuration_id | No | String | Definition Specifies the AS configuration ID, which can be obtained using the API for querying AS configurations. For details, see Querying AS Configurations. Constraints N/A Range N/A Default Value N/A |
| delete_publicip | No | Boolean | Definition Specifies whether to delete the EIP bound to the ECS when deleting the ECS. If you do not want to delete the EIP, set this parameter to false. Then, the system only unbinds the EIP from the ECS and reserves the EIP. Constraints If an EIP is billed on a yearly/monthly basis, it will not be deleted when an ECS is removed. Range
Default Value false |
| delete_volume | No | Boolean | Definition Specifies whether to delete the data disks attached to the ECS when deleting the ECS. Constraints If a data disk is billed on a yearly/monthly basis, it will not be deleted when an ECS is removed. Range
Default Value false |
| enterprise_project_id | No | String | Definition Specifies the enterprise project ID, which is used to specify the enterprise project to which the AS group belongs. For details about enterprise project features, see Enterprise Project Management Service. 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 |
| multi_az_priority_policy | No | String | Definition Specifies the priority policy used to select target AZs when adjusting the number of instances in an AS group. Constraints This parameter is required only when two or more AZs are selected. Range
Default Value EQUILIBRIUM_DISTRIBUTE |
| description | No | String | Definition Specifies the description of the AS group. Constraints N/A Range 1 to 256 characters, with no restrictions on character types Default Value N/A |
| iam_agency_name | No | 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. Constraints
Range 1 to 64 characters, with no restrictions on character types Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| pool_id | Yes | String | Definition Specifies the backend server group ID. For details about how to obtain it, see Querying Backend Server Groups. Constraints The value of this parameter can be changed only when all the following conditions are met:
Range N/A Default Value N/A |
| protocol_port | Yes | Integer | Definition Specifies the backend protocol port, that is, the port that backend ECSs listen on. Constraints N/A Range [1, 65535] Default Value N/A |
| weight | Yes | 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. Constraints If lb_algorithm is set to SOURCE_IP or QUIC_CID, this field is invalid. Range [0, 100] Default Value N/A |
| protocol_version | No | String | Definition Specifies the version of IP addresses used by the backend server group with load balancing configured. Constraints
Range
Default Value ipv4 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Definition Specifies the subnet ID. For details about how to obtain it, see Querying Subnets. Constraints N/A Range N/A Default Value N/A |
| ipv6_enable | No | Boolean | Definition Whether to enable IPv6. Constraints The subnet must support IPv6. Range
Default Value false |
| ipv6_bandwidth | No | ipv6_bandwidth object | Definition Specifies the IPv6 shared bandwidth. This parameter is left blank by default, indicating that no shared IPv6 bandwidth is bound. For details, see Table 5. Constraints N/A |
| allowed_address_pairs | No | Array of allowed_address_pairs objects | Definition Specifies whether to enable source/destination check. For details, see Table 6. Constraints N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Definition Specifies the ID of the IPv6 shared bandwidth. For details about how to obtain it, see Querying Shared Bandwidth Types of a Specified Tenant. Constraints N/A Range N/A Default Value N/A |
| Parameter | Type | Description |
|---|---|---|
| ip_address | String | Definition Specifies whether to enable source/destination check for IP addresses. Constraints N/A Range
Default Value This function is enabled by default. This parameter cannot be left blank. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | Yes | String | Definition Specifies the security group ID. For details about how to obtain it, see Querying Security Groups. Constraints N/A Range N/A Default Value N/A |
Example Request
PUT https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group/a8327883-6b07-4497-9c61-68d03ee193a1
{
"scaling_group_name": "group_1",
"scaling_configuration_id": "f8327883-6a07-4497-9a61-68c03e8e72a2",
"enterprise_project_id": "c92b1a5d-6f20-43f2-b1b7-7ce35e58e413",
"desire_instance_number": 1,
"min_instance_number": 1,
"max_instance_number": 3,
"cool_down_time": 200,
"iam_agency_name": "test",
"multi_az_priority_policy": "PICK_FIRST"
} Response
| Parameter | Type | Description |
|---|---|---|
| scaling_group_id | String | Definition Specifies the AS group ID. Range N/A |
Example Response
{
"scaling_group_id": "a8327883-6b07-4497-9c61-68d03ee193a1"
} 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