查询预留实例券
更新时间:2024-11-04
该接口用于查询预留实例券列表信息。
请求结构
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}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号 |
marker | String | 否 | Query参数 | 批量获取列表的查询的起始位置,是一个由系统生成的字符串 |
maxKeys | int | 否 | Query参数 | 每页包含的最大数量,最大数量通常不超过1000,缺省值为1000 |
reservedInstanceIds | Array | 否 | requestBody参数 | 预留实例券的id集合 |
reservedInstanceName | String | 否 | requestBody参数 | 实例券的名称 |
zoneName | String | 否 | requestBody参数 | 可用区,例如:cn-bj-a |
reservedInstanceStatus | String | 否 | requestBody参数 | 预留实例券的状态 |
spec | String | 否 | requestBody参数 | 实例规格,例如:bcc.g4.c2m8 |
offeringType | String | 否 | requestBody参数 | FullyPrepay:全预付 |
osType | String | 否 | requestBody参数 | 支持的镜像类型,all/linux/windows |
instanceId | String | 否 | requestBody参数 | 抵扣实例ID |
instandeName | String | 否 | requestBody参数 | 实例名称 |
isDeduct | Boolean | 否 | requestBody参数 | 是否有抵扣实例:true/false |
ehcClusterId | String | 否 | requestBody参数 | ehc集群id |
sortKey | String | 否 | requestBody参数 | 排序字段:osType/instanceCount/effectiveTime/expireTime |
sortDir | String | 否 | requestBody参数 | 排序方式:desc/asc |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
totalCount | Integer | 预留实例券的总数量 |
marker | String | 标记查询的起始位置 |
maxKeys | Integer | 每页包含的最大数量 |
nextMarker | String | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 |
isTruncated | bool | true表示后面还有数据,false表示已经是最后一页 |
reservedInstances | List<ReservedInstanceInfo> | 预留实例券信息,由 ReservedInstanceInfo 组成的集合 |
错误码
错误码 | 错误描述 | HTTP状态码 | 中文解释 |
---|---|---|---|
BadRequest | request is invalid | 400 | 请求参数无效 |
请求示例
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}
返回示例
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}