blob: 2cf8f9b8b10140d8f23d26110efb9b7fe60591ba [file] [log] [blame]
Haiwei Xu03a0e9d2014-03-28 02:22:50 +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
Haiwei Xu11e69da2014-03-28 04:00:45 +090015import copy
Haiwei Xu03a0e9d2014-03-28 02:22:50 +090016from tempest.api_schema.compute.v2 import hosts
17
18startup_host = {
19 'status_code': [200],
20 'response_body': {
21 'type': 'object',
22 'properties': {
23 'host': hosts.body
24 },
25 'required': ['host']
26 }
27}
Haiwei Xu11e69da2014-03-28 04:00:45 +090028
29# The 'power_action' attribute of 'shutdown_host' API is 'shutdown'
30shutdown_host = copy.deepcopy(startup_host)
31
32shutdown_host['response_body']['properties']['power_action'] = {
33 'enum': ['shutdown']
34}
35
36# The 'power_action' attribute of 'reboot_host' API is 'reboot'
37reboot_host = copy.deepcopy(startup_host)
38
39reboot_host['response_body']['properties']['power_action'] = {
40 'enum': ['reboot']
41}