Querying Resource Shares by Tag
Function
This API is used to query resource shares by tag.
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Security-Token |
No |
String |
Security token (session token) for temporary security credentials. This parameter is mandatory when you make an API call using temporary security credentials. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
without_any_tag |
No |
Boolean |
If this parameter is set to true, all resources without tags are queried. |
tags |
No |
Array of TagFilter objects |
A maximum of 20 keys can be queried at a time, and each key can contain a maximum of 20 values. The structure body must be included. The tag key cannot be left blank or be an empty string. Each tag key must be unique, and each tag value for a key must be unique. Resources with all tags listed in tags will be returned. Keys in this list are in an AND relationship while values in each key-value structure are in an OR relationship. If no tag filtering criteria is specified, all data is returned. |
matches |
No |
Array of Match objects |
Search field. The tag key is the field to be matched, for example, resource_name. The tag value indicates the value to be matched. The key is a fixed dictionary value and cannot contain duplicate keys or unsupported keys. Check whether fuzzy match is required based on the key value. For example, if key is set to resource_name, prefix search is performed. If value is empty, exact match is performed. Most services do not have resources without names. In this case, an empty list is returned. For search by resource_id, exact match is used. Only resource_name is supported currently. More fields will be supported later. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
resources |
Array of ResourceDTO objects |
List of resources. |
total_count |
Integer |
Total number of records. |
Parameter |
Type |
Description |
---|---|---|
resource_id |
String |
Resource ID. |
resource_name |
String |
Resource name. |
tags |
Array of Tag objects |
List of resource tags. |
resource_detail |
Object |
Resource details. |
Example Requests
Querying resource shares by tag
POST https://{endpoint}/v1/resource-shares/resource-instances/filter { "without_any_tag" : true, "tags" : [ { "key" : "string", "values" : [ "string" ] } ], "matches" : [ { "key" : "string", "value" : "string" } ] }
Example Responses
Status code: 200
Request succeeded.
{ "resources" : [ { "resource_id" : "string", "resource_name" : "string", "resource_detail" : { }, "tags" : [ { "key" : "string", "value" : "string" } ] } ], "total_count" : 0 }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.