Get server details¶
Overview¶
Gets details for a specified server.
Classification¶
- Show
API Operation Object¶
- servers
Synchronous / Asynchronous¶
- synchronous
Request¶
HTTP Request Method¶
- GET
HTTP Request Path¶
{api_endpoint}/v2/{project_id}/servers/{server_id}
HTTP Request Header¶
Format¶
Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
HTTP Request Body¶
Format¶
- none
Request Parameter¶
name | style | format | description | required/optional | default value | action for invalid parameter | response code for invalid parameter |
---|---|---|---|---|---|---|---|
project_id | URL | UUID(3) | Project id | required | - | Terminate | 400, 404 |
server_id | URL | UUID String | instance id | required | - | Terminate | 404 |
token_id | Header | authentication token string | keystone authentication token | required | - | Terminate | 401 |
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”
HTTP Response Body¶
Format¶
{
"server": {
"OS-DCF:diskConfig": "<diskconfig>",
"OS-EXT-AZ:availability_zone": "<availabilityzone>",
"OS-EXT-SRV-ATTR:host": "<hostname>",
"OS-EXT-SRV-ATTR:hypervisor_hostname":"<hypervisor_hostname>",
"OS-EXT-SRV-ATTR:instance_name":"<instance_name>",
"OS-EXT-STS:power_state": <power_status>,
"OS-EXT-STS:task_state":"<task_status>",
"OS-EXT-STS:vm_state": "<vm_status>",
"OS-SRV-USG:launched_at": "<launch_at>",
"OS-SRV-USG:terminated_at": <terminated_at>,
"accessIPv4":"<access_ipv4>",
"accessIPv6":"<access_ipv6>",
"addresses": {
"<network_name>": [
{
"OS-EXT-IPS-MAC:mac_addr": "<MAC_address>",
"OS-EXT-IPS:type": "<address_type>",
"version": <ip_address_version>,
"addr": "<ip_address>"
}
]
},
"config_drive": "<config_drive>",
"created":"<created_time>",
"flavor": {
"id": "<flavor_id>",
"links": [
{
"href":"<flavor_bookmark>",
"rel": "bookmark"
}
]
},
"hostId": "<host_id>",
"id": "<instance_id>",
"image": {
"id": "<image_id>",
"links": [
{
"href":"<image_bookmark>",
"rel": "bookmark"
}
]
},
"key_name":"<key_name>",
"links": [
{
"href":"<self_management_url>",
"rel": "self"
},
{
"href": "<self_bookmark_url>",
"rel": "bookmark"
}
],
"metadata": {
"<metadata_key>":"<metadata_value>",
<<repeat>>
},
"name":"<name>",
"progress": <progress>,
"security_groups": [
{
"name": "<security_group>"
},
<<repeat>>
],
"status":"<status>",
"tenant_id": "<tenant_id>",
"updated": "<updated_time>",
"user_id": "<user_id>"
}
}
Response Parameter¶
item | format | description |
---|---|---|
diskconfig | MANUAL or AUTO | disk config |
availabilityzone | String(1-255 characters) | availabilityzone |
hostname | String(1-255 characters) | host name |
hypervisor_hostname | String(1-255 characters) | host name hypervisor |
instance_name | String(1-255 characters) | instance name |
power_status | int | power status |
task_status | String(1-255 characters) | task status |
vm_status | String(1-255 characters) | vm state |
launch_at | time/date | launch time for instance |
terminated_at | time/date | terminate time for instance |
access_ipv4 | IPv4address | IPv4 address |
access_ipv6 | String(1-255 characters) | IPv6 address |
network_name | String(1-255 characters) | network name |
MAC_address | MAC Address | MAC address for instance |
address_type | fixed or floating | types of IP addresses |
ip_address | IPv4 address or IPv6 address | ip address for instance |
ip_address_version | int(4 or 6) | ip protocol version |
created_time | time/date | created time of instance |
config_drive | String(1-255 characters) | name of config drive |
flavor_id | String(1-255 characters) | flavor id |
flavor_bookmark | URL String | Bookmark URL for flavor |
host_id | String(1-255 characters) | host id |
instance_id | UUID | instance id |
image_id | UUID | image ID |
image_bookmark | URL String | bookmark URL for image |
key_name | String(1-255 characters) | key name |
self_management_url | URL String | management URL for instance |
self_bookmark_url | URL String | bookmark URL for instance |
metadata_key | String(1-255 characters) | metadata key |
metadata_value | String(1-255 characters) | metadata value |
name | String(1-255 characters) | instance name |
progress | int | boot progress for instance |
security_group | String(1-255 characters) | security group name |
status | String(1-255 characters) | state of instance |
tenant_id | tenant id(2) | tenant id |
updated_time | time/date | update time |
user_id | String(1-255 characters) | owner of instance |
Sample API Request and Response¶
Sample API Request¶
Request URI¶
https://example.com/v2/{project_id}/servers/{server_id}
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¶
{
"server": {
"OS-DCF:diskConfig": "<diskconfig>",
"OS-EXT-AZ:availability_zone": "<availabilityzone>",
"OS-EXT-SRV-ATTR:host": "<hostname>",
"OS-EXT-SRV-ATTR:hypervisor_hostname":"<hypervisor_hostname>",
"OS-EXT-SRV-ATTR:instance_name":"<instance_name>",
"OS-EXT-STS:power_state": <power_status>,
"OS-EXT-STS:task_state":"<task_status>",
"OS-EXT-STS:vm_state": "<vm_status>",
"OS-SRV-USG:launched_at": "<launch_at>",
"OS-SRV-USG:terminated_at": <terminated_at>,
"accessIPv4":"<access_ipv4>",
"accessIPv6":"<access_ipv6>",
"addresses": {
"<network_name>": [
{
"OS-EXT-IPS-MAC:mac_addr": "<MAC_address>",
"OS-EXT-IPS:type": "<address_type>",
"version": <ip_address_version>,
"addr": "<ip_address>"
}
]
},
"config_drive": "<config_drive>",
"created":"<created_time>",
"flavor": {
"id": "<flavor_id>",
"links": [
{
"href":"<flavor_bookmark>",
"rel": "bookmark"
}
]
},
"hostId": "<host_id>",
"id": "<instance_id>",
"image": {
"id": "<image_id>",
"links": [
{
"href":"<image_bookmark>",
"rel": "bookmark"
}
]
},
"key_name":"<key_name>",
"links": [
{
"href":"<self_management_url>",
"rel": "self"
},
{
"href": "<self_bookmark_url>",
"rel": "bookmark"
}
],
"metadata": {
"<metadata_key>":"<metadata_value>",
<<repeat>>
},
"name":"<name>",
"progress": <progress>,
"security_groups": [
{
"name": "<security_group>"
},
<<repeat>>
],
"status":"<status>",
"tenant_id": "<tenant_id>",
"updated": "<updated_time>",
"user_id": "<user_id>"
}
}
Execution Example¶
HTTP Request¶
GET /v2/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.150.51:8774
Accept-Encoding: gzip, deflate, compress
Accept: application/json
X-Auth-Token: b5e0264837814b5c800ce3adf54ad0dd
HTTP Response¶
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1541
X-Compute-Request-Id: req-5cd3780d-3c41-45c4-bbd5-8f515b59bdb1
Date: Thu, 24 Jul 2014 00:40:00 GMT
{"server": {"status": "ACTIVE", "updated": "2014-07-24T00:26:12Z", "hostId": "304b720487da712fbd57d787e93f0a3d52aed8672b19bdf51f36792a", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:1c:d0:5a", "version": 4, "addr": "10.0.0.2", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.150.51:8774/v2/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f", "rel": "self"}, {"href": "http://192.168.150.51:8774/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f", "rel": "bookmark"}], "key_name": null, "image": {"id": "1fd5ab9b-1769-4dd5-b0bd-e075614cc866", "links": [{"href": "http://192.168.150.51:8774/5d8b99310e6c49eaa5413aa659170deb/images/1fd5ab9b-1769-4dd5-b0bd-e075614cc866", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-SRV-USG:launched_at": "2014-07-24T00:26:12.000000", "flavor": {"id": "2", "links": [{"href": "http://192.168.150.51:8774/5d8b99310e6c49eaa5413aa659170deb/flavors/2", "rel": "bookmark"}]}, "id": "cbce6087-6156-453c-a512-60bf3d75d69f", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "f5a98f28f61e4fd19622f9016c481d48", "name": "Testvm1", "created": "2014-07-24T00:26:07Z", "tenant_id": "5d8b99310e6c49eaa5413aa659170deb", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}}
Error Execution Example¶
HTTP Request¶
GET /v2/5d8b99310e6c49eaa5413aa659170deb/servers/cbce6087-6156-453c-a512-60bf3d75d69f HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 55671f5947864c918258af1761f1f0ee
Content-type: application/json
Accept: application/json
HTTP Response¶
HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-845f4351-44be-4e18-b63b-290e2f344b61
Date: Wed, 07 Oct 2015 08:45:33 GMT
{"badRequest": {"message": "Malformed request URL: URL's project_id '5d8b99310e6c49eaa5413aa659170deb' doesn't match Context's project_id '01efe5374f674b508693a5301d47aeba'", "code": 400}}