Show server metadata item details

Overview

Shows details for a metadata item by key for a specified server.

Classification

  • Show

API Operation Object

  • metadata

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/servers/{server_id}/metadata/{metadata_key}

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress(optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional
tenant_id URI UUID The tenant ID in a multi-tenancy cloud. required
server_id URI UUID The UUID for the server. required
metadata_key URI String(1-255 characters) key for metadata Server Metadata. required

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Code

Response Codes
response code condition
200, 203 normal end
400 computeFault
- badRequest
401 unauthorized
403 forbidden
404 itemNotFound
405 badMethod
413 overLimit
500 computeFault
503 serviceUnavailable

HTTP Response Body

Format

{
    "meta": {
        "<metadata_key>": "<metadata_value>"
    }
}

Response Parameter

Response Parameters
item format description
X-Compute-Request-ID String Returns a unique identifier to provide tracking for the request. The request ID that is associated with the request appears in the log lines for that request. By default, the middleware configuration ensures that the request ID appears in the log files.
metadata_key String(1-255 characters) key for metadata Server Metadata
metadata_value String(1-255 characters) value for metadata Server Metadata

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/servers/{server_id}/metadata/{metadata_key}

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Body

{
    "meta": {
        "foo": "Bar Value"
    }
}

Execution Example

HTTP Request

GET /v2/2ef31c2ff36a4d37841b28c63b14b65e/servers/2251d4b7-bc74-4bac-bccf-91b92a279813/metadata/key1 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
Content-Type: application/json
Accept: application/json
X-Auth-Token: 3b4feed6a89349f1beddc46243679d2b

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 26
X-Compute-Request-Id: req-f126a9fe-6ac1-4b83-af86-24d1cb48fb1d
Date: Wed, 14 Oct 2015 11:04:36 GMT

{"meta": {"key1": "val1"}}

Error Execution Example

HTTP Request

GET /v2/2ef31c2ff36a4d37841b28c63b14b65/servers/2251d4b7-bc74-4bac-bccf-91b92a279813/metadata/key1 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
Content-Type: application/json
Accept: application/json
X-Auth-Token: 3b4feed6a89349f1beddc46243679d2b

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-b83dc649-1501-4452-a78e-5b6611c20f27
Date: Wed, 14 Oct 2015 11:04:46 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id '2ef31c2ff36a4d37841b28c63b14b65' doesn't match Context's project_id '2ef31c2ff36a4d37841b28c63b14b65e'", "code": 400}}