• Elastic Cloud Server

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

Querying Tags of an ECS

Function Description

  • This interface is used to query the tags of the specified ECS.
  • The Tag Management Service (TMS) uses this interface to query all tags of an ECS.

URI

GET /v1/{project_id}/servers/{server_id}/tags

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

N/A

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

tags

List<resource_tag>

Specifies the tag list.

Table 3 resource_tag field description

Parameter

Type

Description

key

String

Specifies the tag key.

value

String

Specifies the tag value.

Examples

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

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.