更新时间:2022-07-19 GMT+08:00

查询实例列表

场景描述

本章节指导用户通过调用查询实例列表和详情接口,使用分页参数查询租户下所有DDS实例。

操作步骤

  1. 指定limit与offset查询DDS实例列表。

    • 接口相关信息

      URI格式:GET https://{Endpoint}/v3/{project_id}/instances?id={id}&name={name}&mode={mode}&datastore_type={datastore_type}&vpc_id={vpc_id}&subnet_id={subnet_id}&offset={offset}&limit={limit}

    • 请求示例
      • 根据指定limit与offset查询DDS实例列表

        https://dds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances?offset=0&limit=1

    • 响应示例

      根据指定limit与offset查询DDS实例列表:

      {
        "instances": [
          {
            "id": "8436a91546294036b75931e879882200in02",
            "name": "dds-efa6",
            "status": "normal",
            "port": 8635,
            "mode": "ReplicaSet",
            "region": "aaa",
            "datastore": {
              "type": "DDS-Community",
              "version": "3.4"
            },
            "engine": "wiredTiger",
            "created": "2019-01-17T07:05:52",
            "updated": "2019-01-17T07:05:47",
            "db_user_name": "rwuser",
            "ssl": "1",
            "vpc_id": "674e9b42-cd8d-4d25-a2e6-5abcc565b961",
            "subnet_id": "f1df08c5-71d1-406a-aff0-de435a51007b",
            "security_group_id": "7aa51dbf-5b63-40db-9724-dad3c4828b58",
            "backup_strategy": {
              "start_time": "16:00-17:00",
              "keep_days": 7
            },
            "pay_mode": "0",
            "maintenance_window": "02:00-06:00",
            "groups": [
              {
                "type": "replica",
                "volume": {
                  "size": "10",
                  "used": "0.33"
                },
                "nodes": [
                  {
                    "id": "233eaac9c6f245c0bb9c2d21eea12d1bno02",
                    "name": "dds-efa6_replica_node_2",
                    "status": "normal",
                    "role": "Primary",
                    "private_ip": "192.168.0.174",
                    "public_ip": "",
                    "spec_code": "dds.mongodb.s2.medium.4.repset",
                    "availability_zone": "bbb"
                  },
                  {
                    "id": "d57d76d6320a4a7b86db82c317550c4ano02",
                    "name": "dds-efa6_replica_node_1",
                    "status": "normal",
                    "role": "Hidden",
                    "private_ip": "192.168.0.39",
                    "public_ip": "",
                    "spec_code": "dds.mongodb.s2.medium.4.repset",
                    "availability_zone": "bbb"
                  },
                  {
                    "id": "f46b0a1cf4d9400e9fd7af17f8742d37no02",
                    "name": "dds-efa6_replica_node_3",
                    "status": "normal",
                    "role": "Secondary",
                    "private_ip": "192.168.0.176",
                    "public_ip": "",
                    "spec_code": "dds.mongodb.s2.medium.4.repset",
                    "availability_zone": "bbb"
                  }
                ]
              }
            ],
            "enterprise_project_id": "0",
            "time_zone": "",
            "actions": [
            ]
          }
        ],
        "total_count": 24
      }

  2. 汇总查询结果。

    1. 参考1持续调用,如果查询的DDS实例列表为空,或者返回的body体中不存在instances字段,表明所有DDS实例查询完成。
    2. 汇总所有查询到的DDS实例即当前查询条件下的所有DDS实例。