Updating clients to version 2 consists of changing the path to /v2
and adapt error response handling. Some resources such as users contain small changes as well as shown below.
Error handling
As documented in the initial section of the Cloud-API documentation, instead of using https://github.com/blongden/vnd.error as error response, Cloud-API is now more conformant to https://jsonapi.org/format/#errors. A response always looks like
{ "errors": [ { "code": "8", "id": "92f3ede7-21b1-4fb5-a340-e609dbb90585", "status": "409", "title": "Context \"test1\" already exists" } ] }
Also every possible code and its corresponding HTTP response code (status) is documented as well.
User resource
The v1 user resource returns a context object containing name and id.
[ { "context": { "name": "string", "id": 0 }, "name": "string", ... ]
The context object is replaced with simple key named contextName
containing the name of the context. Using a context id is strongly dis-encouraged since the id can change under certain circumstances.
{ "contextName": "string", "name": "string", ... "userAdminEnabled": true }
There's also a new key called userAdminEnabled
which reflects a new provisioning feature only available in version 2.
Context resource
In version 2 it is possible to specify/retrieve an optional amount of maximum users allowed to create.
{ "name": "string", "maxQuota": 0, "usedQuota": 0, ... "maxUser": 0 }
This can be used in case the provisioning of users should be delegated to the context admin account and restrict the amount of users it should be able to create.