Update image schema with Image API 2.6 statuses
Updates the schemas/image(s) responses and the api-ref. (The dev docs are correct.) Adds a test so this won't happen again. Closes-bug: #1762031 Change-Id: Ifb0a07fcdb1c8d91f1ad700329a208200222a2a6
This commit is contained in:
parent
67d35f6166
commit
c48acba840
@ -82,6 +82,14 @@ The possible status values for images are presented in the following table.
|
||||
recoverable.
|
||||
* - deactivated
|
||||
- The image data is not available for use.
|
||||
* - uploading
|
||||
- Data has been staged as part of the interoperable image import process.
|
||||
It is not yet available for use.
|
||||
*(Since Image API 2.6)*
|
||||
* - importing
|
||||
- The image data is being processed as part of the interoperable image
|
||||
import process, but is not yet available for use.
|
||||
*(Since Image API 2.6)*
|
||||
|
||||
**Image visibility**
|
||||
|
||||
|
@ -198,7 +198,9 @@
|
||||
"killed",
|
||||
"deleted",
|
||||
"pending_delete",
|
||||
"deactivated"
|
||||
"deactivated",
|
||||
"uploading",
|
||||
"importing"
|
||||
],
|
||||
"readOnly": true,
|
||||
"type": "string"
|
||||
|
@ -219,7 +219,9 @@
|
||||
"killed",
|
||||
"deleted",
|
||||
"pending_delete",
|
||||
"deactivated"
|
||||
"deactivated",
|
||||
"uploading",
|
||||
"importing"
|
||||
],
|
||||
"readOnly": true,
|
||||
"type": "string"
|
||||
|
@ -968,7 +968,8 @@ def get_base_properties():
|
||||
'readOnly': True,
|
||||
'description': _('Status of the image'),
|
||||
'enum': ['queued', 'saving', 'active', 'killed',
|
||||
'deleted', 'pending_delete', 'deactivated'],
|
||||
'deleted', 'uploading', 'importing',
|
||||
'pending_delete', 'deactivated'],
|
||||
},
|
||||
'visibility': {
|
||||
'type': 'string',
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import glance.api.v2.schemas
|
||||
import glance.db.sqlalchemy.api as db_api
|
||||
import glance.tests.unit.utils as unit_test_utils
|
||||
import glance.tests.utils as test_utils
|
||||
|
||||
@ -35,6 +36,14 @@ class TestSchemasController(test_utils.BaseTestCase):
|
||||
'locations', 'owner', 'virtual_size'])
|
||||
self.assertEqual(expected, set(output['properties'].keys()))
|
||||
|
||||
def test_image_has_correct_statuses(self):
|
||||
req = unit_test_utils.get_fake_request()
|
||||
output = self.controller.image(req)
|
||||
self.assertEqual('image', output['name'])
|
||||
expected_statuses = set(db_api.STATUSES)
|
||||
actual_statuses = set(output['properties']['status']['enum'])
|
||||
self.assertEqual(expected_statuses, actual_statuses)
|
||||
|
||||
def test_images(self):
|
||||
req = unit_test_utils.get_fake_request()
|
||||
output = self.controller.images(req)
|
||||
|
Loading…
Reference in New Issue
Block a user