• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. OpenStack Nova APIs
  5. Metadata Management
  6. Querying ECS Metadata

Querying ECS Metadata

Function Description

This interface is used to query ECS metadata.

URI

GET /v2/{project_id}/servers/{server_id}/metadata

GET /v2.1/{project_id}/servers/{server_id}/metadata

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.

NOTE:

Pagination query is not supported.

Request

N/A

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Mandatory

Description

User-defined

String

Yes

Specifies the metadata key-value pair.

Examples

  • Example request
    GET /v2/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2/metadata
    GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2/metadata
  • Example response
    {
        "metadata": {
            "wj": "True"
        }
    }

Returned Values

See General Request Returned Values.