This website requires JavaScript.
150 lines
5.6 KiB
ReStructuredText
2014年12月17日 10:14:37 -06:00
==========
The OpenStack Compute API v2.0 is extensible. Extensions serve two purposes:
They allow the introduction of new features in the API without requiring
a version change and they allow the introduction of vendor specific
niche functionality. Applications can programmatically list available
extensions by performing a **GET** on the ``/extensions`` URI. Note that
this is a versioned request; that is, an extension available in one API
version might not be available in another.
Extensions may also be queried individually by their unique alias. This
provides the simplest method of checking if an extension is available
because an unavailable extension issues an itemNotFound (404) response.
Extensions may define new data types, parameters, actions, headers,
states, and resources. In XML, additional elements and attributes can be
defined. These elements must be defined in the namespace for the
extension. In JSON, the alias must be used. The volumes element is
defined in the ``RS-CBS`` namespace. Extended headers are always
prefixed with ``X-`` followed by the alias and a dash:
(``X-RS-CBS-HEADER1``). States and parameters must be prefixed with the
extension alias followed by a colon. For example, an image might be in
the ``RS-PIE:PrepareShare`` state.
Applications should ignore response data that contains extension
elements. An extended state should always be treated as an ``UNKNOWN``
state if the application does not support the extension. Applications
should also verify that an extension is available before submitting an
**Example:Extended server: JSON response**
"id": "52415800-8b69-11e0-9b19-734f6af67565",
"updated": "2010年10月10日T12:00:00Z",
"created": "2010年08月10日T12:00:00Z",
"hostId": "e4d909c290d0fb1ca068ffaddf22cbd0",
"accessIPv4" : "67.23.10.132",
"accessIPv6" : "::babe:67.23.10.132",
"id": "52415800-8b69-11e0-9b19-734f6f006e54",
"href": "http://servers.api.openstack.org/v2/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
"href": "http://servers.api.openstack.org/1234/images/52415800-8b69-11e0-9b19-734f6f006e54"
"id": "52415800-8b69-11e0-9b19-734f216543fd",
"href": "http://servers.api.openstack.org/v2/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
"href": "http://servers.api.openstack.org/1234/flavors/52415800-8b69-11e0-9b19-734f216543fd"
"addr": "::babe:67.23.10.132"
"addr": "::babe:4317:0A83"
"addr": "::babe:10.176.42.16"
"Server Label": "Web Head 1",
"href": "http://servers.api.openstack.org/v2/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
"href": "http://servers.api.openstack.org/1234/servers/52415800-8b69-11e0-9b19-734f6af67565"
"href": "https://cbs.api.rackspacecloud.com/12934/volumes/19"
"href": "https://cbs.api.rackspacecloud.com/12934/volumes/23"
**Example:Extended action: JSON response**
"href":"https://cbs.api.rackspacecloud.com/12934/volumes/19"