Query Instance List
Last Updated:2021-12-23
Query an Instance List
Description
- Query the instance list belonging to this account.
Request structure
GET /v{version}/instance?engineVersion={engineVersion}&storageEngine={storageEngine}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
HOST: mongodb.bj.baidubce.com
Authorization: authorization string
Request header field
No other special header fields are available except for the common header fields.
Request parameter
Parameter Name | Type | Required? | Parameter Position | Description |
---|---|---|---|---|
version | string | Yes | URL parameter | API version number |
marker | string | No | Query parameters | Start position of the query for getting lists in batch. |
maxKeys | int | No | Query parameters | Maximum number of master instances on each page, which usually does not exceed 1,000 and whose default value is 10. |
engineVersion | string | No | Query parameters | Database version number. Value Reference |
storageEngine | string | No | Query parameters | Storage engine. Value Reference |
Return header field
There are no other special header fields except for the common header field.
Return parameter
Parameter Name | Type | Description |
---|---|---|
marker | String | Start position of the query for getting lists in batch. |
maxKeys | int | The maximum number of keys contained in each page. |
isTruncated | boolean | “True” means there is still data behind it, and “false” means it is already the last page. |
nextMarker | String | Gets the “marker” value to be passed on the next page. This field does not appear when “isTruncated” is false. |
dbInstances | List DBInstanceModel | Instance List. |
Request example
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
Return example
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,
"dbInstanceStatus": "RUNNING",
"createTime": "2020-03-16T02:30:41Z",
"shardCount": "0",
"engineVersion": "3.4",
"storageEngine": "WiredTiger",
"mongosCount": "0",
"vpcId":"vpc-ar6tyh9t2tz7"
"port": "27017",
"subnets": [{
"zoneName": "cn-bj-a",
"subnetId": "sbn-rafwenxcnvh5"
}],
"tags": [{
"tagKey": “Default Item",
"tagValue": "test-1"
}]
}, {
"dbInstanceId": "m-BIPjAE",
"connectionString": "mongodb://root:****@soQKA7bQs.bce.qa.sandbox.baidu.com:27017,soQKA7LFG.bce.qa.sandbox.baidu.com:27017/admin?replicaSet=rep-GCHhjz",
"dbInstanceName": "lZyAew",
"paymentTiming": "Postpaid",
"dbInstanceCpuCount": 0,
"dbInstanceMemoryCapacity": 0,
"dbInstanceStorage": 0,
"dbInstanceStatus": "RUNNING",
"createTime": "2020-03-19T02:08:17Z",
"shardCount": "2",
"engineVersion": "3.4",
"storageEngine": "WiredTiger",
"mongosCount": "2",
"vpcId":"vpc-ar6tyh9t2tz7"
"port": "27017",
"subnets": [{
"zoneName": "zoneA",
"subnetId": "sbn-rafwenxcnvh5"
}],
"tags": [{
"tagKey": “Default Item",
"tagValue": "test-1"
}]
}]
}