Updated on 2022-02-22 GMT+08:00

Adding Nodes for a Cluster Instance

Function

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

Constraints

  • 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.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/enlarge

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    instance_id

    Yes

    Specifies the DB instance ID.

Requests

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    type

    Yes

    String

    Specifies 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

    Yes

    String

    Specifies the resource specification code. For details about how to obtain the resource specification code, see the flavors.spec_code parameter in Querying All DB Instance Specifications.

    num

    Yes

    Integer

    Specifies the number of mongos or shard nodes to be added.

    volume

    No

    Object

    Specifies 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. The disk information of all shards to be added needs to be specified.
      NOTE:

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

    Table 3 volume field data structure description

    Name

    Mandatory

    Type

    Description

    size

    Yes

    Integer

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

  • Request header
    POST https://DDS endpoint/v3/{project_id}/instances/{instance_id}/enlarge
  • Example request
    Number of mongos nodes to be added:
    { 
    	"type": "mongos",
    	"spec_code":"dds.c3.medium.4.mongos",
    	"num": 1
    }
    Number of shard nodes to be added:
    {
    	"type": "shard",
    	"spec_code":"dds.c3.medium.4.shard",
    	"num": 1,
            "volume": { 
                 "size": 330 
        }
    }

Responses

  • Parameter description
    Table 4 Parameter description

    Name

    Type

    Description

    job_id

    String

    Indicates the task ID.

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

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.