Viewing Auto Scaling Policies
Function
This API is used to view all auto scaling policies of a specified cluster.
URI
GET /v2/{project_id}/autoscaling-policy/{cluster_id}
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | The project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
cluster_id | Yes | String | The cluster ID. For details about how to obtain the cluster ID, see Obtaining a Cluster ID. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter | Type | Description |
---|---|---|
[Array element] | Array of AutoScalingPolicyV2 objects | The auto scaling policy list. For details, see Table 3. |
Parameter | Type | Description |
---|---|---|
node_group_name | String | The node group name. This parameter is mandatory. If resource_pool_name is default, the auto scaling policies are created by node group. If resource_pool_name is not default, policies of the resource pool corresponding to the node group are created. |
resource_pool_name | String | The resource plan name. This parameter is mandatory. If the cluster version does not support auto scaling for a specified resource pool, set this parameter to default. If this parameter is not default, the auto scaling policy of the specified resource pool is deleted. |
auto_scaling_policy | AutoScalingPolicyInfo object | The auto scaling policy. For details, see Table 4. |
Parameter | Type | Description |
---|---|---|
auto_scaling_enable | Boolean | Whether to enable the auto scaling policy. |
min_capacity | Integer | The minimum number of nodes reserved in the node group. The value ranges from 0 to 500. |
max_capacity | Integer | The maximum number of nodes in the node group. The value ranges from 0 to 500. |
resources_plans | Array of ResourcesPlan objects | The resource plan list. If this parameter is left blank, the resource plan is disabled. When auto_scaling_enable is set to true, either this parameter or rules must be configured. For details about this parameter, see Table 5. |
rules | Array of Rule objects | List of auto scaling rules. When auto_scaling_enable is set to true, either this parameter or resources_plans must be configured. For details about this parameter, see Table 6. |
tags | Array of Tag objects | Auto scaling tags. For details, see Table 8. |
Parameter | Type | Description |
---|---|---|
period_type | String | The cycle type of a resource plan. Currently, only the following cycle type is supported: daily |
start_time | String | The start time of a resource plan. The value is in the format of hour:minute, indicating that the time ranges from 00:00 to 23:59. |
end_time | String | The end time of a resource plan. The value is in the same format as that of start_time. The interval between end_time and start_time must be greater than or equal to 30 minutes. |
min_capacity | Integer | The minimum number of reserved nodes in a node group in a resource plan. The value ranges from 0 to 500. |
max_capacity | Integer | The maximum number of reserved nodes in a node group in a resource plan. The value ranges from 0 to 500. |
effective_days | Array of strings | Effective date of a resource plan. If this parameter is left blank, it indicates that the resource plan takes effect every day. The options are as follows: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, and SUNDAY |
Parameter | Type | Description |
---|---|---|
name | String | The name of an auto scaling rule. The name can contain only 1 to 64 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed. Rule names must be unique in a node group. |
description | String | The description about an auto scaling rule. It contains a maximum of 1,024 characters. |
adjustment_type | String | Auto scaling rule adjustment type. Possible values:
|
cool_down_minutes | Integer | The cluster cooling time after an auto scaling rule is triggered, when no auto scaling operation is performed. The unit is minute. The value ranges from 0 to 10080. One week is equal to 10,080 minutes. |
scaling_adjustment | Integer | The number of cluster nodes that can be adjusted at a time. The value ranges from 1 to 100. |
trigger | Trigger object | The condition for triggering a rule. For details, see Table 7. |
Parameter | Type | Description |
---|---|---|
metric_name | String | The metric name. This triggering condition makes a judgment according to the value of the metric. A metric name contains a maximum of 64 characters. |
metric_value | String | The metric threshold to trigger a rule. The value must be an integer or a number with two decimal places. |
comparison_operator | String | The metric judgment logic operator. Possible values:
|
evaluation_periods | Integer | The number of consecutive five-minute periods, during which a metric threshold is reached. The value ranges from 1 to 288. |
Parameter | Type | Description |
---|---|---|
key | String | Tag key
|
value | String | Tag value
|
Status code: 400
Parameter | Type | Description |
---|---|---|
error_code | String | Error codes. |
error_msg | String | The error message. |
Example Request
None
Example Response
Status code: 200
Auto scaling policies are displayed.
{"auto_scaling_policies" : [ {"node_group_name" : "task_node_analysis_group","resource_pool_name" : "default","auto_scaling_policy" : {"auto_scaling_enable" : true,"min_capacity" : 0,"max_capacity" : 1,"resources_plans" : [ {"period_type" : "daily","effective_days" : [ "SUNDAY" ],"start_time" : "12:00","end_time" : "13:00","min_capacity" : 2,"max_capacity" : 3} ],"rules" : [ {"name" : "default-expand-1","description" : "","adjustment_type" : "scale_out","cool_down_minutes" : 5,"scaling_adjustment" : 1,"trigger" : {"metric_name" : "YARNAppRunning","metric_value" : 100,"comparison_operator" : "GTOE","evaluation_periods" : 1}} ]}} ]}
Status Codes
See Status Codes.
Error Codes
See Error Codes.
- Function
- URI
- Request Parameters
- Response Parameters
- Example Request
- Example Response
- Status Codes
- Error Codes