You are not logged in.
ListInstances
This API is used to query DB instances and details based on specified conditions.
Name | Type | IN | Mandatory | Description |
---|---|---|---|---|
x-auth-token | string | header | Yes | Specifies the user token obtained from the IAM service. |
project_id | string | path | Yes | Specifies the project ID of a tenant in a region. |
tags | string | query | No | Query based on the instance tag key and value. {key} indicates the tag key, and {value} indicates the tag value. A maximum of 20 key-value pairs are supported. The key cannot be empty or duplicate, but the value can be empty. To query instances with multiple tag keys and values, separate key-value pairs with commas (,). |
limit | integer | query | No | Specifies the maximum allowed number of DB instances. The value ranges from 1 to 100. If this parameter is not transferred, the first 100 DB instances are queried by default. |
offset | integer | query | No | Specifies the index position. The query starts from the next instance creation time indexed by this parameter under a specified project. If offset is set to N, the resource query starts from the N+1 piece of data. The value must be greater than or equal to 0. If this parameter is not transferred, offset is set to 0 by default, indicating that the query starts from the latest created DB instance. |
subnet_id | string | query | No | Specifies the network ID of the subnet. |
vpc_id | string | query | No | Specifies the VPC ID. |
datastore_type | string | query | No | Specifies the database type. The value is DDS-Community. |
mode | string | query | No | Specifies the instance type.
|
name | string | query | No | Querying DB Instances If you use asterisk (*) at the beginning of the name, fuzzy search results are returned. Otherwise, the exact results are returned.
|
id | string | query | No | Specifies the instance ID, which can be obtained by calling the API for querying instances and details. If you do not have an instance, you can call the API used for creating an instance. |
Success.
Name | Type | Description |
---|---|---|
instances | Array of QueryInstanceResponse objects | Indicates the DB instance information. |
total_count | integer | Indicates the total number of queried records. |
Name | Type | Description |
---|---|---|
id | string | Indicates the DB instance information. |
name | string | Indicates the DB instance name. |
remark | string | Indicates the DB instance remark. |
status | string | Indicates the DB instance status. Valid value:
|
port | string | Indicates the database port number. The port range is 2100 to 9500. |
mode | string | Indicates the instance type, which is the same as the request parameter. |
region | string | Indicates the region where the DB instance is deployed. |
datastore | DatastoreItem object | Indicates the database information. |
engine | string | Indicates the storage engine. The value is wiredTiger. |
created | string | Indicates the DB instance creation time. |
updated | string | Indicates the time when a DB instance is updated. |
db_user_name | string | Indicates the default username. The value is rwuser. |
ssl | integer | Indicates that SSL is enabled or not.
|
vpc_id | string | Indicates the VPC ID. |
subnet_id | string | Indicates the network ID of the subnet. |
security_group_id | string | Indicates the security group ID. |
backup_strategy | BackupStrategyForItemResponse object | Indicates the backup policy. |
pay_mode | string | Indicates the billing mode.
|
maintenance_window | string | Indicates the maintenance time window. |
groups | Array of GroupResponseItem objects | Indicates group information. |
disk_encryption_id | string | Indicates the disk encryption key ID. |
enterprise_project_id | string | Indicates the enterprise project ID. If the value is 0, the resource belongs to the default enterprise project. |
time_zone | string | Indicates the time zone. |
dss_pool_id | string | Indicates the DSS storage pool ID of the DeC user. |
actions | Array of strings | Indicates the operation that is executed on the DB instance. |
order_id | string | Indicates the order ID. |
tags | Array of TagResponse objects | Indicates the tag list. |
Name | Type | Description |
---|---|---|
type | string | Indicates the DB engine. |
version | string | Indicates the database version. |
patch_available | boolean | whether there is a patch available for upgrading the instance. If true is returned, the instance can be upgraded using a patch. |
Name | Type | Description |
---|---|---|
start_time | string | Indicates the backup time window. Automated backups will be triggered during the backup time window. The current time is the UTC time. |
keep_days | integer | Indicates the number of days to retain the generated backup files. The value range is from 0 to 732. |
Name | Type | Description |
---|---|---|
type | string | Indicates the node type. Valid value:
|
id | string | Indicates the group ID. This parameter is valid only when the node type is shard or config. |
name | string | Indicates the group name. This parameter is valid only when the node type is shard or config. |
status | string | Indicates the group status. This parameter is valid only when the node type is shard or config. |
volume | Volume object | Indicates the volume information. This parameter is valid only when the node type is shard, config, replica, or single. |
nodes | Array of NodeItem objects | Indicates node information. |
Name | Type | Description |
---|---|---|
size | string | Indicates the disk size. Unit: GB |
used | string | Indicates the disk usage. Unit: GB |
Name | Type | Description |
---|---|---|
id | string | Indicates the node ID. |
name | string | Indicates the node name. |
status | string | Indicates the node status. |
role | string | Indicates the node role. Valid value:
|
private_ip | string | Indicates the private IP address of a node.By default, this parameter is valid only for mongos nodes, replica set instances, and single node instances. The value exists only after ECSs are created successfully. Otherwise, the value is "". |
public_ip | string | Indicates the EIP that has been bound. The value is "". This parameter is valid only for mongos nodes of cluster instances, primary nodes and secondary nodes of replica set instances, and single node instances. |
spec_code | string | Indicates the resource specification code. |
availability_zone | string | Indicates the AZ. |
Name | Type | Description |
---|---|---|
key | string | Indicates the tag key. |
value | string | Indicates the tag value. |
Client or server error.
Name | Type | Description |
---|---|---|
error_code | string | Specifies the error returned when a task submission exception occurs. |
error_msg | string | Specifies the description of the error returned when a task submission exception occurs. |
"GET https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances"
Success.
{
"instances": [
{
"id": "8436a91546294036b75931e879882200in02",
"name": "dds-efa6",
"remark": "test",
"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.s2.medium.4.shard",
"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.s2.medium.4.shard",
"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.s2.medium.4.shard",
"availability_zone": "bbb"
}
]
},
"enterprise_project_id": "0",
"time_zone": "",
"dss_pool_id": "f5f84ed7-6f19-4bd4-99d7-b450ad6cc4dd",
"actions": [
"CREATE"
],
"tags": [
{
"key": "dds001",
"value": "dds001"
}
]
},
{
"id": "d77905385f114217b75ae7d6ab9a7588in02",
"name": "dds-5699",
"status": "normal",
"remark": "测试",
"port": 8635,
"mode": "Single",
"region": "aaa",
"datastore": {
"type": "DDS-Community",
"version": "3.4"
},
"engine": "wiredTiger",
"created": "2019-01-17T07:04:39",
"updated": "2019-01-17T07:04:33",
"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": "17:00-18:00",
"keep_days": 7
},
"pay_mode": 0,
"maintenance_window": "02:00-06:00",
"groups": {
"type": "single",
"volume": {
"size": 10,
"used": 0.33
},
"nodes": [
{
"id": "bd4dccbd53ae48d5bd3046bebf715079no02",
"name": "dds-5699_single_node_1",
"status": "normal",
"role": "Primary",
"private_ip": "192.168.0.9",
"public_ip": "",
"spec_code": "dds.mongodb.c6.medium.4.single",
"availability_zone": "bbb"
}
]
},
"enterprise_project_id": "0",
"time_zone": "",
"actions": [
"CREATE"
],
"tags": [
{
"key": "dds001",
"value": "dds001"
}
]
},
{
"id": "9136fd2a9fcd405ea4674276ce36dae8in02",
"name": "dds-32f4",
"remark": 123,
"status": "normal",
"port": 8635,
"mode": "Sharding",
"region": "aaa",
"datastore": {
"type": "DDS-Community",
"version": "3.4",
"patch_available": false
},
"engine": "wiredTiger",
"created": "2019-01-17T07:04:37",
"updated": "2019-01-17T07:04:31",
"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": "19:00-20:00",
"keep_days": 7
},
"pay_mode": 0,
"maintenance_window": "02:00-06:00",
"groups": [
{
"type": "mongos",
"nodes": [
{
"id": "a742c13a284949adad177672e8a0f01cno02",
"name": "dds-32f4_mongos_node_1",
"status": "normal",
"role": "Primary",
"private_ip": "192.168.0.56",
"public_ip": "",
"spec_code": "dds.mongodb.c6.medium.4.mongos",
"availability_zone": "bbb"
},
{
"id": "d4f66666b1d64ab28719da0526341c7eno02",
"name": "dds-32f4_mongos_node_2",
"status": "normal",
"role": "Primary",
"private_ip": "192.168.0.185",
"public_ip": "",
"spec_code": "dds.mongodb.c6.medium.4.mongos",
"availability_zone": "bbb"
}
]
},
{
"type": "shard",
"volume": {
"size": 10,
"used": 0.33
},
"nodes": [
{
"id": "0e9abaebe5974b63a5b221de6ee34cfeno02",
"name": "dds-32f4_shard_2_node_3",
"status": "normal",
"role": "Primary",
"spec_code": "dds.mongodb.c6.medium.4.shard",
"availability_zone": "bbb"
},
{
"id": "1d7f4c5476c04cc187f920925c2b601fno02",
"name": "dds-32f4_shard_2_node_2",
"status": "normal",
"role": "Hidden",
"spec_code": "dds.mongodb.c6.medium.4.shard",
"availability_zone": "bbb"
},
{
"id": "3dd2cce03da54fc08f10651cbfea778dno02",
"name": "dds-32f4_shard_2_node_1",
"status": "normal",
"role": "Secondary",
"spec_code": "dds.mongodb.c6.medium.4.shard",
"availability_zone": "bbb"
}
]
},
{
"type": "config",
"volume": {
"size": 10,
"used": 0.33
},
"nodes": [
{
"id": "7422f7331b714ac39aa647a1ec968d33no02",
"name": "dds-32f4_config_node_2",
"status": "normal",
"role": "Primary",
"spec_code": "dds.mongodb.c6.large.2.config",
"availability_zone": "bbb"
},
{
"id": "9e3b343151044eda91ddb8a42ae5cbefno02",
"name": "dds-32f4_config_node_3",
"status": "normal",
"role": "Hidden",
"spec_code": "dds.mongodb.c6.large.2.config",
"availability_zone": "bbb"
},
{
"id": "c0053ca460ac4889841ffb14a886ec54no02",
"name": "dds-32f4_config_node_1",
"status": "normal",
"role": "Secondary",
"spec_code": "dds.mongodb.c6.large.2.config",
"availability_zone": "bbb"
}
]
}
],
"enterprise_project_id": "0",
"time_zone": "",
"actions": [
"CREATE"
],
"tags": [
{
"key": "dds001",
"value": "dds001"
}
]
}
],
"total_count": 3
}