ServerListDetails
From Hostway API Documentation
(Difference between revisions)
(→Parameters) |
Mike.robski (Talk | contribs) m (1 revision: Release 98) |
||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | This operation will list all servers including their details. | + | This operation will list all [[Server|servers]] including their details. |
− | '''GET''' /servers/detail?''name=serverName&status=serverStatus&image=imageRef'' | + | ='''GET''' /accounts/''{accountId}''/flexcloud/servers/detail?''name=serverName&status=serverStatus&image=imageRef&zone=ZoneTextKey®ion=regionTextKey''= |
== Parameters == | == Parameters == | ||
+ | ; accountId - ''string'' | ||
+ | : The selected account Id. | ||
+ | |||
; name - ''string'' | ; name - ''string'' | ||
: Server name to search for. | : Server name to search for. | ||
; status - ''string'' | ; status - ''string'' | ||
− | : Server status to search for. Values: '''BUILD''', '''ACTIVE''', '''SUSPENDED''', '''DELETED''', ''' | + | : Server status to search for. Values: '''BUILD''', '''ACTIVE''', '''SUSPENDED''', '''DELETED''', '''STOPPED''', '''PROCESSING''' |
+ | : without status filtering, return servers with '''ACTIVE''', '''PROCESSING''' or '''STOPPED''' | ||
; image - ''string'' | ; image - ''string'' | ||
− | : Absolute URL of the image to filter servers by. ''e.g. <nowiki>http://{api_server}/images/{image_id}/</nowiki>'' | + | : Absolute URL of the image to filter servers by. ''e.g. <nowiki>http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/</nowiki>'' |
+ | |||
+ | ; zone - ''string'' | ||
+ | : Zone text key | ||
+ | |||
+ | ; region - ''string'' | ||
+ | : optional, region text key | ||
== Result == | == Result == | ||
=== JSON === | === JSON === | ||
− | < | + | <nowiki> |
{ | { | ||
"servers":[ | "servers":[ | ||
{ | { | ||
− | "status":" | + | "status":"{state_status}", |
"updated":"", | "updated":"", | ||
− | "hostId":" | + | "hostId":"{host_id}", |
"addresses":{ | "addresses":{ | ||
"public":[ | "public":[ | ||
Line 38: | Line 48: | ||
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
"image":{ | "image":{ | ||
− | "name":" | + | "name":"{display_image_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
− | "id":" | + | "id":"{image_id}" |
}, | }, | ||
"userId":"{user_account_id}", | "userId":"{user_account_id}", | ||
"flavor":{ | "flavor":{ | ||
− | "name":" | + | "name":"{display_flavor_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
− | "id": | + | "id":{flavor_id} |
+ | }, | ||
+ | "securityGroup": { | ||
+ | "id":"{security_group_id}", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/{security_group_id}/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ] | ||
}, | }, | ||
"id":"{server_id}", | "id":"{server_id}", | ||
− | "name":"{ | + | "zone": "{zone_textkey}", |
+ | "name":"{display_server_name}", | ||
"created":"2011-12-05T12:51:28", | "created":"2011-12-05T12:51:28", | ||
"tenantId":"", | "tenantId":"", | ||
Line 71: | Line 91: | ||
"progress":100, | "progress":100, | ||
"metadata":{ | "metadata":{ | ||
− | |||
} | } | ||
}, | }, | ||
{ | { | ||
− | "status":" | + | "status":"{state_status}", |
"updated":"", | "updated":"", | ||
− | "hostId":" | + | "hostId":"{host_id}", |
"addresses":{ | "addresses":{ | ||
"public":[ | "public":[ | ||
Line 94: | Line 113: | ||
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
"image":{ | "image":{ | ||
− | "name":" | + | "name":"{display_image_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
− | "id":" | + | "id":"{image_id}" |
}, | }, | ||
"userId":"{user_account_id}", | "userId":"{user_account_id}", | ||
"flavor":{ | "flavor":{ | ||
− | "name":" | + | "name":"{display_flavor_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{server_name}/flavors/ | + | "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
], | ], | ||
− | "id": | + | "id":{flavor_id} |
+ | }, | ||
+ | "securityGroup": { | ||
+ | "id":"{security_group_id}", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/{security_group_id}/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ] | ||
}, | }, | ||
"id":"{server_id}", | "id":"{server_id}", | ||
− | "name":"{ | + | "zone": "{zone_textkey}", |
+ | "name":"{display_server_name}", | ||
"created":"2011-11-17T10:14:58", | "created":"2011-11-17T10:14:58", | ||
"tenantId":"", | "tenantId":"", | ||
Line 127: | Line 156: | ||
"progress":100, | "progress":100, | ||
"metadata":{ | "metadata":{ | ||
− | |||
} | } | ||
} | } | ||
] | ] | ||
− | } | + | }</nowiki> |
− | </ | + | |
− | + | ||
==== server ==== | ==== server ==== | ||
Line 152: | Line 178: | ||
; name - ''string'' | ; name - ''string'' | ||
− | : | + | : Display name for this server. |
; created - ''string'' | ; created - ''string'' | ||
Line 161: | Line 187: | ||
; progress - ''number'' | ; progress - ''number'' | ||
− | : The progress of | + | : The current progress of this server while in BUILD status. The value is in the range of 0 - 100, but currently will only be 0, 50 or 100. |
; metadata - ''object'' | ; metadata - ''object'' | ||
− | : Unused always an empty object. | + | : Unused - always an empty object. |
; tenantId | ; tenantId | ||
− | : Unused | + | : Unused - always null. |
; accessIPv6 | ; accessIPv6 | ||
− | : Unused always null. | + | : Unused - always null. |
; updated | ; updated | ||
− | : Unused always null. | + | : Unused - always null. |
+ | |||
+ | ; zone | ||
+ | : zone text key | ||
==== addresses ==== | ==== addresses ==== | ||
Line 208: | Line 237: | ||
: Unique identifier for flavor this server is based on. | : Unique identifier for flavor this server is based on. | ||
+ | ==== securityGroup ==== | ||
+ | ; securityGroup.id - ''string'' | ||
+ | : the id of the securityGroup that is assigned to this server | ||
+ | ; securityGroup.links - ''list'' | ||
+ | : [[Hypermedia]] for the securityGroup. | ||
+ | |||
+ | == Response Codes == | ||
+ | ; Success | ||
+ | : ''HTTP/1.1 200 OK'' | ||
+ | |||
+ | ; Failure | ||
+ | : ''HTTP/1.1 401 Unauthorized'' : This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. | ||
+ | |||
+ | ; Failure | ||
+ | :''HTTP/1.1 404 Not Found'' : Resource does not exist | ||
+ | |||
+ | == Examples == | ||
+ | '''Successfully get server list with details''' | ||
+ | :'''GET''' /accounts/{accountId}/flexcloud/servers/detail | ||
+ | ''- Response:'' | ||
+ | ''OK (200)'': | ||
+ | <nowiki> | ||
+ | { | ||
+ | "servers":[ | ||
+ | { | ||
+ | "status":"ACTIVE", | ||
+ | "updated":"", | ||
+ | "hostId":"{host_id}", | ||
+ | "addresses":{ | ||
+ | "public":[ | ||
+ | { | ||
+ | "version":4, | ||
+ | "addr":"{ip_address}" | ||
+ | } | ||
+ | ], | ||
+ | "private":[ | ||
+ | { | ||
+ | "version":4, | ||
+ | "addr":"{ip_address}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/servers/test_server_0013/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "image":{ | ||
+ | "name":"Ubuntu 10.10 x64", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/images/test_ubuntu_image/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "id":"test_ubuntu_image" | ||
+ | }, | ||
+ | "userId":"{user_account_id}", | ||
+ | "flavor":{ | ||
+ | "name":"1024MB Server3", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/3/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "id":3 | ||
+ | }, | ||
+ | "securityGroup":{ | ||
+ | "id":"group2012Nov02_jD6NX8BsK", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | "id":"test_server_0013", | ||
+ | "zone": "AUS001", | ||
+ | "name":"test_server_updated", | ||
+ | "created":"2011-12-05T12:51:28", | ||
+ | "tenantId":"", | ||
+ | "accessIPv4":"{ip_address}", | ||
+ | "accessIPv6":"", | ||
+ | "progress":100, | ||
+ | "metadata":{ | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | "status":"ACTIVE", | ||
+ | "updated":"", | ||
+ | "hostId":"{host_id}", | ||
+ | "addresses":{ | ||
+ | "public":[ | ||
+ | { | ||
+ | "version":4, | ||
+ | "addr":"{ip_address}" | ||
+ | } | ||
+ | ], | ||
+ | "private":[ | ||
+ | { | ||
+ | "version":4, | ||
+ | "addr":"{ip_address}" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/servers/test_server_0015/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "image":{ | ||
+ | "name":"Windows 2008 R2 Standard", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/images/test_windows_image/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "id":"test_windows_image" | ||
+ | }, | ||
+ | "userId":"{user_account_id}", | ||
+ | "flavor":{ | ||
+ | "name":"1024MB Server3", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/3/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "id":3 | ||
+ | }, | ||
+ | "securityGroup":{ | ||
+ | "id":"group2012Nov02_jD6NX8BsK", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | "id":"test_server_0015", | ||
+ | "zone": "AUS001", | ||
+ | "name":"test_server_created", | ||
+ | "created":"2011-11-17T10:14:58", | ||
+ | "tenantId":"", | ||
+ | "accessIPv4":"{ip_address}", | ||
+ | "accessIPv6":"", | ||
+ | "progress":100, | ||
+ | "metadata":{ | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Failure while trying to make an unauthorized call''' | ||
+ | ''- Response: Unauthorized (401)'': | ||
+ | 401 Unauthorized | ||
+ | This server could not verify that you are authorized to | ||
+ | access the document you requested. Either you supplied the | ||
+ | wrong credentials (e.g., bad password), or your browser | ||
+ | does not understand how to supply the credentials required. | ||
+ | |||
+ | '''Failure while trying to pass invalid account number''' | ||
+ | :'''GET''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/detail | ||
+ | |||
+ | ''Response Code:'' | ||
+ | <pre>HTTP/1.1 404 Not Found</pre> | ||
+ | |||
+ | ''Response Body:'' | ||
+ | <nowiki> | ||
+ | { | ||
+ | "itemNotFound" : { | ||
+ | "message": "Resource not found", | ||
+ | "code": 404, | ||
+ | "details": "", | ||
+ | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
+ | } | ||
+ | }</nowiki> | ||
− | + | == Alternative URI /servers/detail == | |
+ | An alternative way to execute this call is to omit the ''accountId'' portion of the URI. In this case the system assumes the request is executed for the account identified in the [[Authentication|authorization header]]. | ||
− | + | <code>GET /servers/detail</code> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | [[Category:Hostway API]] | |
+ | [[Category:FlexCloud Server API]] |
Latest revision as of 07:52, 15 September 2014
This operation will list all servers including their details.
Contents |
[edit] GET /accounts/{accountId}/flexcloud/servers/detail?name=serverName&status=serverStatus&image=imageRef&zone=ZoneTextKey®ion=regionTextKey
[edit] Parameters
- accountId - string
- The selected account Id.
- name - string
- Server name to search for.
- status - string
- Server status to search for. Values: BUILD, ACTIVE, SUSPENDED, DELETED, STOPPED, PROCESSING
- without status filtering, return servers with ACTIVE, PROCESSING or STOPPED
- image - string
- Absolute URL of the image to filter servers by. e.g. http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/
- zone - string
- Zone text key
- region - string
- optional, region text key
[edit] Result
[edit] JSON
{ "servers":[ { "status":"{state_status}", "updated":"", "hostId":"{host_id}", "addresses":{ "public":[ { "version":4, "addr":"{ip_address}" } ], "private":[ { "version":4, "addr":"{ip_address}" } ] }, "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/", "rel":"self" } ], "image":{ "name":"{display_image_name}", "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self" } ], "id":"{image_id}" }, "userId":"{user_account_id}", "flavor":{ "name":"{display_flavor_name}", "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self" } ], "id":{flavor_id} }, "securityGroup": { "id":"{security_group_id}", "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/{security_group_id}/", "rel":"self" } ] }, "id":"{server_id}", "zone": "{zone_textkey}", "name":"{display_server_name}", "created":"2011-12-05T12:51:28", "tenantId":"", "accessIPv4":"{ip_address}", "accessIPv6":"", "progress":100, "metadata":{ } }, { "status":"{state_status}", "updated":"", "hostId":"{host_id}", "addresses":{ "public":[ { "version":4, "addr":"{ip_address}" } ], "private":[ { "version":4, "addr":"{ip_address}" } ] }, "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/", "rel":"self" } ], "image":{ "name":"{display_image_name}", "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self" } ], "id":"{image_id}" }, "userId":"{user_account_id}", "flavor":{ "name":"{display_flavor_name}", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self" } ], "id":{flavor_id} }, "securityGroup": { "id":"{security_group_id}", "links":[ { "href":"http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/{security_group_id}/", "rel":"self" } ] }, "id":"{server_id}", "zone": "{zone_textkey}", "name":"{display_server_name}", "created":"2011-11-17T10:14:58", "tenantId":"", "accessIPv4":"{ip_address}", "accessIPv6":"", "progress":100, "metadata":{ } } ] }
[edit] server
- id - string
- Unique identifier for this server.
- links - list
- Hypermedia for this resource.
- status - string
- Current state of the server. Values: BUILD, ACTIVE, SUSPENDED, DELETED, UNKNOWN
- hostId - string
- Id of the physical host this virtual machine is running on.
- userId - string
- Unique identifier for the owner of this server.
- name - string
- Display name for this server.
- created - string
- The date and time this server was created. ISO 8601 format, YYYY-MM-DDTHH:MM:SS.
- accessIPv4 - string
- The default included public IPv4 address.
- progress - number
- The current progress of this server while in BUILD status. The value is in the range of 0 - 100, but currently will only be 0, 50 or 100.
- metadata - object
- Unused - always an empty object.
- tenantId
- Unused - always null.
- accessIPv6
- Unused - always null.
- updated
- Unused - always null.
- zone
- zone text key
[edit] addresses
- addresses.public.version - number
- IP version of this address. Values: 4
- addresses.public.addr = string
- Public IP address of this server
- addresses.private.version - number
- IP version of this address. Values: 4
- addresses.private.addr - string
- Private IP address of this server
[edit] image
- image.name - string
- The display name of the image this server is based on.
- image.links - list
- Hypermedia for the image.
- image.id - string
- Unique identifier for image this server is based on.
[edit] flavor
- flavor.name - string
- The display name of the flavor this server is based on.
- flavor.links - list
- Hypermedia for the flavor.
- flavor.id - string
- Unique identifier for flavor this server is based on.
[edit] securityGroup
- securityGroup.id - string
- the id of the securityGroup that is assigned to this server
- securityGroup.links - list
- Hypermedia for the securityGroup.
[edit] Response Codes
- Success
- HTTP/1.1 200 OK
- Failure
- HTTP/1.1 401 Unauthorized : This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
- Failure
- HTTP/1.1 404 Not Found : Resource does not exist
[edit] Examples
Successfully get server list with details
- GET /accounts/{accountId}/flexcloud/servers/detail
- Response: OK (200):
{ "servers":[ { "status":"ACTIVE", "updated":"", "hostId":"{host_id}", "addresses":{ "public":[ { "version":4, "addr":"{ip_address}" } ], "private":[ { "version":4, "addr":"{ip_address}" } ] }, "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/servers/test_server_0013/", "rel":"self" } ], "image":{ "name":"Ubuntu 10.10 x64", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/images/test_ubuntu_image/", "rel":"self" } ], "id":"test_ubuntu_image" }, "userId":"{user_account_id}", "flavor":{ "name":"1024MB Server3", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/3/", "rel":"self" } ], "id":3 }, "securityGroup":{ "id":"group2012Nov02_jD6NX8BsK", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", "rel":"self" } ] }, "id":"test_server_0013", "zone": "AUS001", "name":"test_server_updated", "created":"2011-12-05T12:51:28", "tenantId":"", "accessIPv4":"{ip_address}", "accessIPv6":"", "progress":100, "metadata":{ } }, { "status":"ACTIVE", "updated":"", "hostId":"{host_id}", "addresses":{ "public":[ { "version":4, "addr":"{ip_address}" } ], "private":[ { "version":4, "addr":"{ip_address}" } ] }, "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/servers/test_server_0015/", "rel":"self" } ], "image":{ "name":"Windows 2008 R2 Standard", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/images/test_windows_image/", "rel":"self" } ], "id":"test_windows_image" }, "userId":"{user_account_id}", "flavor":{ "name":"1024MB Server3", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/flavors/3/", "rel":"self" } ], "id":3 }, "securityGroup":{ "id":"group2012Nov02_jD6NX8BsK", "links":[ { "href":"http://{server_name}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", "rel":"self" } ] }, "id":"test_server_0015", "zone": "AUS001", "name":"test_server_created", "created":"2011-11-17T10:14:58", "tenantId":"", "accessIPv4":"{ip_address}", "accessIPv6":"", "progress":100, "metadata":{ } } ] }
Failure while trying to make an unauthorized call - Response: Unauthorized (401):
401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
Failure while trying to pass invalid account number
- GET http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/detail
Response Code:
HTTP/1.1 404 Not Found
Response Body:
{ "itemNotFound" : { "message": "Resource not found", "code": 404, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
[edit] Alternative URI /servers/detail
An alternative way to execute this call is to omit the accountId portion of the URI. In this case the system assumes the request is executed for the account identified in the authorization header.
GET /servers/detail