This API is used to query the specified DB instances by tag.
A maximum of 20 tags can be added to a DB instance. The tag key must be unique.
Name |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
String |
Specifies the index position. The query starts from the next piece of data indexed by this parameter.
|
limit |
No |
String |
Specifies the number of resources to be queried.
|
action |
Yes |
String |
Specifies the operation identifier.
|
matches |
No |
Array of objects |
Specifies the search field.
|
tags |
No |
Array of objects |
Specifies the included tags. Each tag contains a maximum of 20 keys. For more information, see Table 3. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the tag key. It contains a maximum of 36 Unicode characters. key cannot be empty, an empty string, or spaces. Before using key, delete spaces before and after the value. NOTE:
The character set of this parameter is not verified in the search process. |
values |
Yes |
Array of strings |
Lists the tag values. Each value contains a maximum of 43 Unicode characters and cannot contain spaces. Before using values, delete spaces before and after the value. If the values are null, it indicates querying any value. The values are in OR relationship. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Specifies the query criteria. The value can be instance_name or instance_id, indicating that the query is based on the instance name or instance ID. |
value |
Yes |
String |
Specifies the name or ID of the DB instance to be matched. You can call the API for querying DB instances to obtain the DB instance name or ID. If you do not have an instance, you can call the API used for creating an instance. |
POST https://dds.eu-de.otc.t-systems.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/action
Query specified DB instances by tag.
{ "offset": "100", "limit": "100", "action": "filter", "matches": [ { "key": "instance_name", "value": "test-single" } ], "tags": [ { "key": "key1", "values": [ "value1", "value2" ] } ] }
{ "action": "count", "tags": [ { "key": "key1", "values": [ "value1", "value2" ] }, { "key": "key2", "values": [ "value1", "value2" ] } ], "matches": [ { "key": "instance_name", "value": "test-single" }, { "key": "instance_id", "value": "958693039f284d6ebfb177375711072ein02" } ] }
Name |
Type |
Description |
---|---|---|
instances |
Array of objects |
Indicates the instance list. For details, see Table 6. |
total_count |
Integer |
Indicates the total number of queried records. |
Name |
Type |
Description |
---|---|---|
instance_id |
String |
Indicates the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance. |
instance_name |
String |
Indicates the DB instance name. |
tags |
Array of objects |
Indicates the tag list. If there is no tag in the list, tags is taken as an empty array. For more information, see Table 7. |
Name |
Type |
Description |
---|---|---|
key |
String |
Indicates the tag key. The value contains 36 Unicode characters and cannot be blank. Character set: 0-9, A-Z, a-z, "_", "-", and "@". |
value |
String |
Indicates the tag value. The value contains a maximum of 43 Unicode characters and can also be an empty string. Character set: 0-9, A-Z, a-z, "_", "-", and "@". |
1. Return specified DB instances by tag.
{ "instances": [ { "instance_id": "2acbf2223caf3bac3c33c6153423c3ccin02", "instance_name": "test-single", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value1" } ] } ] }
2. Number of returned records.
{ "total_count": 4 }
For more information, see Error Code.