ServerList
(Difference between revisions)
(→Parameters) |
(→JSON) |
||
Line 22: | Line 22: | ||
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/servers/{server_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
Line 31: | Line 31: | ||
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http://{ | + | "href":"http://{api_server}/servers/{server_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
] | ] | ||
}, | }, | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
] | ] | ||
} | } |
Revision as of 19:21, 23 April 2012
This operation will list all servers.
GET /servers?name=serverName&status=serverStatus&image=imageRef
Contents |
Parameters
- name - string
- Optional Server name to search for.
- status - string
- Optional Server status to search for. Values: BUILD, ACTIVE, SUSPENDED, DELETED, UNKNOWN
- image - string
- Optional Absolute URL of the image to filter servers by. e.g. http(s)://{api_server}/images/{image_id}/
Result
JSON
{ "servers":[ { "id":"{server_id}", "links":[ { "href":"http://{api_server}/servers/{server_id}/", "rel":"self" } ] }, { "id":"{server_id}", "links":[ { "href":"http://{api_server}/servers/{server_id}/", "rel":"self" } ] }, ] }
- id - string
- Unique identifier for this server.
- links - array
- Hypermedia for this resource.
Response Codes
- Success
- HTTP/1.1 200 OK
- Failure
- HTTP/1.1 200 OK 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.
Examples
List servers
- GET http://{api_url}/servers
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
Response Code:
HTTP/1.1 200 OK
Response Body:
{"servers":[ {"id": "{server_id}", "links": [{"href": "http://{server_name}/servers/{server_id}/", "rel": "self"}]}, {"id": "{server_id}", "links": [{"href": "http://{server_name}/servers/{server_id}/", "rel": "self"}]}, ... {"id": "{server_id}", "links": [{"href": "http://{server_name}/servers/{server_id}/", "rel": "self"}]} ]}
Unauthorized access
- GET http://{api_url}/servers
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded fake_authentication_string
Response Code:
HTTP/1.1 401 Unauthorized
Response Body:
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.