You can call this operation to create shards or mongos for an ApsaraDB for MongoDB sharded cluster instance.

Before you call this operation, make sure that you understand the billing methods and pricing of ApsaraDB for MongoDB.

This operation applies to sharded cluster instances only.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateNode

The operation that you want to perform. Set the value to CreateNode.

NodeClass String Yes dds.shard.mid

The specification of the shard or mongos. For more information, see Instance types.

NodeType String Yes shard

The type of the node. Valid values:

  • shard
  • mongos
DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the sharded cluster instance.

NodeStorage Integer No 10

The storage space of the node. You must specify this parameter if the value of the NodeType parameter is Shard.

  • Valid values: 10 to 2000. Unit: GB.
  • The value must be a multiple of 10 GB.
FromApp String No OpenApi

The source of the request. Valid values:

  • OpenApi: the ApsaraDB for MongoDB API
  • mongo_buy: the ApsaraDB for MongoDB console
AutoPay Boolean No true

Specifies whether to enable automatic payment. Valid values:

  • true: enables automatic payment. Make sure that your account has sufficient balance.
  • false: disables automatic payment. You must perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the top navigation bar, click Expenses. The Billing Management page appears. In the left-side navigation pane, click Bills. On the Unpaid tab, click Make a Payment in the Actions column for the bill that you want to pay.

Default value: true.

Note This parameter is only applicable to subscription instances.
ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed. You can call the DescribeRegions operation to query the region ID.

Response parameters

Parameter Type Example Description
NodeId String d-bpxxxxxxxxxxxxxx

The ID of the node.

OrderId String 2034xxxxxxxx

The ID of the order.

RequestId String 7D48FB19-20CA-4725-A870-3D8F5CE69F14

The ID of the request.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/? Action=CreateNode
&NodeClass=dds.shard.mid
&NodeType=shard
&DBInstanceId=dds-bpxxxxxxxx
&<Common request parameters>

Sample success responses

XML format

<CreateNodeResponse>
      <OrderId>2034xxxxxxxx</OrderId>
      <RequestId>7D48FB19-20CA-4725-A870-3D8F5CE69F14</RequestId>
</CreateNodeResponse>

JSON format

{
    "OrderId": "2034xxxxxxxx",
    "RequestId": "7D48FB19-20CA-4725-A870-3D8F5CE69F14"
}

Error codes

For a list of error codes, visit the API Error Center.