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

Querying Database Specifications

API Description

This API is used to query all instance specifications under a specified condition.

URI

  • URI format

    GET https://{Endpoint}/v3.1/{project_id}/flavors?engine_name={engine_name}&engine_version={engine_version}&offset={offset}&limit={limit}

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3.1/0549b4a43100d4f32f51c01c2fe4acdb/flavors?engine_name=DDS-Community&engine_version=3.4&offset=1&limit=20

Requests

Request parameters
Table 1 Parameter description

Name

Type

IN

Mandatory

Description

x-auth-token

string

header

Yes

User token

project_id

string

path

Yes

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

engine_name

string

query

No

Specifies the database type. The value is DDS-Community. To obtain this value, see Querying Database Version Information.

engine_version

string

query

No

DB version number.

offset

Integer

query

No

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

limit

Integer

query

No

Maximum pieces of specifications information that can be queried

  • The value ranges from 1 to 100.
  • If this parameter is not transferred, the first 100 pieces of specification information can be queried by default.

Responses

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Mandatory

    Description

    flavors

    Array of objects

    Yes

    Indicates the DB instance specifications information list. For more information, see Table 3.

    total_count

    Integer

    Yes

    Total number of records

    Table 3 flavors field data structure description

    Name

    Type

    Mandatory

    Description

    engine_name

    String

    Yes

    Indicates the engine name.

    type

    String

    Yes

    Indicates the node type. DDS contains the following types of nodes:

    • mongos
    • shard
    • config
    • replica
    • single
    • readonly

    vcpus

    String

    Yes

    Indicates the number of vCPUs.

    ram

    String

    Yes

    Indicates the memory size in gigabyte (GB).

    spec_code

    String

    Yes

    Indicates the resource specification code.

    Example: dds.mongodb.c6.xlarge.2.shard

    NOTE:
    • dds: indicates the DDS service.
    • dds.mongodb: indicates the DDS service.
    • c6.xlarge.2: indicates the node specification. It is a high-memory type.
    • shard: indicates the node type.
    • When querying the specifications, check whether the specifications are of the same series. The specification series includes general-purpose (s6), enhanced (c3), and enhanced II (c6).
      Example:
      • dds.mongodb.s6.large.4.mongos and dds.mongodb.s6.large.4.config have the same specifications.
      • dds.mongodb.s6.large.4.mongos and dds.mongodb.c3.large.4.config are not of the same specifications.

    az_status

    Map<String,String>

    Yes

    key indicates the AZ ID, and value indicates the specification status in the AZ. Its value can be any of the following:

    • normal: The specification is on sale.
    • unsupported: This specification is not supported.
    • sellout: The specification is sold out.

    engine_versions

    Array of strings

    Yes

    Database versions

    For example, DDS mongos node, {"3.4", "4.0"}

In the example response, az1, az2, and az3 in the az_status field are example values.

  • Response example
    {
        "total_count":4,
        "flavors": [
            {
                "engine_name": "DDS-Community",
                "type": "mongos",
                "vcpus": "1",
                "ram": "4",
                "spec_code": "dds.mongodb.c6.medium.4.mongos",
                "engine_versions":["3.4","4.0"],
                "az_status": {
                    "az1": "normal",
                    "az2": "normal",
                    "az3": "normal"
                }
            },
    {
                "engine_name": "DDS-Community",
                "type": "shard",
                "vcpus": "4",
                "ram": "8",
                "spec_code": "dds.mongodb.c6.xlarge.2.shard",
                "engine_versions":["3.4","4.0"],
                "az_status": {
                    "az1": "normal",
                    "az2": "normal",
                    "az3": "normal"
                }
            },
    {
                "engine_name": "DDS-Community",
                "type": "config",
                "vcpus": "2",
                "ram": "4",
                "spec_code": "dds.mongodb.c6.large.2.config",
                "engine_versions":["3.4","4.0"],
                "az_status": {
                    "az1": "normal",
                    "az2": "normal",
                    "az3": "normal"
                }
            },
    {
                "engine_name": "DDS-Community",
                "type": "replica",
                "vcpus": "1",
                "ram": "4",
                "spec_code": "dds.mongodb.c6.medium.4.repset",
                "engine_versions":["3.4","4.0"],
                "az_status": {
                    "az1": "normal",
                    "az2": "normal",
                    "az3": "normal"
                }
            }
        ]
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.