blob: 542d2b1dd4f6e07d3a26c2256cd62be1f6055634 [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
18
19list_flavors_details = copy.deepcopy(flavors.common_flavor_list_details)
20
21# NOTE- In v3 API, 'swap' comes as '0' not empty string '""'
22# (In V2 API, it comes as empty string) So leaving 'swap'as integer type only.
23
24# Defining extra attributes for V3 flavor schema
25list_flavors_details['response_body']['properties']['flavors']['items'][
26 'properties'].update({'disabled': {'type': 'boolean'},
27 'ephemeral': {'type': 'integer'},
28 'flavor-access:is_public': {'type': 'boolean'},
29 'os-flavor-rxtx:rxtx_factor': {'type': 'number'}})
30# 'flavor-access' and 'os-flavor-rxtx' are API extensions.
31# So they are not 'required'.
32list_flavors_details['response_body']['properties']['flavors']['items'][
33 'required'].extend(['disabled', 'ephemeral'])