Updated on 2025-12-02 GMT+08:00

Adding Nodes for a Cluster Instance

API Description

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

Constraints

  • This API supports both yearly/monthly and pay-per-use DB instances.
  • Only the mongos and shard nodes can be added.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    dds:instance:addNode

    write

    instance

    g:EnterpriseProjectId

    • dds:instance:extendNode
    • dds:instance:list
    • dds:instance:addReadonlyNode

    -

URI

  • URI format

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

  • URI example

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

Table 1 URI parameters

Name

Mandatory

Type

IN

Description

project_id

Yes

string

path

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

instance_id

Yes

string

path

Definition

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.

Constraints

N/A

Range

N/A

Default Value

N/A

Request

Table 2 Request header parameters

Name

Mandatory

Type

IN

Description

X-Auth-Token

Yes

string

header

Definition

User token obtained from IAM. For details, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Parameter description

Name

Type

Mandatory

Description

type

String

Yes

Definition

Type of the object to be scaled.

Constraints

N/A

Range

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

Default Value

N/A

spec_code

String

Yes

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

num

String

Yes

Definition

The number of mongos or shard nodes to be added.

Constraints

A cluster instance supports up to 32 mongos nodes and 32 shard nodes.

Range

N/A

Default Value

N/A

volume

Object

No

Definition

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

Constraints

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

Range

N/A

Default Value

N/A

is_auto_pay

Boolean

No

Definition

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.

Constraints

N/A

Range

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

Default Value

false

Table 4 volume field data structure description

Name

Type

Mandatory

Description

size

String

Yes

Definition

The disk capacity of all new shards.

Constraints

N/A

Range

  • 10 GB to 5,000 GB when the shard node has fewer than 8 vCPUs.
  • 10 GB to 10,000 GB when the shard node has 8 or more vCPUs.

Default Value

N/A

Example Request

  • Adding one mongos node whose spec_code is set to dds.mongodb.c6.medium.4.mongos
    { 
    	"type": "mongos",
    	"spec_code":"dds.mongodb.c6.medium.4.mongos",
    	"num": 1
    }
  • Adding one shard group whose spec_code is set to dds.mongodb.c6.medium.4.mongos and storage space is 330 GB.
    {
    	"type": "shard",
    	"spec_code":"dds.mongodb.c6.medium.4.shard",
    	"num": 1,
            "volume": { 
                 "size": 330 
        }
    }

Response

  • Parameter description
    Table 5 Parameter description

    Name

    Type

    Mandatory

    Description

    job_id

    String

    Yes

    Definition

    Indicates the task ID.

    Range

    N/A

    order_id

    String

    No

    Definition

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

    Range

    N/A

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

SDK

Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.