• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. Tag Management
  6. Querying Project Tags

Querying Project Tags

Function Description

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 under one account.

This interface is used to query all tags used by a user in a specified project.

URI

GET /v1/{project_id}/servers/tags

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

N/A

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

tags

List<tag>

Specifies tags.

Table 3 tag field description

Parameter

Type

Description

key

String

Specifies the tag key.

  • It contains a maximum of 36 Unicode characters.
  • Can only consist of digits, letters, hyphens (-), and underscores (_).

values

List<String>

Specifies the tag value.

  • Each value contains a maximum of 43 Unicode characters.
  • This field can be left blank.
  • Can only consist of digits, letters, hyphens (-), and underscores (_).

Examples

  • Example request
    GET /v1/{project_id}/servers/tags
  • Example response
    {
          "tags": [
            {
                "key": "key1",
                "values": [
                    "value1",
                    "value2"
                ]
            },
            {
                "key": "key2",
                "values": [
                    "value1",
                    "value2"
                ]
            }
        ]
    }

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.