Jump to: navigation, search

Governance/Proposed/APIManagement-sampleGuidelines


#!wiki caution
'''These are sample goals an guidelines, they are not official and have not been approved by the PPB'''


Sample API Goals

  1. Stable: Each successive implementation of the APIs should always be backwards-compatible; i.e., a client for the previous release should work with the successive release. Old features / APIs can be phased out in a controlled way.
  2. Broadly Usable: OpenStack APIs should be able to be easily used by a variety of potential clients, not just those using a particular platform, programming language, or data store.
  3. Simple: We prefer simple solutions over layers of complexity. Our users should be able to leverage their existing knowledge, implementations, and tools as much as possible when working with OpenStack APIs. Wherever possible, off-the-shelf technologies and techniques should be used, so as to reduce the amount that potential users need to learn.
  4. Consistent: Our users should also be able to leverage experience with one OpenStack API to quickly get up to speed with another one.
  5. Performant: Our APIs should be as fast as possible.
  6. Browsable: It should be possible to easily build Web browser-based clients for OpenStack APIs, without using extensions or plug-ins.

Sample API Guidelines

  1. An OpenStack API indicates its version in the first path segment, by a "v" followed by an integer; e.g., "http://openstack.example.org/v2/foo". All changes between releases below this point must be backwards-compatible. [stable]
  2. Backwards-incompatible changes (e.g., no longer supporting a resource, changing representation formats) are introduced by incrementing the version identifier. Bumping the version should be done very rarely. When the version is bumped, the most recent version must be supported for at least [n] releases afterwards, preferably longer, and the sunset of the API version needs to be widely announced. [stable]
  3. OpenStack APIs must be based upon the HTTP protocol, and make both JSON and XML representations available [usable, browsable, simple].
  4. Use HTTP GET for retrieval [usable, performant, browsable, simple].
  5. Use hyperlinks with typed relations; don't assume clients will build URIs from IDs. [browsable, simple]
  6. Re-use well-known media types where possible, to avoid format proliferation [simple]
  7. Support HTTP Cache Validation via conditional GET headers. [performant]