Resize instances in batches
Updated at:2025-10-20
This API enables batch resizing of instances.
Request structure
Plain Text
1 PUT /v{version}/instanceBatchBySpec?{action} HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 Authorization: authorization string
4 {
5 "spec": spec,
6 "instanceIdList": [
7 "i-7pxLG046"
8 ],
9 "enableJumboFrame":enableJumboFrame
10 }
11
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number |
| action | String | Yes | Query | Action executed on the instance. In this API, the value of this parameter is resize. |
| spec | String | Yes | RequestBody | Instance specification for batch resizing |
| instanceIdList | List | Yes | RequestBody | Collection of instance IDs, up to 30 instances |
| enableJumboFrame | Boolean | No | RequestBody | Indicates whether Jumbo frames are enabled for the instance. True means enabled, and false means disabled. The default is empty. If left empty: When resizing to a specification that does not support Jumbo frames, they will not be enabled; when resizing from a specification that does not support Jumbo frames to one that does, they will also not be enabled; when resizing between specifications that support Jumbo frames, if they were enabled before resizing, they will stay enabled, and if they were not enabled, they will stay disabled. |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| orderUuidResults | A list of IDs for resizing orders. |
Error codes
If any instance in the batch operation does not support changing to the target specification, it will be filtered out and not operated on. Instances that support the change will have tasks issued normally
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| ResizeServerError | Spec not allowed or out of stock. | 400 | Resizing to this specification is not allowed |
| ResizeServerError | The number of resize exceeds 30. | 400 | The count of instances resized at one time cannot exceed 30 |
Request example
Plain Text
1 PUT /v2/instanceBatchBySpec?resize HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 ContentType: application/json
4 Authorization: bce-auth-v1/f81d3b34e48048fb****
5
6 {
7 "spec": "bcc.g5.c2m8",
8 "instanceIdList": [
9 "i-7pxLG046"
10 ]
11 }
Response example
Plain Text
1 HTTP/1.1 200 OK
2 x-bce-request-id: 019d4594-6133-4537-8dfd-f6fcdfc42dce
3 Date: Mar, 23 Dec 2023 06:42:19 GMT
4 Content-Type: application/json;charset=UTF-8
5 Server: BWS
6
7 {
8 "orderUuidResults": ["instanceId1"]
9 }
10
