Help Center/ Storage Disaster Recovery Service/ API Reference/ SDRS APIs/ Tag Management/ Querying Tags of All Protected Instances in a Specified Project
Updated on 2023-11-21 GMT+08:00

Querying Tags of All Protected Instances in a Specified Project

Function

This API is used to query all resource tags of a protected instance in a specified project.

URI

  • URI format

    GET /v1/{project_id}/protected-instances/tags

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID.

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

Request

  • Request parameters

    None

  • Example request

    GET https://{Endpoint}/v1/{project_id}/protected-instances/tags

Response

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    tags

    Yes

    Array of objects

    Specifies the tag list.

    For details, see Table 1.

    Table 1 Data structure of the tag field

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key. The tag key of a resource must be unique.

    It can contain up to 36 Unicode characters. The key cannot be left blank or be an empty string. It cannot contain non-printable ASCII characters (0–31) or special characters, including asterisks (*), left angle brackets (<), right angle brackets (>), backslashes (\), equal signs (=), commas (,), vertical bars (|), and slashes (/). The key cannot be left blank, and must be unique for each resource.

    values

    Yes

    Array of strings

    Lists the tag values.

    It can contain up to 43 Unicode characters. The value cannot be left blank but can be an empty string. It cannot contain non-printable ASCII characters (0–31) or special characters, including asterisks (*), left angle brackets (<), right angle brackets (>), backslashes (\), equal signs (=), commas (,), vertical bars (|), and slashes (/).

  • Example response
    {
        "tags": [
            {
                "key": "key1",
                "values": [
                    "value1",
                    "value2"
                ]
            },
            {
                "key": "key2",
                "values": [
                    "value1",
                    "value2"
                ]
            }
        ]
    }

Returned Value

  • Normal

    Returned Value

    Description

    200

    OK

  • Abnormal

    Returned Value

    Description

    400

    Invalid parameters.

    401

    Authentication failed.

    403

    Insufficient permission.

    404

    The requested resource was not found.

    500

    Internal service error.