Ken'ichi Ohmichi | 0260458 | 2014-03-14 16:23:41 +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 | |
Ken'ichi Ohmichi | 024cdae | 2014-03-24 08:05:59 +0900 | [diff] [blame] | 15 | from tempest.api_schema.compute import parameter_types |
| 16 | |
Ken'ichi Ohmichi | 0260458 | 2014-03-14 16:23:41 +0900 | [diff] [blame] | 17 | create_server = { |
| 18 | 'status_code': [202], |
| 19 | 'response_body': { |
| 20 | 'type': 'object', |
| 21 | 'properties': { |
| 22 | 'server': { |
| 23 | 'type': 'object', |
| 24 | 'properties': { |
| 25 | # NOTE: Now the type of 'id' is uuid, but here allows |
| 26 | # 'integer' also because old OpenStack uses 'integer' |
| 27 | # as a server id. |
| 28 | 'id': {'type': ['integer', 'string']}, |
| 29 | 'security_groups': {'type': 'array'}, |
Ken'ichi Ohmichi | 024cdae | 2014-03-24 08:05:59 +0900 | [diff] [blame] | 30 | 'links': parameter_types.links, |
Ken'ichi Ohmichi | 0260458 | 2014-03-14 16:23:41 +0900 | [diff] [blame] | 31 | 'adminPass': {'type': 'string'}, |
| 32 | 'OS-DCF:diskConfig': {'type': 'string'} |
| 33 | }, |
| 34 | # NOTE: OS-DCF:diskConfig is API extension, and some |
| 35 | # environments return a response without the attribute. |
| 36 | # So it is not 'required'. |
JordanP | 551140c | 2014-04-02 11:16:09 +0200 | [diff] [blame] | 37 | # NOTE: adminPass is not required because it can be deactivated |
| 38 | # with nova API flag enable_instance_password=False |
| 39 | 'required': ['id', 'security_groups', 'links'] |
Ken'ichi Ohmichi | 0260458 | 2014-03-14 16:23:41 +0900 | [diff] [blame] | 40 | } |
| 41 | }, |
| 42 | 'required': ['server'] |
| 43 | } |
| 44 | } |
Ghanshyam | 08ce58d | 2014-04-04 14:51:14 +0900 | [diff] [blame] | 45 | |
| 46 | list_virtual_interfaces = { |
| 47 | 'status_code': [200], |
| 48 | 'response_body': { |
| 49 | 'type': 'object', |
| 50 | 'properties': { |
| 51 | 'virtual_interfaces': { |
| 52 | 'type': 'array', |
| 53 | 'items': { |
| 54 | 'type': 'object', |
| 55 | 'properties': { |
| 56 | 'id': {'type': 'string'}, |
| 57 | 'mac_address': parameter_types.mac_address, |
| 58 | 'OS-EXT-VIF-NET:net_id': {'type': 'string'} |
| 59 | }, |
| 60 | # 'OS-EXT-VIF-NET:net_id' is API extension So it is |
| 61 | # not defined as 'required' |
| 62 | 'required': ['id', 'mac_address'] |
| 63 | } |
| 64 | } |
| 65 | }, |
| 66 | 'required': ['virtual_interfaces'] |
| 67 | } |
| 68 | } |
Ghanshyam | 385c4e7 | 2014-03-27 11:42:25 +0900 | [diff] [blame] | 69 | |
| 70 | attach_volume = { |
| 71 | 'status_code': [200], |
| 72 | 'response_body': { |
| 73 | 'type': 'object', |
| 74 | 'properties': { |
| 75 | 'volumeAttachment': { |
| 76 | 'type': 'object', |
| 77 | 'properties': { |
| 78 | 'id': {'type': 'string'}, |
| 79 | 'device': {'type': 'string'}, |
| 80 | 'volumeId': {'type': 'string'}, |
| 81 | 'serverId': {'type': ['integer', 'string']} |
| 82 | }, |
| 83 | 'required': ['id', 'device', 'volumeId', 'serverId'] |
| 84 | } |
| 85 | }, |
| 86 | 'required': ['volumeAttachment'] |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | detach_volume = { |
| 91 | 'status_code': [202] |
| 92 | } |