Updated on 2025-11-28 GMT+08:00

Querying the CA Quantity by Tag

Function

This API is used to query the number of CAs by 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, no identity policy-based permission required for calling this API.

URI

POST /v1/private-certificate-authorities/resource-instances/count

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. For details, see [Obtaining a User Token] (https://support.huaweicloud.com/intl/en-us/api-iam/iam_30_0001.html).

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of DomainTags objects

Tag list.

The list contains a maximum of 20 keys with each containing no more than 20 values. A key can have empty arrays, but must have the complete structure. Each tag key must be unique, and each tag value in a tag must be unique. The response returns resources containing all tags in this list. Keys in this list are in an AND relationship while values in each key-value structure are in an OR relationship. If no filtering condition is specified, full data is returned.

Array Length: 1 - 20

limit

No

Integer

Records on each page. The values can be:

  • 10: Each page contains 10 resource records.

  • 20: Each page contains 20 resource records.

  • 50: Each page contains 50 resource records.

Minimum: 10

Maximum: 50

Default: 10

offset

No

Integer

Index position. The query will start from the next records from the position specified by offset.

Minimum: 0

Default: 0

matches

No

Array of ResourceTag objects

The key-value pair to be matched.

The tag key indicates the field to be matched, such as resource_name. The tag value indicates the value to be matched. The key is a fixed dictionary value and cannot be a duplicate key or unsupported key.

Array Length: 0 - 20

Table 3 DomainTags

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

It can contain letters in Chinese, Spanish, or Portuguese, digits, spaces, and the following characters in UTF-8 format: _ . : = + - @

Minimum: 1

Maximum: 128

values

Yes

Array of strings

Tag value list.

Each value can contain letters in Chinese, Spanish, or Portuguese, digits, spaces, and the following characters in UTF-8 format: _ . : = + - @

Minimum: 0

Maximum: 255

Array Length: 1 - 20

Table 4 ResourceTag

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

It can contain letters in Chinese, Spanish, or Portuguese, digits, spaces, and the following characters in UTF-8 format: _ . : = + - @

Minimum: 1

Maximum: 128

value

Yes

String

Tag value.

It can contain letters in Chinese, Spanish, or Portuguese, digits, spaces, and the following characters in UTF-8 format: _ . : / = + - @

Minimum: 0

Maximum: 255

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

total_count

Integer

Total number of records.

Minimum: 0

Maximum: 100

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Example Requests

When you call this API, a token with the permission to use this API is mandatory for the X-Auth-Token field.

POST https://ccm.cn-north-4.myhuaweicloud.com/v1/private-certificate-authorities/resource-instances/count

{
  "tags" : [ {
    "key" : "key1",
    "values" : [ "value1", "value2" ]
  } ]
}

Example Responses

Status code: 200

Request succeeded.

{
  "total_count" : 1
}

Status code: 400

Invalid request parameters.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 401

Token required for the requested page.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 403

Authentication failed.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 404

No resources available or found.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 500

Internal service error.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameters.

401

Token required for the requested page.

403

Authentication failed.

404

No resources available or found.

500

Internal service error.

Error Codes

See Error Codes.