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 | |
| 15 | create_server = { |
| 16 | 'status_code': [202], |
| 17 | 'response_body': { |
| 18 | 'type': 'object', |
| 19 | 'properties': { |
| 20 | 'server': { |
| 21 | 'type': 'object', |
| 22 | 'properties': { |
| 23 | # NOTE: Now the type of 'id' is uuid, but here allows |
| 24 | # 'integer' also because old OpenStack uses 'integer' |
| 25 | # as a server id. |
| 26 | 'id': {'type': ['integer', 'string']}, |
| 27 | 'security_groups': {'type': 'array'}, |
| 28 | 'links': { |
| 29 | 'type': 'array', |
| 30 | 'items': { |
| 31 | 'type': 'object', |
| 32 | 'properties': { |
| 33 | 'href': { |
| 34 | 'type': 'string', |
| 35 | 'format': 'uri' |
| 36 | }, |
| 37 | 'rel': {'type': 'string'} |
| 38 | }, |
| 39 | 'required': ['href', 'rel'] |
| 40 | } |
| 41 | }, |
| 42 | 'adminPass': {'type': 'string'}, |
| 43 | 'OS-DCF:diskConfig': {'type': 'string'} |
| 44 | }, |
| 45 | # NOTE: OS-DCF:diskConfig is API extension, and some |
| 46 | # environments return a response without the attribute. |
| 47 | # So it is not 'required'. |
| 48 | 'required': ['id', 'security_groups', 'links', 'adminPass'] |
| 49 | } |
| 50 | }, |
| 51 | 'required': ['server'] |
| 52 | } |
| 53 | } |