Add Sharded Cluster Instance Node
Last Updated:2021-12-31
New Instance Node of a Sharded Cluster
Description
- This interface is used to add a Mongos or Shard node of a sharded cluster instance. Currently, it only supports creation of an instance once.
- The node billing method is the same as the instance to which it belongs.
- To create a postpaid node, the account cash balance plus the general voucher must be greater than 100 CNY. To create a prepaid instance node, the account cash balance must be greater than or equal to the node cost.
- If the interface is asynchronously created, you can query the instance status and node status via the Designated Instance Details Interface.
Request structure
POST /v{version}/instance/{dbInstanceId}/node?clientToken={clientToken} HTTP/1.1
HOST: mongodb.bj.baidubce.com
Authorization: authorization string
{
"nodeCpuCount": cpuCount,
"nodeMemoryCapacity": memCapacity,
"nodeStorage": storage,
"nodeType": "Shard"
}
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 |
clientToken | string | Yes | Query parameters | Means the idempotence Token, which is an ASCII string with a length not exceeding 64 bits. |
dbInstanceId | string | Yes | Query parameters | Instance ID |
nodeCpuCount | int | Yes | RequestBody parameter | Node CPU specifications Value Reference |
nodeMemoryCapacity | int | Yes | RequestBody parameter | Node memory specification expressed in GBValue Reference |
nodeStorage | int | No | RequestBody parameter | Node storage space expressed in GB. This parameter is required when you add a shard node. Value Reference |
nodeType | string | Yes | RequestBody parameter | Node type. Value Reference |
purchaseCount | int | No | RequestBody parameter | The number of nodes created. It supports the creation of one instance once, whose default value is 1. |
Return header field
There are no other special header fields except for the common header field.
Return parameter
Parameter Name | Type | Description |
---|---|---|
nodeId | List String | New node ID |
Request example
POST /v1/instance/m-qNlWTz/node?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST: mongodb.bj.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"nodeCpuCount": 1,
"nodeMemoryCapacity": 2,
"nodeStorage": 5,
"nodeType": "shard"
}
Return example
HTTP/1.1 200 OK
x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
Content-Type: application/json
{
"nodeIds": ["shd-AQsm6p"]
}