El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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
Help Center/ MapReduce Service/ API Reference (Paris Region)/ API V1.1/ Tag Management APIs/ Querying a List of Clusters with Specified Tags

Querying a List of Clusters with Specified Tags

Updated on 2022-12-14 GMT+08:00

Function

This API is used to filter clusters by tag.

By default, clusters and tags are sorted in descending order of creation time.

URI

  • Format

    POST /v1.1/{project_id}/clusters/resource_instances/action

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

Request

Table 2 Request parameter description

Parameter

Mandatory

Type

Description

tags

No

List<tag>

The return result contains resources corresponding to all tags in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string.

tags_any

No

List<tag>

The return result contains resources corresponding to any tag in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique.

not_tags

No

List<tag>

The return result does not contain resources corresponding to all tags in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique.

not_tags_any

No

List<tag>

The return result does not contain resources corresponding to any tag in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique.

limit

No

String

Number of records. This parameter is not available when action is set to count. The default value is 1000 when action is set to filter. The maximum value is 1000, and the minimum value is 1. The value cannot be a negative number.

offset

No

String

Index position. The query starts from the next piece of data specified by the offset parameter. This parameter is not required when you query data on the first page. The value in the response body returned for querying data on the previous page will be included in this parameter for querying data on subsequent pages. This parameter is not available when action is set to count. If action is set to filter, the value must be a number, and the default value is 0. The value cannot be a negative number.

action

Yes

String

Operation to be performed. The value can be filter or count.

The value filter indicates pagination query. The value count indicates that the total number of query results meeting the search criteria will be returned.

matches

No

List<match>

Search field. key indicates the field to be matched, for example, resource_name. value indicates the matched value. This field is a fixed dictionary value.

Determine whether fuzzy match is required based on different fields. For example, if key is resource_name, fuzzy search is used by default. If value is an empty string, exact match is used.

Table 3 tag field description

Parameter

Mandatory

Type

Description

key

Yes

String

Key. It contains a maximum of 127 Unicode characters. It cannot be left empty. (This parameter is not verified in the search process.)

values

Yes

List<String>

List of values. A value contains a maximum of 255 Unicode characters.

If the values are null, it indicates any_value. The relationship between values is OR. By default, only the first value is used for search.

Table 4 match field description

Parameter

Mandatory

Type

Description

key

Yes

String

Key. The value is fixed to resource_name, indicating a cluster name.

value

Yes

String

Value. A value contains a maximum of 64 Unicode characters. Enter a cluster name.

Response

Table 5 Response parameter description

Parameter

Type

Description

resources

Array of objects

Resource details. For details, see Table 6.

total_count

Integer

Total number of resources.

Table 6 resources parameters

Parameter

Type

Description

resource_detail

String

Resource details.

resource_id

String

Resource ID.

resource_name

String

Resource name.

tags

objects

Tag list. For details, see Table 7.

Table 7 tags parameter description

Parameter

Type

Description

key

String

Key. A tag key cannot contain special characters (=*<>\,|/) or start or end with a space.

value

String

Tag value. A tag value cannot contain special characters (=*<>\,|/) or start or end with a space.

Example

  • Example request

    Request body when action is set to filter

    {
      "offset": "100", 
      "limit": "100", 
    "action": "filter", 
      "matches":[
    {
            "key": "resource_name", 
            "value": "clusterA"
           }
    ], 
       "not_tags": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ], 
      "tags": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ], 
      "tags_any": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ],
    "not_tags_any": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ]
    }

    Request body when action is set to count

    {
      "action": "count", 
      "not_tags": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ], 
      "tags": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        },
      {
          "key": "key2", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ], 
      "tags_any": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
      ],
    "not_tags_any": [
        {
          "key": "key1", 
          "values": [
            "value1", 
            "value2"
          ]
        }
       ],
    "matches":[
    {
            "key": "resource_name", 
            "value": "clusterA"
           }
    ]
    }
  • Example response

    Response body when action is set to filter

        { 
          "resources": [
             {
                "resource_detail": null, 
                "resource_id": "cdfs_cefs_wesas_12_dsad", 
                "resource_name": "clusterA"
             }
           ]
          "total_count": 1000
    }

    Response body when action is set to count

    {
           "total_count": 1000
    }

Status Code

Table 8 describes the status code of this API.

Table 8 Status code

Status Code

Description

200

The operation is successful.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback