Updated on 2022-12-12 GMT+08:00

Adding Nodes for a Cluster Instance

API Description

This API is used to add nodes for a specified cluster instance.

Restrictions

  • This API supports both yearly/monthly and pay-per-use DB instances.
  • Only the mongos and shard nodes can be added.
  • The specifications of the new node must be the same as those of the existing nodes in the instance.

    The specification series includes general-purpose (s6), enhanced (c3), and enhanced II (c6).

    Example:
    • dds.mongodb.s6.large.4.mongos and dds.mongodb.s6.medium.4.mongos have the same specifications.
    • dds.mongodb.s6.large.4.mongos and dds.mongodb.c3.large.4.mongos are not of the same specifications.

URI

  • URI format

    POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/enlarge

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/9136fd2a9fcd405ea4674276ce36dae8in02/enlarge

Table 1 Request parameters

Name

Type

IN

Mandatory

Description

x-auth-token

string

header

Yes

User token

project_id

string

path

Yes

Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID.

instance_id

string

path

Yes

Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one.

Requests

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Mandatory

    Description

    type

    String

    Yes

    Type of the object to be scaled.

    • Set the value to mongos if mongos nodes are to be added.
    • Set the value to shard if shard nodes are to be added.

    spec_code

    String

    Yes

    The resource specification code. For details about how to obtain the resource specification code, see the flavors.spec_code parameter in Querying Database Specifications.

    num

    String

    Yes

    The number of mongos or shard nodes to be added. A cluster instance supports up to 32 mongos nodes and 32 shard nodes.

    volume

    Object

    No

    The volume information. For more information, see Table 3.

    • This parameter is not transferred when the mongos nodes are to be added.
    • This parameter is mandatory when the shard nodes are to be added.
      NOTE:

      If multiple shards are added at a time, the shards must have the same specifications and disk capacity.

    is_auto_pay

    Boolean

    No

    Whether the order is automatically paid from your account when you add nodes to a yearly/monthly DB instance. This parameter does not affect the payment mode of automatic renewal.

    • true: indicates that the order is automatically paid from the account.
    • false: indicates that the order is manually paid from the account. The default value is false.
    Table 3 volume field data structure description

    Name

    Type

    Mandatory

    Description

    size

    String

    Yes

    The disk capacity of all new shards. The value range is from 10 GB to 2000 GB.

  • Request example
    Number of mongos nodes to be added:
    { 
    	"type": "mongos",
    	"spec_code":"dds.mongodb.c6.medium.4.mongos",
    	"num": 1
    }
    Number of shard nodes to be added:
    {
    	"type": "shard",
    	"spec_code":"dds.mongodb.c6.medium.4.shard",
    	"num": 1,
            "volume": { 
                 "size": 330 
        }
    }

Responses

  • Parameter description
    Table 4 Parameter description

    Name

    Type

    Mandatory

    Description

    job_id

    String

    Yes

    Indicates the task ID.

    order_id

    String

    No

    The order ID. This parameter is returned only when the nodes of a yearly/monthly DB instance are added.

  • Response example
    { 
        "job_id": "4008c8914b624785a02ab7966d4d" 
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.