Updated on 2024-09-30 GMT+08:00

Deleting an AS policy

Function

This API is used to delete an auto scaling policy.

Constraints

None

Debugging

You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate sample SDK code and support sample SDK code debugging.

URI

DELETE /v2/{project_id}/autoscaling-policy/{cluster_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Value range

The value must consist of 1 to 64 characters. Only letters and digits are allowed.

Default value

N/A

cluster_id

Yes

String

Explanation

Cluster ID. If this parameter is specified, the latest metadata of the cluster that has been patched will be obtained. For details about how to obtain the cluster ID, see Obtaining a Cluster ID.

Constraints

N/A

Value range

The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-).

Default value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

node_group_name

Yes

String

Explanation

Node group name.

Constraints

If resource_pool_name is set to default, the auto scaling policies are deleted by node group. If resource_pool_name is not set to default, policies of the resource pool corresponding to the node group are deleted.

Value range

N/A

Default value

N/A

resource_pool_name

Yes

String

Explanation

Pool name.

Constraints

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.

Value range

The value can contain only letters, digits, underscores (_), and hyphens (-).

Default value

N/A

Response Parameters

None

Example Request

  • Delete the auto scaling policies of the node_group_2 node group.
    /v2/174ee662a7e24cc99bfc858c4558dbf6/autoscaling-policy/daf42ff0-05bc-4a1e-afbf-42b3131a1295
    
    {
      "node_group_name" : "node_group_2"
    }
  • Delete the resource pool policy resource_1 node group policies.
    /v2/174ee662a7e24cc99bfc858c4558dbf6/autoscaling-policy/daf42ff0-05bc-4a1e-afbf-42b3131a1295
    
    {
      "node_group_name" : "node_group_2",
      "resource_pool_name" : "resource_1"
    }

Example Response

None

Status Codes

For details, see Status Codes.

Error Codes

See Error Codes.