Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle creating an image from a server with microversion > 2.35
The compute 2.35 API deprecates the compute image proxy APIs for showing/listing/deleting images. The compute 2.45 API removes the 'location' header from the createImage server action response and in that same version, adds a response body with a single "image_id" key. This change updates the BaseV2ComputeTest.create_image_from_server helper method to be aware of the microversion that the test running this code is using, and adjust the client to use appropriately. As a result, the compute images client needs to be aware of the changed createImage response schema so that is added for compute API version 2.45. Change-Id: I5551af0064f9cca594ae533379d0b0ae14444f88
- Loading branch information
Showing
5 changed files
with
71 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# The 2.45 microversion removes the "location" header and adds "image_id" | ||
# to the response body. | ||
create_image = { | ||
'status_code': [202], | ||
'response_body': { | ||
'type': 'object', | ||
'properties': { | ||
'image_id': {'type': 'string'} | ||
}, | ||
'additionalProperties': False, | ||
'required': ['image_id'] | ||
} | ||
} | ||
|
||
# NOTE(mriedem): The compute proxy APIs for showing/listing and deleting | ||
# images were deprecated in microversion 2.35, and the compute proxy APIs for | ||
# working with image metadata were deprecated in microversion 2.39. Therefore, | ||
# client-side code shouldn't rely on those APIs in the compute images client | ||
# past those microversions and should instead use the Glance images client | ||
# directly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters