Querying the DB Instance List
Scenarios
This section describes how to call the API described in Querying Instances and Details to query all DDS DB instances of a tenant using pagination parameters.
Procedure
- Configure parameters limit and offset.
- API information
URI format: 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}
- Obtain {endpoint} from Regions and Endpoints.
- {limit} can be adjusted based on the DDS DB instance data.
- For details, see Querying Instances and Details.
- Example request
- Response example
{ "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 }
- API information
- Collect query results.
- Repeat 1 until the returned query result is empty or the returned body does not contain the instances field. This indicates that all DDS instances have been queried.
- Collect all of the queried DDS instances.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot