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

Listing Resources

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

Function

This API is used to list resources by tag. Resources are sorted by the time when they are created, in descending order.

URI

  • POST /v3/sfs/tms/{project_id}/file-systems/resource-instances/filter
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    The project ID. For details, see Obtaining a Project ID.

    limit

    No

    Int

    The number of records to be queried. The value ranges from 1 to 1000, and the default value is 1000.

    offset

    No

    Int

    The index location. The query starts from the next data record indexed by this parameter. The default value is 0, indicating that the query starts from the first data record. The value cannot be a negative number.

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Content-type

Yes

String

The MIME type of the request body.

Example: application/json

X-Auth-Token

No

String

The user token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

without_any_tag

No

boolean

Excludes any of the specified tags. If this parameter is set to true, all resources without tags are queried. In this case, the tags field is ignored. If this parameter is set to false or not specified, it does not take effect, which means that all resources are returned or resources are filtered by tags or matches.

tags

No

List<tag>

Includes specified tags. A maximum of 20 tags can be specified. Tag keys must be unique. Each tag key can have a maximum of 20 tag values. A tag value can be empty but the structure cannot be missing. Tag values of the same key 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 is in an OR relationship. If this parameter is not specified, all resources will be returned.

For details, see Table 3.

sys_tags

No

List<tag>

Contains system tags. This parameter is only available to users with the op_service permission.

This parameter cannot be used with filtering criteria without_any_tag and tags at the same time.

This field contains only one tag structure currently.

The key is fixed at _sys_enterprise_project_id.

The value is the ID of an enterprise project.

The key contains only one value. Value 0 indicates the default enterprise project.

For details, see Table 3.

matches

No

List<match>

The fields to be matched. The key in match is a dictionary value fixed at resource_name, meaning that the prefix search is performed based on the value of the key. It will be extended later.

For details, see Table 4.

Table 3 tag

Parameter

Mandatory

Type

Description

key

Yes

String

The tag key. A tag key can contain a maximum of 128 characters. It can contain letters, digits, and spaces representable in UTF-8 and special characters (_.:=+-@). It cannot start or end with a space and cannot be left empty. Tag keys starting with _sys_ are system tags, and you cannot start a tag key with _sys_.

values

Yes

List<String>

The tag value list. A value can be an empty array but cannot be left blank. If the list specified by values is empty arrays, any tag value can be queried. The values are in the OR relationship.

Table 4 match

Parameter

Mandatory

Type

Description

key

Yes

String

The key. The key is fixed at resource_name currently. Other key values will be available later.

value

Yes

String

The value. Each tag value can contain a maximum of 255 Unicode characters. The character set is not verified.

Response Parameters

Table 5 Response body parameters

Parameter

Mandatory

Type

Description

resources

Yes

List<resource>

The resource list. For details, see Table 6.

total_count

Yes

Integer

The total number of records.

Table 6 resource

Parameter

Mandatory

Type

Description

resource_id

Yes

String

The resource ID.

resource_detail

Yes

Object

The resource details. This value is left empty by default. The value is a resource object used for extension.

tags

Yes

List<resource_tag>

The tag list. If there is no tag, an empty array is used by default.

For details, see Table 3.

sys_tags

No

List<resource_tag>

This parameter is only available to users with the op_service permission.

This field contains only one resource_tag structure key currently.

The key is fixed at _sys_enterprise_project_id.

The value is the ID of the enterprise project. Value 0 indicates the default enterprise project.

For details, see Table 3.

resource_name

Yes

String

The resource name. This parameter is an empty string if there is no resource name.

Example Request

Listing resources (with the project ID set to **c80a2157ba1d46c0825265947342077c**, offset to **0**, and limit to **10**):

POST https://{endpoint}/v3/sfs/tms/c80a2157ba1d46c0825265947342077c/file-systems/resource-instances/filter?limit=10&offset=0

Request body example:

{
    "tags":[
        {
            "key":"key1",
            "values":[
                "value1",
                "value2"
            ]
        },
        {
            "key":"key2",
            "values":[
                "value1",
                "value2"
            ]
        }
    ],
    "matches":[
        {
            "key":"resource_name",
            "value":"resource1"
        }
    ],
    "without_any_tag":"false"
}

Example Response

{
    "resources":[
        {
            "resource_detail":"",
            "resource_id":"resouece1",
            "resource_name":"resouece1",
            "tags":[
                {
                    "key":"key1",
                    "value":"value1"
                }
            ],
            "sys_tags":[]
        }
    ],
    "total_count":1
}

Status Codes

  • Normal

Status Code

Description

200

Resources listed.

  • Abnormal

Status Code

Description

400

Invalid tag parameter.

401

Certification failed.

403

Authentication failed.

404

Resource not found.

500

System error.

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