blob: 468658c0cafc551d9a6c389e8b072f524e24bee1 [file] [log] [blame]
Ghanshyambcd09102014-03-26 18:03:29 +09001# Copyright 2014 NEC Corporation. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15import copy
16
17from tempest.api_schema.compute import flavors
Ghanshyam639d8422014-03-26 18:23:32 +090018from tempest.api_schema.compute import flavors_extra_specs
Ghanshyambcd09102014-03-26 18:03:29 +090019
20list_flavors_details = copy.deepcopy(flavors.common_flavor_list_details)
21
22# NOTE- In v3 API, 'swap' comes as '0' not empty string '""'
23# (In V2 API, it comes as empty string) So leaving 'swap'as integer type only.
24
25# Defining extra attributes for V3 flavor schema
26list_flavors_details['response_body']['properties']['flavors']['items'][
27 'properties'].update({'disabled': {'type': 'boolean'},
28 'ephemeral': {'type': 'integer'},
29 'flavor-access:is_public': {'type': 'boolean'},
30 'os-flavor-rxtx:rxtx_factor': {'type': 'number'}})
31# 'flavor-access' and 'os-flavor-rxtx' are API extensions.
32# So they are not 'required'.
33list_flavors_details['response_body']['properties']['flavors']['items'][
34 'required'].extend(['disabled', 'ephemeral'])
Ghanshyam639d8422014-03-26 18:23:32 +090035
36set_flavor_extra_specs = copy.deepcopy(flavors_extra_specs.flavor_extra_specs)
37set_flavor_extra_specs['status_code'] = [201]
38
39unset_flavor_extra_specs = {
40 'status_code': [204]
41}