Updated on 2025-12-29 GMT+08:00

Updating a Bandwidth Auto Scaling Policy

Function

This API is used to update a bandwidth auto scaling policy. Automatic bandwidth decreases are not supported.

URI

PUT /v2/{project_id}/instances/{instance_id}/autoscaling-policy/bandwidth

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

window_size

Yes

Integer

Monitoring period of bandwidth increases, in minutes. The value can be 1, 5, 10, 15, or 30.

bandwidth_usage_upper_threshold

Yes

Integer

Threshold percentage of the average bandwidth usage that triggers an auto bandwidth increase. The value can be 50, 60, 70, 80, 90, or 95.

scale_out_cooldown

Yes

Integer

Silence time (minimum interval) between two bandwidth increases, in seconds.

Default value: 0 Value range: 0–86,400.

scale_in_enabled

No

Boolean

Whether to enable automatic bandwidth decrease. Default value: false This parameter is reserved.

bandwidth_usage_lower_threshold

No

Integer

Threshold percentage of average bandwidth usage that triggers an automatic bandwidth decrease. The value can be 10, 20, or 30. This parameter is reserved.

scale_in_cooldown

No

Integer

Silence time (minimum interval) between two bandwidth decreases, in seconds. This parameter is reserved.

Default value: 300 Value range: 0–86,400

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

window_size

Integer

Monitoring period of bandwidth increases, in minutes. The value can be 1, 5, 10, 15, or 30.

bandwidth_usage_upper_threshold

Integer

Threshold percentage of the average bandwidth usage that triggers an auto bandwidth increase. The value can be 50, 60, 70, 80, 90, or 95.

scale_out_cooldown

Integer

Silence time (minimum interval) between two bandwidth increases, in seconds.

Default value: 0 Value range: 0–86,400.

scale_in_enabled

Boolean

Whether to enable automatic bandwidth decrease. Default value: false This parameter is reserved.

bandwidth_usage_lower_threshold

Integer

Threshold percentage of average bandwidth usage that triggers an automatic bandwidth decrease. The value can be 10, 20, or 30. This parameter is reserved.

scale_in_cooldown

Integer

Silence time (minimum interval) between two bandwidth decreases, in seconds. This parameter is reserved.

Default value: 300 Value range: 0–86,400

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Example Requests

PUT https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}/autoscaling-policy/bandwidth

{
  "window_size" : 5,
  "bandwidth_usage_upper_threshold" : 70,
  "scale_out_cooldown" : 0,
  "scale_in_enabled" : true,
  "bandwidth_usage_lower_threshold" : 30,
  "scale_in_cooldown" : 300
}

Example Responses

Status code: 200

Response body for updating a bandwidth auto scaling policy.

{
  "window_size" : 5,
  "bandwidth_usage_upper_threshold" : 70,
  "scale_out_cooldown" : 0,
  "scale_in_enabled" : true,
  "bandwidth_usage_lower_threshold" : 30,
  "scale_in_cooldown" : 300
}

Status code: 400

Invalid request.

{
  "error_code" : "DCS.4063",
  "error_msg" : "Invalid window_size parameter in the request."
}

Status Codes

Status Code

Description

200

Response body for updating a bandwidth auto scaling policy.

400

Invalid request.

401

Invalid authentication information.

403

Access denied.

404

The requested resource could not be found.

500

Internal server error.

Error Codes

See Error Codes.