Haiwei Xu | 03a0e9d | 2014-03-28 02:22:50 +0900 | [diff] [blame] | 1 | # 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 Xu | 11e69da | 2014-03-28 04:00:45 +0900 | [diff] [blame] | 15 | import copy |
| 16 | |
Ken'ichi Ohmichi | 0b31d30 | 2014-05-01 10:53:25 +0900 | [diff] [blame] | 17 | from tempest.api_schema.compute import hosts |
| 18 | |
Haiwei Xu | 03a0e9d | 2014-03-28 02:22:50 +0900 | [diff] [blame] | 19 | |
| 20 | startup_host = { |
| 21 | 'status_code': [200], |
Ken'ichi Ohmichi | 0b31d30 | 2014-05-01 10:53:25 +0900 | [diff] [blame] | 22 | 'response_body': hosts.common_start_up_body |
Haiwei Xu | 03a0e9d | 2014-03-28 02:22:50 +0900 | [diff] [blame] | 23 | } |
Haiwei Xu | 11e69da | 2014-03-28 04:00:45 +0900 | [diff] [blame] | 24 | |
| 25 | # The 'power_action' attribute of 'shutdown_host' API is 'shutdown' |
| 26 | shutdown_host = copy.deepcopy(startup_host) |
| 27 | |
| 28 | shutdown_host['response_body']['properties']['power_action'] = { |
| 29 | 'enum': ['shutdown'] |
| 30 | } |
| 31 | |
| 32 | # The 'power_action' attribute of 'reboot_host' API is 'reboot' |
| 33 | reboot_host = copy.deepcopy(startup_host) |
| 34 | |
| 35 | reboot_host['response_body']['properties']['power_action'] = { |
| 36 | 'enum': ['reboot'] |
| 37 | } |
Ghanshyam | f0bc57f | 2014-04-28 11:30:33 +0900 | [diff] [blame] | 38 | |
| 39 | update_host = { |
| 40 | 'status_code': [200], |
| 41 | 'response_body': hosts.update_host_common |
| 42 | } |