VMware Cloud Director OpenAPI
VMware Cloud Director OpenAPI is a new API that is defined using the OpenAPI standards.
This ReSTful API borrows some elements of the legacy VMware Cloud Director API and establishes new patterns for use as described below.
Authentication
Authentication and Authorization schemes are the same as those for the legacy APIs. You can authenticate using the JWT token via theAuthorization
header or specifying a session using x-vcloud-authorization
(The latter form is deprecated).
Operation Patterns
This API follows the following general guidelines to establish a consistent CRUD pattern:Operation | Description | Response Code | Response Content |
---|---|---|---|
GET /items | Returns a paginated list of items | 200 | Response will include Navigational links to the items in the list. |
POST /items | Returns newly created item | 201 | Content-Location header links to the newly created item |
GET /items/urn | Returns an individual item | 200 | A single item using same data type as that included in list above |
PUT /items/urn | Updates an individual item | 200 | Updated view of the item is returned |
DELETE /items/urn | Deletes the item | 204 | No content is returned. |
Asynchronous operations
Asynchronous operations are determined by the server. In those cases, instead of responding as described above, the server responds with an HTTP Response code 202 and an empty body. The tracking task (which is the same task as all legacy API operations use) is linked via the URI provided in theLocation
header.All API calls can choose to service a request asynchronously or synchronously as determined by the server upon interpreting the request. Operations that choose to exhibit this dual behavior will have both options documented by specifying both response code(s) below. The caller must be prepared to handle responses to such API calls by inspecting the HTTP Response code.
Error Conditions
All operations report errors using the following error reporting rules:- 400: Bad Request - In event of bad request due to incorrect data or other user error
- 401: Bad Request - If user is unauthenticated or their session has expired
- 403: Forbidden - If the user is not authorized or the entity does not exist
OpenAPI Design Concepts and Principles
- IDs are full Uniform Resource Names (URNs).
- OpenAPI's
Content-Type
is alwaysapplication/json
- REST links are in the Link header.
- Multiple relationships for any link are represented by multiple values in a space-separated list.
- Links have a custom VMware Cloud Director-specific "model" attribute that hints at the applicable data type for the links.
- title + rel + model attributes evaluates to a unique link.
- Links follow Hypermedia as the Engine of Application State (HATEOAS) principles. Links are present if certain operations are present and permitted for the user"s current role and the state of the referred entities.
- APIs follow a flat structure relying on cross-referencing other entities instead of the navigational style used by the legacy VMware Cloud Director APIs.
- Most endpoints that return a list support filtering and sorting similar to the query service in the legacy VMware Cloud Director APIs.
- Accept header must be included to specify the API version for the request similar to calls to existing legacy VMware Cloud Director APIs.
- Each feature has a version in the path element present in its URL.
Note API URL's without a version in their paths must be considered experimental.