This API is used to delete an auto scaling policy.
Function
This API is used to delete a scheduled scaling policy from a deployed service. This API applies to scenarios where a service needs to be automatically deleted based on the service load or at a specified time. Before calling this API, ensure that the service has been deployed and the valid service ID and deployment ID have been obtained. If the provided service ID is invalid, the parameter settings are incorrect, or the system resources are insufficient, an error message is displayed, prompting you to check the validity of the input data or contact technical support. This API is not open currently. It is used by the backend to clear automatic scaling policy rules of a service.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
modelarts:service:deleteHpa
Read
service *
-
-
-
URI
DELETE /v2/{project_id}/services/{service_id}/deployments/{deployment_id}/hpa
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID and Name. Constraints N/A Range Project ID. Default Value N/A |
| service_id | Yes | String | Definition: Service ID, which can be obtained from the response body during service creation or by querying the service list. The service_id field indicates the service ID. Constraints N/A Range Service ID. Default Value N/A |
| deployment_id | Yes | String | Definition Deployment ID, which you can obtain from the response body when adding the deployment or by obtaining service deployments. The deployment_id field indicates the deployment ID. Constraints N/A Range Deployment ID. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication. Constraints N/A Range N/A Default Value N/A |
| Content-Type | Yes | String | Definition Message body type or format. Constraints N/A Range Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Auto scaling policy ID. Range N/A |
| name | String | Definition Name of an auto scaling policy. Range N/A |
| target_resource_id | String | Definition ID of the target to which the auto scaling policy is bound. Range Instance group ID. |
| target_resource_type | String | Definition Type of the target to which the auto scaling policy is bound. Range |
| min_replicas | Integer | Definition Minimum number of instances for auto scaling. Range 1-128 |
| max_replicas | Integer | Definition Maximum number of instances for auto scaling. Range 1-128 |
| status | String | Definition Status of the auto scaling policy. Range |
| workspace_id | String | Definition Workspace ID. Range
|
| hpa_rules | Array of HpaRule objects | Definition Auto scaling rules. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Auto scaling rule ID. Range N/A |
| hpa_id | String | Definition ID of the policy associated with the auto scaling rule. Range N/A |
| name | String | Definition Auto scaling rule name. Range The value can contain 4 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
| type | String | Definition Auto scaling type. Range |
| schedule | String | Definition Cron expression for executing scheduled auto scaling. The value starts at a minute level and does not support seconds. Range N/A |
| target_replicas | Integer | Definition Number of target instances for auto scaling. Range 1 to 128 |
| disable | String | Definition Specifies whether to enable the auto scaling rule. Range |
| status | String | Definition Status of the auto scaling rule. Range |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Range: N/A. |
| error_msg | String | Definition: Error message. Range: N/A. |
Status code: 404
Example Requests
None
Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | Delete an auto scaling policy. |
| 400 | Invalid request parameter. |
| 404 | Resource not found. |
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