Merge "[api-ref]Fix response example file of update_type"

This commit is contained in:
Zuul 2019-09-05 00:02:04 +00:00 committed by Gerrit Code Review
commit 5d8242cd54
5 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,11 @@
{
"volume_type": {
"id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
"name": "vol-type-001",
"description": "volume type 0001",
"is_public": true,
"extra_specs": {
"capabilities": "gpu"
}
}
}

View File

@ -66,7 +66,7 @@ Response Parameters
Response Example
----------------
.. literalinclude:: ./samples/volume_type/volume-type-show-response.json
.. literalinclude:: ./samples/volume_type/volume-type-update-response.json
:language: javascript

View File

@ -0,0 +1,7 @@
{
"volume_type": {
"name": "%(name)s",
"description": "%(description)s",
"is_public": "%(bool)s"
}
}

View File

@ -0,0 +1,11 @@
{
"volume_type": {
"id": "%(uuid)s",
"name": "vol-type-001",
"description": "volume type 0001",
"is_public": true,
"extra_specs": {
"capabilities": "gpu"
}
}
}

View File

@ -58,6 +58,14 @@ class VolumeTypesSampleJsonTest(api_samples_test_base.ApiSampleTestBase):
self._verify_response('volume-type-show-response',
self.subs, response, 200)
def test_volume_type_update(self):
res = self._volume_type_create()
res = jsonutils.loads(res.content)['volume_type']
response = self._do_put(
'types/%s' % res['id'], 'volume-type-update-request', self.subs)
self._verify_response('volume-type-update-response',
self.subs, response, 200)
def test_volume_type_extra_spec_create_update(self):
res = self._volume_type_create()