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
81 | 81 |
recoverable.
|
82 | 82 |
* - deactivated
|
83 | 83 |
- 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)*
|
84 | 92 |
|
85 | 93 |
**Image visibility**
|
86 | 94 |
|
967 | 967 |
'readOnly': True,
|
968 | 968 |
'description': _('Status of the image'),
|
969 | 969 |
'enum': ['queued', 'saving', 'active', 'killed',
|
970 | |
'deleted', 'pending_delete', 'deactivated'],
|
|
970 |
'deleted', 'uploading', 'importing',
|
|
971 |
'pending_delete', 'deactivated'],
|
971 | 972 |
},
|
972 | 973 |
'visibility': {
|
973 | 974 |
'type': 'string',
|
13 | 13 |
# under the License.
|
14 | 14 |
|
15 | 15 |
import glance.api.v2.schemas
|
|
16 |
import glance.db.sqlalchemy.api as db_api
|
16 | 17 |
import glance.tests.unit.utils as unit_test_utils
|
17 | 18 |
import glance.tests.utils as test_utils
|
18 | 19 |
|
|
33 | 34 |
'direct_url', 'min_ram', 'min_disk', 'protected',
|
34 | 35 |
'locations', 'owner', 'virtual_size'])
|
35 | 36 |
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)
|
36 | 45 |
|
37 | 46 |
def test_images(self):
|
38 | 47 |
req = unit_test_utils.get_fake_request()
|