Codebase list glance / b87a978
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 (cherry picked from commit c48acba8404629c11bc16c7da99bc7a084e13b99) Brian Rosmaita 6 years ago
5 changed file(s) with 25 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
8181 recoverable.
8282 * - deactivated
8383 - The image data is not available for use.
84 * - uploading
85 - Data has been staged as part of the interoperable image import process.
86 It is not yet available for use.
87 *(Since Image API 2.6)*
88 * - importing
89 - The image data is being processed as part of the interoperable image
90 import process, but is not yet available for use.
91 *(Since Image API 2.6)*
8492
8593 **Image visibility**
8694
197197 "killed",
198198 "deleted",
199199 "pending_delete",
200 "deactivated"
200 "deactivated",
201 "uploading",
202 "importing"
201203 ],
202204 "readOnly": true,
203205 "type": "string"
218218 "killed",
219219 "deleted",
220220 "pending_delete",
221 "deactivated"
221 "deactivated",
222 "uploading",
223 "importing"
222224 ],
223225 "readOnly": true,
224226 "type": "string"
967967 'readOnly': True,
968968 'description': _('Status of the image'),
969969 'enum': ['queued', 'saving', 'active', 'killed',
970 'deleted', 'pending_delete', 'deactivated'],
970 'deleted', 'uploading', 'importing',
971 'pending_delete', 'deactivated'],
971972 },
972973 'visibility': {
973974 'type': 'string',
1313 # under the License.
1414
1515 import glance.api.v2.schemas
16 import glance.db.sqlalchemy.api as db_api
1617 import glance.tests.unit.utils as unit_test_utils
1718 import glance.tests.utils as test_utils
1819
3334 'direct_url', 'min_ram', 'min_disk', 'protected',
3435 'locations', 'owner', 'virtual_size'])
3536 self.assertEqual(expected, set(output['properties'].keys()))
37
38 def test_image_has_correct_statuses(self):
39 req = unit_test_utils.get_fake_request()
40 output = self.controller.image(req)
41 self.assertEqual('image', output['name'])
42 expected_statuses = set(db_api.STATUSES)
43 actual_statuses = set(output['properties']['status']['enum'])
44 self.assertEqual(expected_statuses, actual_statuses)
3645
3746 def test_images(self):
3847 req = unit_test_utils.get_fake_request()