Amend the "add extra-specs to flavor" for create and update API

1. The response of ``POST /flavors`` and ``PUT /flavors/{flavor_id}``
also needs to add the ``extra-specs`` in response to keep consist.
2. Fix typo in bp.
3. Change primary assignee and other contributors.

Part of blueprint add-extra-specs-to-flavor-list

Change-Id: I2d2523da038e5f4e5547eb74180786429e817912
This commit is contained in:
Yikun Jiang 2018-03-19 14:25:20 +08:00 committed by Matt Riedemann
parent e9892ce8e8
commit 6efbc77c87
1 changed files with 82 additions and 6 deletions

View File

@ -15,12 +15,15 @@ Add a new microversion to the following APIs to return also
* GET /flavors/details
* GET /flavors/{flavor_id}
* POST /flavors
* PUT /flavors/{flavor_id}
Problem description
===================
Currently the response of ``GET /flavors/details`` and
``GET /flavors/{flavor_id}`` does not include ``extra_spces`` field,
Currently the response of ``GET /flavors/details``,
``GET /flavors/{flavor_id}``, ``POST /flavors`` and
``PUT /flavors/{flavor_id}`` does not include ``extra_specs`` field,
The users have to call ``GET /flavors/{flavor_id}/extra_specs`` again
to get the extra_specs field.
@ -41,6 +44,8 @@ Add a new microversion to the following APIs to return also
* GET /flavors/details
* GET /flavors/{flavor_id}
* POST /flavors
* PUT /flavors/{flavor_id}
.. note:: The ``extra_specs`` field is already included in the embedded
instance flavor in the server detail response and will be only
@ -133,9 +138,80 @@ Following changes will be introduced in a new API microversion.
"rxtx_factor": 1.0,
"description": "test description",
"extra_specs": {
"key1": "value1",
"key2": "value2"
"key1": "value1",
"key2": "value2"
}
}
}
* POST /flavors
Add ``extra_specs`` data to response body.
JSON response body example::
{
"flavor": {
"OS-FLV-DISABLED:disabled": false,
"disk": 10,
"OS-FLV-EXT-DATA:ephemeral": 0,
"os-flavor-access:is_public": true,
"id": "10",
"links": [
{
"href": "http://openstack.example.com/v2/6f70656e737461636b20342065766572/flavors/10",
"rel": "self"
},
{
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/flavors/10",
"rel": "bookmark"
}
],
"name": "test_flavor",
"ram": 1024,
"swap": "",
"rxtx_factor": 2.0,
"vcpus": 2,
"description": "test description",
"extra_specs": {}
}
}
* PUT /flavors/{flavor_id}
Add ``extra_specs`` data to response body.
JSON response body example::
{
"flavor": {
"OS-FLV-DISABLED:disabled": false,
"disk": 1,
"OS-FLV-EXT-DATA:ephemeral": 0,
"os-flavor-access:is_public": true,
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/6f70656e737461636b20342065766572/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": "",
"vcpus": 1,
"rxtx_factor": 1.0,
"description": "updated description",
"extra_specs": {
"key1": "value1",
"key2": "value2"
}
}
}
@ -186,10 +262,10 @@ Assignee(s)
-----------
Primary assignee:
Kevin Zheng
Yikun Jiang
Other contributors:
None
Kevin Zheng
Work Items
----------