Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying CMK Instances

Updated on 2022-02-22 GMT+08:00

Function

This API allows you to query CMK instances.

You can use the tag filtering function to query the detailed information about a specified CMK.

URI

  • URI format

    POST /v1.0/{project_id}/kms/resource_instances/action

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

Requests

Table 2 Request parameters

Parameter

Mandatory

Type

Description

tags

No

Array of objects

list of tags, including tag keys and tag values.
  • key indicates the tag key. A CMK can have a maximum of 10 keys, and each of them is unique and cannot be empty. A key cannot have duplicate values. The value of key contains a maximum of 36 characters.
  • value indicates the tag value. Each tag value can contain a maximum of 43 characters. The relationship between values is AND.

limit

No

String

Number of queried records. If action is set to count, this parameter does not need to be set. If action is set to filter, the default value is 10.

The value ranges from 1 to 1000.

offset

No

String

Index location. The query starts from the next piece of data indexed by this parameter. When data on the first page is queried, the value of this parameter queried on previous page is contained. If action is count, this parameter does not need to be set. If action is set to filter, the default value is 0.

The value must be a numeral and cannot be a negative number.

action

Yes

String

Operation ID, which can be set to filter or count.

  • filter: indicates filtering.
  • count: indicates the number of queried records.

matches

No

Array of objects

Search field.

  • key indicates the field to be matched, for example, resource_name.
  • value indicates the value to be matched, which contains a maximum of 255 characters and cannot be empty.

sequence

No

String

36-byte serial number of a request message

Example: 919c82d4-8046-4722-9094-35c3c6524cff

Responses

Table 3 Response parameters

Parameter

Mandatory

Type

Description

resources

Yes

Array of objects

Resource instance list. For details, see Table 4.

total_count

Yes

Integer

Total number of records

Table 4 resource field description

Parameter

Mandatory

Type

Description

resource_id

Yes

String

Resource ID

resource_detail

Yes

Object

Resource details. For details, see Table 4.

tags

Yes

Array of objects

Lists of tags. If there is no tag, the array is empty by default.

resource_name

Yes

String

Resource name. This parameter is an empty string by default.

Examples

The following example describes how to query key instances.

  • Example request
       {
              "offset": "100", 
              "limit": "100", 
              "action": "filter", 
              "matches":[
              {
                       "key": "resource_name", 
                       "value": "resource1"
                    }
               ], 
              "tags": [
                   {
                       "key": "key1", 
                       "values": [
                                "value1", 
                                "value2"
                       ]
                   }
              ]
         }
  • Example response
    { 
     "resources": [{
           "resource_id": "90c03e67-5534-4ed0-acfa-89780e47a535",
           "resource_detail": {
                  "key_id": "90c03e67-5534-4ed0-acfa-89780e47a535",
                  "domain_id": "4B688Fb77412Aee5570E7ecdbeB5afdc",
                  "key_alias": "tagTest_xmdmi",
                  "key_description": "123",
                  "creation_date": 1521449277000,
                  "scheduled_deletion_date": "",
                  "key_state": 2,
                  "default_key_flag": 0,
                  "key_type": 1
           },
           "resource_name": "tagTest_xmdmi",
           "tags": [{
                  "key": "$",
                  "value": "testValue!"
           }, {
                  "key": "1",
                  "value": "ccwZ"
           }, {
                  "key": "1&",
                  "value": "testValue!"
           }, {
                  "key": "abcd",
                  "value": "1&"
           }, {
                  "key": "efg",
                  "value": "1&"
           }, {
                  "key": "faregbqer",
                  "value": "AAaa00-99"
           }, {
                  "key": "fcwefwq",
                  "value": "$"
           }, {
                  "key": "fwqegqwrg",
                  "value": "1&"
           }, {
                  "key": "haha",
                  "value": "qzzahnzgoqbkabppdehnbrrgbrkvlxkkfoosqyhdylq"
           }, {
                  "key": "quapxpysduboguiluwargcgmvcgxinianbhl",
                  "value": "testValue!"
           }]
     }]
     "total_count": "1"}

    or

    {     
           "error": {        
           "error_code": "KMS.XXXX",         
           "error_msg": "XXX"     
            }
     }

Status Codes

Table 5 lists the normal status code returned by the response.
Table 5 Status codes

Status Code

Status

Description

200

OK

Request processed successfully.

Exception status code. For details, see Status Codes.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback