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 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.
URI
PUT /autoscaling-api/v1/{project_id}/scaling_group/{scaling_group_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
scaling_group_id |
Yes |
String |
Specifies the AS group ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
scaling_group_name |
No |
String |
Specifies the AS group name. The name contains only letters, digits, underscores (_), and hyphens (-), and cannot exceed 64 characters. |
desire_instance_number |
No |
Integer |
Specifies the expected number of instances. The value ranges from the minimum number of instances to the maximum number of instances. |
min_instance_number |
No |
Integer |
Specifies the minimum number of instances. |
max_instance_number |
No |
Integer |
Specifies the maximum number of instances, which is greater than or equal to the minimum number of instances. |
cool_down_time |
No |
Integer |
Specifies the cooldown period (in seconds). The value ranges from 0 to 86400 and is 300 by default. |
available_zones |
No |
Array of strings |
Specifies the AZ information. The instances added in a scaling action will be created in a specified AZ. If you do not specify an AZ, the system automatically specifies one. You can change the AZ of an AS group only when no scaling action is being performed in the group. |
networks |
No |
Array of networks objects |
Specifies network information. You can select up to five subnets. The first subnet you select is used by the primary NICs of ECSs by default. For the information about the data structure, see Table 3. The value of this parameter can be changed only when all the following conditions are met:
|
security_groups |
No |
Array of security_groups objects |
Specifies the security group. A maximum of one security group can be selected. For information about the data structure, see Table 4. If the security group is specified both in the AS configuration and AS group, scaled ECS instances will be added to the security group specified in the AS configuration. If the security group is not specified in either of them, scaled ECS instances will be added to the default security group. For your convenience, you are advised to specify the security group in the AS configuration. The value of this parameter can be changed only when all the following conditions are met:
|
lb_listener_id |
No |
String |
Specifies the ELB listener ID. You can add up to six load balancer listeners. Separate listener IDs with commas (,). The value of this parameter can be changed only when all the following conditions are met:
|
health_periodic_audit_method |
No |
String |
Specifies the health check method for instances in the AS group. The health check methods include ELB_AUDIT and NOVA_AUDIT. 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 |
Specifies the health check period for the instances in the AS group. The value can be 1, 5, 15, 60, or 180 in the unit of minutes. If the value is set to 0, health check is performed every 10 seconds. |
instance_terminate_policy |
No |
String |
Specifies the instance removal policy.
|
health_periodic_audit_grace_period |
No |
Integer |
Specifies the grace period for instance health check. The unit is second and value range is 0-86400. The default value is 600. The health check grace period starts after an instance is added to an AS group and is enabled. The AS group will start checking the instance status only after the grace period ends. This parameter is valid only when the instance health check method of the AS group is ELB_AUDIT. |
scaling_configuration_id |
No |
String |
Specifies the AS configuration ID, which can be obtained using the API for querying AS configurations. For details, see Querying AS configurations. |
notifications |
No |
Array of strings |
Specifies the notification mode. EMAIL refers to notification by email. This notification mode has been canceled. You are advised to configure the notification function for the AS group. For details, see Notifications. |
delete_publicip |
No |
Boolean |
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.
|
delete_volume |
No |
Boolean |
Specifies whether to delete the data disks attached to the ECS when deleting the ECS. The value can be true or false. The default value is false.
|
multi_az_priority_policy |
No |
String |
Specifies the priority policy used to select target AZs when adjusting the number of instances in an AS group.
|
description |
No |
String |
Specifies the description of the AS group. The value can contain 1 to 256 characters. |
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", "desire_instance_number": 1, "min_instance_number": 1, "max_instance_number": 3, "cool_down_time": 200, "multi_az_priority_policy": "PICK_FIRST" }
Response parameters
Parameter |
Type |
Description |
---|---|---|
scaling_group_id |
String |
Specifies the AS group ID. |
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.
Feedback
Was this page helpful?
Provide feedbackThank 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