blob: aa31827ef4965cc702d426fa77a37ae682519e01 [file] [log] [blame]
Ghanshyam028044c2014-03-26 19:20:28 +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
16from tempest.api_schema.compute import hypervisors
17
18list_hypervisors_detail = copy.deepcopy(
19 hypervisors.common_list_hypervisors_detail)
20# Defining extra attributes for V3 show hypervisor schema
21list_hypervisors_detail['response_body']['properties']['hypervisors'][
22 'items']['properties']['os-pci:pci_stats'] = {'type': 'array'}
Ghanshyam3495c4f2014-03-24 09:22:57 +090023
24show_hypervisor = copy.deepcopy(hypervisors.common_show_hypervisor)
25# Defining extra attributes for V3 show hypervisor schema
26show_hypervisor['response_body']['properties']['hypervisor']['properties'][
27 'os-pci:pci_stats'] = {'type': 'array'}
Ghanshyam8676fa62014-03-26 20:00:37 +090028
29hypervisors_servers = copy.deepcopy(hypervisors.common_hypervisors_info)
30
31# Defining extra attributes for V3 show hypervisor schema
32hypervisors_servers['response_body']['properties']['hypervisor']['properties'][
33 'servers'] = {
34 'type': 'array',
35 'items': {
36 'type': 'object',
37 'properties': {
38 # NOTE: Now the type of 'id' is integer,
39 # but here allows 'string' also because we
40 # will be able to change it to 'uuid' in
41 # the future.
42 'id': {'type': ['integer', 'string']},
43 'name': {'type': 'string'}
44 }
45 }
46 }
47# V3 API response body always contains the 'servers' attribute even there
48# is no server (VM) are present on Hypervisor host.
49hypervisors_servers['response_body']['properties']['hypervisor'][
50 'required'] = ['id', 'hypervisor_hostname', 'servers']