Query Reserved Instance
Updated at:2025-10-20
This API is used for querying the list of reserved instances.
Request structure
Plain Text
1POST /v{version}/instance/reserved/list?marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "reservedInstanceIds": [
6 reservedInstanceId
7 ],
8 "reservedInstanceName": reservedInstanceName,
9 "zoneName": zoneName,
10 "reservedInstanceStatus":reservedInstanceStatus,
11 "offeringType":offeringType,
12 "spec":spec,
13 "osType":osType,
14 "sortKey":sortKey,
15 "sortDir":sortDir
16}
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 |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | int | No | Query | Maximum number of items included per page, maximum: 1,000, default: 1,000 |
| reservedInstanceIds | Array | No | requestBody parameters | Collection of reserved instance IDs |
| reservedInstanceName | String | No | requestBody parameters | Instance name |
| zoneName | String | No | requestBody parameters | Availability zone, e.g., cn-bj-a |
| reservedInstanceStatus | String | No | requestBody parameters | Status of reserved instances |
| spec | String | No | requestBody parameters | Instance specification, for example: bcc.g4.c2m8 |
| offeringType | String | No | requestBody parameters | FullyPrepay: Fully prepay |
| osType | String | No | requestBody parameters | Supported image types: all/linux/windows |
| instanceId | String | No | requestBody parameters | Deduct instance ID |
| instandeName | String | No | requestBody parameters | Instance name |
| isDeduct | Boolean | No | requestBody parameters | Whether there are deducted instances: true/false |
| ehcClusterId | String | No | requestBody parameters | EHC cluster ID |
| sortKey | String | No | requestBody parameters | Sorting field: osType/instanceCount/effectiveTime/expireTime |
| sortDir | String | No | requestBody parameters | Sorting order: desc/asc |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| totalCount | Integer | Total count of reserved instances |
| marker | String | Mark the starting position of the query. |
| maxKeys | Integer | Maximum number of items included per page |
| nextMarker | String | The marker value needed to fetch the next page. This field is absent when isTruncated is false. |
| isTruncated | bool | true indicates there is more data later, false indicates it is the last page |
| reservedInstances | List<[ReservedInstanceInfo](BCC/API Reference/Appendix.md#ReservedInstanceInfo)> | Reserved instance information, a collection composed of ReservedInstanceInfo |
Error codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| BadRequest | request is invalid | 400 | Invalid request parameters |
Request example
Plain Text
1POST http://bcc.bj.baidubce.com/v2/instance/reserved/list
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "reservedInstanceName": "test",
7 "zoneName": "cn-bj-a",
8 "spec": "bcc.g4.c2m8",
9 "offeringType": "FullyPrepay"
10}
Response example
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "totalCount": 1,
9 "marker": null,
10 "maxKeys": 1000,
11 "nextMarker": null,
12 "isTruncated": true,
13 "reservedInstances": [
14 {
15 "autoRenew": false,
16 "renewTimeUnit": null,
17 "renewTime": null,
18 "nextRenewTime": null,
19 "reservedInstanceId": "r-xxcxcx",
20 "reservedInstanceUuid": "dfadfadfadfafafada",
21 "reservedInstanceName": "test",
22 "scope": "AZ",
23 "zoneName": "cn-bj-a",
24 "spec": "bcc.g4.c2m8",
25 "reservedType": "BCC",
26 "offeringType": "FullyPrepay",
27 "osType": "all",
28 "reservedInstanceStatus": "Active",
29 "instanceCount": 1,
30 "effectiveTime": "2023-05-18T06:33:34Z",
31 "expireTime": "2023-06-18T06:34:57Z",
32 "tags": null
33 }
34 ]
35}
