Implement REST API microversions in Manila

Registered by Clinton Knight on 2015-08-06

The OpenStack API working group recommends all projects adopt Nova-style microversions for versioning their REST APIs. This commit ports the Nova microversion code and docs to Manila.

With this patch, the API version is bumped to 1.1, and the versions API (which has always returned horribly outdated values) is the first API that is versioned. The 1.1 version of the versions API includes the minimum and current API version values.

Here is the updated 1.0 version (without version fields):

curl -i -X GET http://localhost:8786/ -H "Accept: application/json" -H "User-Agent: python-manilaclient"

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 339
X-Openstack-Manila-Api-Version: 1.0
Vary: X-OpenStack-Manila-API-Version
Date: Thu, 06 Aug 2015 16:10:13 GMT

{"versions": [{"status": "CURRENT", "updated": "2015-07-30T11:33:21Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.share+json;version=1"}], "id": "v1.0", "links": [{"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}, {"href": "http://localhost:8786/v1/", "rel": "self"}]}]}

And here is the 1.1 version (with version fields):

curl -i -X GET http://localhost:8786/ -H "Accept: application/json" -H "User-Agent: python-manilaclient" -H "X-OpenStack-Manila-API-Version: 1.1"

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 379
X-Openstack-Manila-Api-Version: 1.1
Vary: X-OpenStack-Manila-API-Version
Date: Thu, 06 Aug 2015 16:11:51 GMT

{"versions": [{"status": "CURRENT", "updated": "2015-07-30T11:33:21Z", "links": [{"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}, {"href": "http://localhost:8786/v1/", "rel": "self"}], "min_version": "1.0", "version": "1.1", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.share+json;version=1"}], "id": "v1.0"}]}

Blueprint information

Status:
Complete
Approver:
Ben Swartzlander
Priority:
Essential
Drafter:
Clinton Knight
Direction:
Approved
Assignee:
Clinton Knight
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
milestone icon 1.0.0
Started by
Clinton Knight on 2015-08-06
Completed by
Ben Swartzlander on 2015-08-20

Related branches

Sprints

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.