Updated on 2026-03-18 GMT+08:00

Listing Project Tags

Function

Projects are used to group and isolate OpenStack resources, which include computing, storage, and network resources. A project can be a department or a team. Multiple projects can be created for the same account.

This API is used to list all tags attached to a specified project.

URI

GET /v1/{project_id}/cloudservers/tags

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Definition

Specifies the project ID.

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

Constraints

N/A

Range

N/A

Default Value

N/A

Request

None

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

tags

Array of objects

Definition

Specifies the tag list. For details, see Table 3.

Range

A maximum of 20 tags are supported. They cannot start with _sys_.

Table 3 tag field description

Parameter

Type

Description

key

String

Definition

Specifies the tag key.

Range

  • It cannot be left blank.
  • It must be unique for each resource.
  • A maximum of 128 characters are supported.
  • Only uppercase letters, lowercase letters, digits, hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF) are supported.
  • The following special characters are not supported: =*<>\,|/

values

Array of strings

Definition

Specifies the tag value.

Range

  • Can be left blank.
  • A maximum of 255 characters are supported.
  • Only uppercase letters, lowercase letters, digits, periods (.), hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF) are supported.
  • The following special characters are not supported:: =*<>\,|

Example Request

List all tags attached to a specified project.

GET https://{endpoint}/v1/{project_id}/cloudservers/tags

Example Response

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

Error Codes

See Error Codes.