查询实例列表
更新时间:2024-09-25
接口描述
批量查询BCI实例列表。
请求结构
GET /v{version}/instance HTTP/1.1
Host: bci.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值2。 |
keywordType | String | 否 | Query参数 | 查询关键字名称,取值范围:name、podId。 |
keyword | String | 否 | Query参数 | 查询关键字值。 |
marker | String | 否 | Query参数 | 表示下一个查询开始的marker。 说明:首次查询时无需设置该参数,后续查询的marker从返回结果中获取,返回结果中的marker为空表示没有下一个。 |
maxKeys | Integer | 否 | Query参数 | 每页包含的最大数量。 取值范围:[1, 1000]之间的正整数。 默认值:10 |
响应头域
除公共头域外,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
marker | String | 标记查询的起始位置 |
isTruncated | Boolean | true表示后面还有数据,false表示已经是最后一页 |
nextMarker | String | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 |
maxKeys | Integer | 每页包含的最大数量 |
result | List<InstanceModel> | BCI实例信息列表 |
请求示例
GET /v{version}/instance?maxKeys=5 HTTP/1.1
Host: bci.bj.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
HTTP/1.1 200 OK
x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
Date: Tue, 06 Sep 2016 10:08:44 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"marker": "p-rpjlzbuu",
"isTruncated": true,
"nextMarker": "p-qsyvnuzg",
"maxKeys": 5,
"result": [
{
"instanceId": "p-rpjlzbuu",
"instanceName": "default-eni-test-558cfc6dfc-st8sg-1",
"status": "Running",
"zoneName": "",
"cpuType": "intel",
"gpuType": "",
"cpu": 0.25,
"memory": 0.5,
"bandwidthInMbps": 0,
"publicIp": "",
"internalIp": "192.168.64.157",
"createTime": "2023-03-02T05:55:43Z",
"updateTime": "2023-03-02T14:19:45Z",
"deleteTime": null,
"restartPolicy": "Always",
"tags": null
},
{
"instanceId": "p-iwafloba",
"instanceName": "default-eni-test-558cfc6dfc-qwcjq-1",
"status": "Running",
"zoneName": "",
"cpuType": "intel",
"gpuType": "",
"cpu": 0.25,
"memory": 0.5,
"bandwidthInMbps": 0,
"publicIp": "",
"internalIp": "192.168.64.88",
"createTime": "2023-03-02T05:55:43Z",
"updateTime": "2023-03-02T14:19:45Z",
"deleteTime": null,
"restartPolicy": "Always",
"tags": null
},
{
"instanceId": "p-7314w80l",
"instanceName": "default-eni-test-558cfc6dfc-lcztq-1",
"status": "Running",
"zoneName": "",
"cpuType": "intel",
"gpuType": "",
"cpu": 0.25,
"memory": 0.5,
"bandwidthInMbps": 0,
"publicIp": "",
"internalIp": "192.168.64.132",
"createTime": "2023-03-02T05:55:57Z",
"updateTime": "2023-03-02T14:19:45Z",
"deleteTime": null,
"restartPolicy": "Always",
"tags": null
},
{
"instanceId": "p-bk399zaw",
"instanceName": "default-eni-test-558cfc6dfc-hktl9-1",
"status": "Running",
"zoneName": "",
"cpuType": "intel",
"gpuType": "",
"cpu": 0.25,
"memory": 0.5,
"bandwidthInMbps": 0,
"publicIp": "",
"internalIp": "192.168.64.191",
"createTime": "2023-03-02T05:55:57Z",
"updateTime": "2023-03-02T14:19:45Z",
"deleteTime": null,
"restartPolicy": "Always",
"tags": null
},
{
"instanceId": "p-fhunfwdn",
"instanceName": "default-eni-test-558cfc6dfc-5fds8-1",
"status": "Running",
"zoneName": "",
"cpuType": "intel",
"gpuType": "",
"cpu": 0.25,
"memory": 0.5,
"bandwidthInMbps": 0,
"publicIp": "",
"internalIp": "192.168.64.85",
"createTime": "2023-03-02T05:55:57Z",
"updateTime": "2023-03-02T14:19:45Z",
"deleteTime": null,
"restartPolicy": "Always",
"tags": null
}
]
}