Querying Number of Resource Instances by Resource Type and Tag
Function
This API is used to query the number of resource instances by resource type and tag.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
organizations:resources:countByTag
List
-
-
-
-
URI
POST /v1/organizations/{resource_type}/resource-instances/count
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_type |
Yes |
String |
Resource type. It can be organizations:policies, organizations:ous, organizations:accounts, or organizations:roots. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Security-Token |
No |
String |
Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required. |
|
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 TagsDTO objects |
A maximum of 10 keys can be queried at a time, and each key can contain a maximum of 10 values. The structure body must be included. The tag key cannot be left blank or be an empty string. Each key must be unique, and each value for a key must be unique. Resources that contain all keys and one or multiple values listed in tags will be found and returned. If no tag filtering criteria is specified, all data is returned. |
|
matches |
No |
Array of Match objects |
Search field. key indicates the field to be matched, for example, organizational-unit. The tag value indicates the value to be matched. The key is a fixed dictionary value and cannot contain duplicate keys or unsupported keys. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_count |
Integer |
Total number of records. |
Example Requests
Querying the number of resource instances by resource type and tag
POST /v1/organizations/{resource_type}/resource-instances/count
{
"without_any_tag" : true,
"tags" : [ {
"key" : "string",
"values" : [ "string" ]
} ],
"matches" : [ {
"key" : "string",
"value" : "string"
} ]
}
Example Responses
Status code: 200
Successful
{
"total_count" : 0
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Successful |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot