Show Resource Details

Overview

  • Show details of the specified resource.
  • This API performs the same function as "OpenStack Telemetry API: GET /v2/resources/{resource_id}".

Classification

  • Show

API Operation Object

  • resource

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/resources/{resource_id}

HTTP Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

  • none

Request Parameter

Input Parameters
name style format description required/optional default value action for invalid parameter response code for invalid parameter
token_id Header authentication token string authentication token required - Terminate 401
resource_id path string "resource_id" of the target resource required - Terminate 404

Response

Response Header

Format

HTTP/1.1 <response_code> <status>       (ex. 200 OK)
Content-Type: application/json; charset=utf-8

注釈

Not including auto-insert fields such as "Transfer-Encoding", "Date" and others.

Response Code

Response Codes
response code status condition message
200 ok normal end  
400 bad request the request has query parameter This API does not use query parameters.
401 unauthorized authentication failure The request you have made requires authentication.
    invalid project id Not authorized to access project.
404 not found the specified resource doesn't exist Resource was not found.
500 internal server error internal server error The request processing has failed due to some unknown error, exception or failure

Response Body

Format

[
    {
        "links": [
            {
                "href": "<href>",
                "rel": "<rel>"
            },
            <<repeat>>
        ],
        "metadata": "",
        "project_id": "<project_id>",
        "resource_id": "<resource_id>",
        "source": "",
        "user_id": "",
        "namespace": "<namespace>",
        "display_name": "<display_name>",
        "deleted": <deleted>
    },
    <<repeat>>
]

Response Parameter

Response Parameters
item format   description
links list   the links of the resource and meters
href String   link url to access the resource or its meters
rel String   link type ("self" or meter name)
display_name String   display name of the resource
project_id String   ID of the project which the resource is belonging to
resource_id String   the unique id of the resource
namespace String   namespace of the resource
deleted Boolean   if this parameter is "false", the resource has been monitored
metadata -   metadata (non-use)
source -   source (non-use)
user_id -   user id (non-use)

Sample Request and Response

Sample API Request

Request URL

GET /v2/resources/?q.field=resource_id&q.op=eq&q.type=string&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36?page=2&per_page=100

Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: 61389973e52b49c394ba3b89179b290b

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK

Response Body

[
    {
        "links": [
              {
                "href": "https://example.com/v2/resources/nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "self"
              },
              {
                "href": "https://example.com/v2/meters/nova.cpu.utilization.percents?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.cpu.utilization.percents"
              },
              {
                "href": "https://example.com/v2/meters/nova.disk.read.bytes?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.disk.read.bytes"
              },
              {
                "href": "https://example.com/v2/meters/nova.disk.write.bytes?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.disk.write.bytes"
              },
              {
                "href": "https://example.com/v2/meters/nova.disk.read.requests?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.disk.read.requests"
              },
              {
                "href": "https://example.com/v2/meters/nova.disk.write.requests?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.disk.write.requests"
              },
              {
                "href": "https://example.com/v2/meters/nova.network.incoming.bytes?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.network.incoming.bytes"
              },
              {
                "href": "https://example.com/v2/meters/nova.network.outgoing.bytes?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.network.outgoing.bytes"
              },
              {
                "href": "https://example.com/v2/meters/nova.vm.status.bool?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.vm.status.bool"
              },
              {
                "href": "https://example.com/v2/meters/nova.hv.status.bool?q.field=resource_id&q.value=nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
                "rel": "nova.hv.status.bool"
              }
        ],
        "metadata": "",
        "project_id": "35b17138-b364-4e6a-a131-8f3099c5be68",
        "resource_id": "nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36",
        "source": "",
        "user_id": "",
        "namespace": "nova",
        "display_name": "vm1",
        "deleted": false
    }
]

Sample Error Response

HTTP Request

GET /v2/resources/nova_bd9431c1-8d69-4ad3-803a-8d4a6b89fd36?meter_links=1
User-Agent: curl/7.19.7
Content-Type: application/json
Accept: application/json
X-Auth-Token: 61389973e52b49c394ba3b89179b290b

HTTP Response

HTTP/1.1 400 Bad Request
Date: Tue, 19 Jul 2016 08:34:12 GMT
Server: Apache
Cache-Control: no-cache
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Status: 400 Bad Request
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8

{"error":{"code":400,"message":"This API does not use query parameters.","title":"Bad Request"}}