Create Auto-renewal Rule for Reserved Instance
Updated at:2025-10-20
This API is used to enable the automatic renewal feature for reserved instances.
- If your resource is approaching expiration (less than 24 hours remaining), it is recommended to perform a manual renewal first.
- When automatic renewal is enabled, the system will automatically renew the resource 7 days before it expires.
- Automatic renewal will follow the most recently specified renewal period.
Request structure
Plain Text
1POST /v{version}/instance/reserved/autoRenew HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "reservedInstanceIds": [
6 reservedInstanceId
7 ],
8 "autoRenewTimeUnit":autoRenewTimeUnit,
9 "autoRenewTime":autoRenewTime
10}
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 |
| reservedInstanceIds | Array | Yes | requestBody parameters | Collection of instance coupon IDs |
| autoRenewTimeUnit | String | No | requestBody parameters | Auto-renewal period unit of the reserved instance, defaulting to month. It cannot be changed |
| autoRenewTime | String | No | requestBody parameters | The automatic renewal periods for reserved instances support 3, 6, 9, 12, 24 and 36 months and must be consistent with the purchase period (this duration can be retrieved through the reservedInstanceTime field in the reserved instance list) |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| reservedInstanceIds | Array | Collection of reserved instance IDs |
Error codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| BadRequest | request is invalid | 400 | Invalid request parameters |
| NoSuchObject | Auto-renewal failed: reservedInstanceIds not fount: [reservedInstanceId] | 400 | [reservedInstanceId] does not exist |
Request example
Plain Text
1POST http://bcc.bj.baidubce.com/v2/instance/reserved/autoRenew
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "reservedInstanceIds": [
7 "r-xxx"
8 ],
9 "autoRenewTimeUnit": "month",
10 "autoRenewTime": 24
11}
Response example
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2023 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "reservedInstanceIds": [
9 "r-xxx"
10 ]
11}
