Querying the Certificate List by Tag
Function
This API is used to query the certificate list by a specific 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.
URI
POST /v1/private-certificates/resource-instances/filter
Request 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). |
|
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: 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 |
|
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 |
|
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
|
Parameter |
Type |
Description |
|---|---|---|
|
total_count |
Integer |
Total number of records. Minimum: 0 Maximum: 100 |
|
resources |
Array of TagResource objects |
Resource instance list. For details, see the data structure of the TagResource field. Array Length: 0 - 100 |
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_id |
String |
Specifies the resource ID. Minimum: 0 Maximum: 63 |
|
resource_detail |
Object |
Specifies resource details. |
|
tags |
Array of ResourceTag objects |
Tag list. If there is no tag in the list, an empty array is returned. Array Length: 0 - 100 |
|
resource_name |
String |
Resource name. This parameter is an empty string by default. Minimum: 0 Maximum: 63 |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
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 |
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 |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
|
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
|
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
|
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
|
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 500
|
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-certificates/resource-instances/filter
{
"tags" : [ {
"key" : "key1",
"values" : [ "value1", "value2" ]
} ]
}
Example Responses
Status code: 200
Request succeeded.
{
"total_count" : 1,
"resources" : [ {
"resource_id" : "61e1f947-8794-4574-82bd-14fd0cd3af67"
}, {
"resource_name" : "test"
}, {
"resource_detail" : [ {
"certificate_id" : "61e1f947-8794-4574-82bd-14fd0cd3af67",
"create_time" : 1681436805000,
"delete_time" : null,
"distinguished_name" : {
"country" : "CN",
"state" : "guangdong",
"locality" : "shenzhen",
"organization" : "Huawei",
"organizational_unit" : "IT",
"common_name" : "Huawei IT Root CA"
},
"enc_cert_info" : null,
"enterprise_project_id" : "0",
"freeze_flag" : 0,
"gen_mode" : "GENERATE",
"issuer_id" : "93fcdaf2-c094-4f39-9cbc-bcacd0baac48",
"issuer_name" : "test",
"key_algorithm" : "RSA2048",
"not_before" : 1681436805000,
"not_after" : 1713059205000,
"path_length" : 7,
"serial_number" : "202203070322544291829058",
"signature_algorithm" : "SHA256",
"status" : "ISSUED"
} ]
}, {
"tags" : [ {
"key" : "key1",
"value" : "value1"
} ]
} ]
}
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.