Difference between revisions of "API Special Interest Group/Current Design/Links"
(creating links page with basic outine) |
(→Current Design) |
||
Line 4: | Line 4: | ||
= Current Design = | = Current Design = | ||
+ | |||
+ | == Cinder == | ||
+ | |||
+ | [http://developer.openstack.org/api-ref-blockstorage-v2.html Cinder API reference] | ||
+ | |||
+ | Cinder appears to the JSON Hyper-Schema<ref name="json-hyper-schema">[http://json-schema.org/latest/json-schema-hypermedia.html]</ref> for all embedded link references. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | <pre><nowiki>GET /</nowiki></pre> | ||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "versions": [ | ||
+ | { | ||
+ | "status": "CURRENT", | ||
+ | "updated": "2012-01-04T11:33:21Z", | ||
+ | "id": "v1.0", | ||
+ | "links": [ | ||
+ | { | ||
+ | "href": "http://23.253.228.211:8776/v1/", | ||
+ | "rel": "self" | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "status": "CURRENT", | ||
+ | "updated": "2012-11-21T11:33:21Z", | ||
+ | "id": "v2.0", | ||
+ | "links": [ | ||
+ | { | ||
+ | "href": "http://23.253.228.211:8776/v2/", | ||
+ | "rel": "self" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | <pre><nowiki>GET /v2/{tenant_id}/volumes</nowiki></pre> | ||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "volumes": [ | ||
+ | { | ||
+ | "id": "45baf976-c20a-4894-a7c3-c94b7376bf55", | ||
+ | "links": [ | ||
+ | { | ||
+ | "href": "http://localhost:8776/v2/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/45baf976-c20a-4894-a7c3-c94b7376bf55", | ||
+ | "rel": "self" | ||
+ | }, | ||
+ | { | ||
+ | "href": "http://localhost:8776/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/45baf976-c20a-4894-a7c3-c94b7376bf55", | ||
+ | "rel": "bookmark" | ||
+ | } | ||
+ | ], | ||
+ | "name": "vol-004" | ||
+ | }, | ||
+ | { | ||
+ | "id": "5aa119a8-d25b-45a7-8d1b-88e127885635", | ||
+ | "links": [ | ||
+ | { | ||
+ | "href": "http://localhost:8776/v2/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/5aa119a8-d25b-45a7-8d1b-88e127885635", | ||
+ | "rel": "self" | ||
+ | }, | ||
+ | { | ||
+ | "href": "http://localhost:8776/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/5aa119a8-d25b-45a7-8d1b-88e127885635", | ||
+ | "rel": "bookmark" | ||
+ | } | ||
+ | ], | ||
+ | "name": "vol-003" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </nowiki></pre> |
Revision as of 14:27, 12 October 2015
Analysis
How are links being referenced in OpenStack APIs
Current Design
Cinder
Cinder appears to the JSON Hyper-Schema[1] for all embedded link references.
Examples
GET /
{ "versions": [ { "status": "CURRENT", "updated": "2012-01-04T11:33:21Z", "id": "v1.0", "links": [ { "href": "http://23.253.228.211:8776/v1/", "rel": "self" } ] }, { "status": "CURRENT", "updated": "2012-11-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://23.253.228.211:8776/v2/", "rel": "self" } ] } ] }
GET /v2/{tenant_id}/volumes
{ "volumes": [ { "id": "45baf976-c20a-4894-a7c3-c94b7376bf55", "links": [ { "href": "http://localhost:8776/v2/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/45baf976-c20a-4894-a7c3-c94b7376bf55", "rel": "self" }, { "href": "http://localhost:8776/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/45baf976-c20a-4894-a7c3-c94b7376bf55", "rel": "bookmark" } ], "name": "vol-004" }, { "id": "5aa119a8-d25b-45a7-8d1b-88e127885635", "links": [ { "href": "http://localhost:8776/v2/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/5aa119a8-d25b-45a7-8d1b-88e127885635", "rel": "self" }, { "href": "http://localhost:8776/0c2eba2c5af04d3f9e9d0d410b371fde/volumes/5aa119a8-d25b-45a7-8d1b-88e127885635", "rel": "bookmark" } ], "name": "vol-003" } ] }