Updated on 2023-11-24 GMT+08:00

Querying Available DB Instances

API Description

This API is used to query DB instances to which a specified parameter template can be applied.

URI

  • URI format

    GET https://{Endpoint}/v3/{project_id}/configurations/{config_id}/applicable-instances

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/056538411200d4cd2f79c003c7606412/configurations/7a8d539ba30f43adaf1b16d08b1df4bdpr02/applicable-instances

Table 1 Request parameters

Name

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

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

project_id

string

path

Yes

Project ID of a tenant in a region. Obtain the project ID by following the instructions in Obtaining a Project ID.

Table 2 Path parameters

Name

Mandatory

Type

Description

config_id

Yes

String

Parameter template ID.

Table 3 Query parameters

Name

Mandatory

Type

Description

offset

No

Integer

Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data. The value must be a positive integer.

limit

No

Integer

Number of records to be queried. The default value is 100. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

Requests

None

Responses

  • Parameter description
    Table 4 Response body parameters

    Name

    Type

    Description

    instances

    Array of Table 5-5 objects

    List of instances to which the parameter template can be applied.

    Table 5 ApplicableInstancesInfo

    Name

    Type

    Description

    instance_id

    String

    DB instance ID.

    instance_name

    String

    DB instance name.

    entities

    Array of Table 6-6 objects

    List of node group information or node information.

    For a replica set instance or single node instance, this parameter is not returned and the parameter template is directly applied to the corresponding DB instance.

    For the shard or config group of a cluster instance, information about the node group of the corresponding instance is returned. For the mongos group of a cluster instance, information about the node of the corresponding instance is returned.

    For example, a parameter template of the mongos node can be applied to one or more mongos nodes.

    Table 6 EntityInfo

    Name

    Type

    Description

    entity_id

    String

    Group ID or node ID.

    entity_name

    String

    Group name or node name.

  • Example response
{  
  instances:[ 
    { 
      "instance_id": "1967d9d9d6ef4c5ea38bd5a754f5737ein02", 
      "instance_name": "dds-5425", 
      "entities": [ 
        { 
          "entity_id": "36457a9af7c7486a882727d205ef37afgr02", 
          "entity_name": "shard_1" 
        }, 
        { 
          "entity_id": "a36651f1807f40be891db839e8bbe9e7gr02", 
          "entity_name": "shard_2" 
        } 
      ] 
    }, 
    { 
      "instance_id": "4809355b9836467c8749610089b1ef3bin02", 
      "instance_name": "dds-9d67", 
      "entities": [ 
        { 
          "entity_id": "08e61e50220c49728eb49dbb092d6ec4gr02", 
          "entity_name": "shard_2" 
        }, 
        { 
          "entity_id": "24d58cd41c20486e9745e7f5b424e641gr02", 
          "entity_name": "shard_3" 
        }, 
        { 
          "entity_id": "602807fcb2b24e38952347e030ec4a61gr02", 
          "entity_name": "shard_1" 
        } 
      ] 
    } 
  ] 
}

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.