查询实例列表
更新时间:2022-01-27
说明
- 查询所属于本账号的实例列表。
请求结构
GET /v{version}/instance?dbInstanceType={dbInstanceType}&engineVersion={engineVersion}&storageEngine={storageEngine}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
HOST: mongodb.bj.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
version | string | 是 | URL参数 | API版本号 |
marker | string | 否 | Query参数 | 批量获取列表的查询的起始位置。 |
maxKeys | int | 否 | Query参数 | 每页包含的最大数量,最大数量通常不超过1000,缺省值为10。 |
engineVersion | string | 否 | Query参数 | 数据库版本号。取值参考 |
storageEngine | string | 否 | Query参数 | 存储引擎。取值参考 |
dbInstanceType | string | 否 | Query参数 | 实例类型。取值参考 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
marker | String | 批量获取列表的查询的起始位置。 |
maxKeys | int | 每页包含的最大数量。 |
isTruncated | boolean | true表示后面还有数据,false表示已经是最后一页 |
nextMarker | String | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 |
dbInstances | List DBInstanceModel | 实例列表。 |
请求示例
GET /v1/instance?marker=-1&maxKeys=10 HTTP/1.1
HOST: mongodb.bj.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
HTTP/1.1 200 OK
x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
Content-Type: application/json
{
"marker": "-1",
"maxKeys": 10,
"isTruncated": false,
"dbInstances": [
{
"dbInstanceId": "m-soQKA7",
"connectionString": "mongodb://root:****@soQKA7bQs.bce.qa.sandbox.baidu.com:27017,soQKA7LFG.bce.qa.sandbox.baidu.com:27017/admin?replicaSet=rep-GCHhjz",
"dbInstanceName": "M4yui7",
"paymentTiming": "Postpaid",
"dbInstanceCpuCount": 1,
"dbInstanceMemoryCapacity": 2,
"dbInstanceStorage": 5,
"dbInstanceType": "replica",
"dbInstanceStatus": "RUNNING",
"createTime": "2020-03-16T02:30:41Z",
"shardCount": "0",
"engineVersion": "3.4",
"storageEngine": "WiredTiger",
"mongosCount": "0",
"votingMemberNum": 3,
"readonlyNodeNum": 0,
"vpcId": "vpc-ar6tyh9t2tz7",
"port": "27017",
"subnets": [
{
"zoneName": "cn-bj-a",
"subnetId": "sbn-rafwenxcnvh5"
}
],
"tags": [
{
"tagKey": "默认项目",
"tagValue": "test-1"
}
]
},
{
"dbInstanceId": "m-Hphyd0",
"dbInstanceName": "lZyAew",
"connectionString": "mongodb://root:****@Hphyd0Nce.mongodb.fwh.baidubce.com:27017,Hphyd0GH1.mongodb.fwh.baidubce.com:27017/admin",
"port": "27017",
"engineVersion": "3.6",
"storageEngine": "WiredTiger",
"dbInstanceCpuCount": 0,
"dbInstanceMemoryCapacity": 0,
"dbInstanceStorage": 0,
"dbInstanceType": "sharding",
"dbInstanceStatus": "RUNNING",
"mongosCount": "2",
"shardCount": "2",
"createTime": "2020-03-19T02:08:17Z",
"votingMemberNum": 0,
"readonlyNodeNum": 0,
"vpcId": "vpc-ar6tyh9t2tz7",
"paymentTiming": "Postpaid",
"subnets": [
{
"zoneName": "cn-bj-a",
"subnetId": "sbn-rafwenxcnvh5"
}
],
"tags": []
}
]
}