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
Situation Awareness
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 EIPs by Tag

Updated on 2024-04-18 GMT+08:00

Function

This API is used to query EIPs by tag.

URI

POST /v2.0/{project_id}/publicips/resource_instances/action

Table 1 describes the parameters.

Table 1 Parameter description

Name

Mandatory

Description

project_id

Yes

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

Request Message

  • Request parameter
    Table 2 Request parameter

    Parameter

    Type

    Mandatory

    Description

    tags

    Array of tags objects

    No

    Specifies the included tags. A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The structure body must be included. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique.

    limit

    Integer

    No

    Sets the page size. 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

    Integer

    No

    Specifies the index position. The query starts from the next piece of data indexed by this parameter. This parameter is not required when you query data on the first page. The value in the response 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

    String

    Yes

    Specifies the operation to perform. The value can only be filter (filtering) or count (querying the total number).

    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

    Array of match objects

    No

    Specifies the search criteria. The tag key is the field to match. Currently, only resource_name is supported. The tag value indicates the matched value. This field is a fixed dictionary value.

    Table 3 Description of the tags field

    Name

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key. The value can contain a maximum of 127 Unicode characters. The tag key cannot be left blank. (This parameter is not verified during the search process.)

    values

    Yes

    Array of strings

    Specifies the tag value list. Each value can contain a maximum of 255 Unicode characters. An empty list for values indicates any value. The values are in the OR relationship.

    Table 4 Description of the match field

    Name

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key. Currently, the tag key can only be the resource name.

    value

    Yes

    String

    Specifies the tag value. Each value can contain a maximum of 255 Unicode characters.

  • Example request 1: Setting action to filter
    POST https://{Endpoint}/v2.0/{project_id}/publicips/resource_instances/action
    
    {
        "offset": "0",
        "limit": "100",
        "action": "filter",
        "matches": [
            {
                "key": "resource_name",
                "value": "resource1"
            }
        ],
        "tags": [
            {
                "key": "key1",
                "values": [
                    "*value1",
                    "value2"
                ]
            }
        ]
    }
  • Example request 2: Setting action to count
    {
        "action": "count",
        "tags": [
            {
                "key": "key1",
                "values": [
                    "value1",
                    "value2"
                ]
            },
            {
                "key": "key2",
                "values": [
                    "value1",
                    "value2"
                ]
            }
        ],
        "matches": [
            {
                "key": "resource_name",
                "value": "resource1"
            }
        ]
    }

Response Message

  • Response parameter
    Table 5 Response parameter

    Name

    Type

    Description

    resources

    Array of resource objects

    Specifies the resource object list. For details, see Table 6.

    total_count

    Integer

    Specifies the total number of query records.

    Table 6 resource objects

    Name

    Type

    Description

    resource_id

    String

    Specifies the resource ID.

    resource_detail

    Object

    Specifies the resource details. Resource details are used for extension. This parameter is left blank by default.

    tags

    Array of tags objects

    Specifies the tag list. This parameter is an empty array by default if there is no tag. For details, see Table 7.

    resource_name

    String

    Specifies the resource name. This parameter is an empty string by default if there is no resource name.

    Table 7 Description of the tags field

    Name

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key. The value can contain a maximum of 127 Unicode characters. The tag key cannot be left blank. (This parameter is not verified during the search process.)

    value

    Yes

    String

    Specifies the tag value list. Each value can contain a maximum of 255 Unicode characters. An empty list for values indicates any value. The values are in the OR relationship.

  • Example response 1: Setting action to filter
    { 
          "resources": [
             {
                "resource_detail": null, 
                "resource_id": "cdfs_cefs_wesas_12_dsad", 
                "resource_name": "resouece1", 
                "tags": [
                    {
                       "key": "key1",
                       "value": "value1"
                    },
                    {
                       "key": "key2",
                       "value": "value1"
                    }
                 ]
             }
           ], 
          "total_count": 1000
    }
  • Example response 2: Setting action to count
    {
           "total_count": 1000
    }

Status Code

See Status Codes.

Error Code

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback