Ghanshyam | 7fa397c | 2014-04-01 19:32:38 +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 | |
Ghanshyam | a8f6653 | 2014-04-23 17:18:14 +0900 | [diff] [blame] | 15 | import copy |
| 16 | |
Ken'ichi Ohmichi | 29cd512 | 2014-04-28 11:04:52 +0900 | [diff] [blame^] | 17 | from tempest.api_schema.compute import parameter_types |
| 18 | |
Ghanshyam | 7fa397c | 2014-04-01 19:32:38 +0900 | [diff] [blame] | 19 | get_password = { |
| 20 | 'status_code': [200], |
| 21 | 'response_body': { |
| 22 | 'type': 'object', |
| 23 | 'properties': { |
| 24 | 'password': {'type': 'string'} |
| 25 | }, |
| 26 | 'required': ['password'] |
| 27 | } |
| 28 | } |
Ghanshyam | d6d3040 | 2014-04-02 15:28:37 +0900 | [diff] [blame] | 29 | |
| 30 | get_vnc_console = { |
| 31 | 'status_code': [200], |
| 32 | 'response_body': { |
| 33 | 'type': 'object', |
| 34 | 'properties': { |
| 35 | 'console': { |
| 36 | 'type': 'object', |
| 37 | 'properties': { |
| 38 | 'type': {'type': 'string'}, |
| 39 | 'url': { |
| 40 | 'type': 'string', |
| 41 | 'format': 'uri' |
| 42 | } |
| 43 | }, |
| 44 | 'required': ['type', 'url'] |
| 45 | } |
| 46 | }, |
| 47 | 'required': ['console'] |
| 48 | } |
| 49 | } |
Ghanshyam | 4ac0274 | 2014-04-17 19:15:47 +0900 | [diff] [blame] | 50 | |
Ken'ichi Ohmichi | 29cd512 | 2014-04-28 11:04:52 +0900 | [diff] [blame^] | 51 | base_update_server = { |
| 52 | 'status_code': [200], |
| 53 | 'response_body': { |
| 54 | 'type': 'object', |
| 55 | 'properties': { |
| 56 | 'server': { |
| 57 | 'type': 'object', |
| 58 | 'properties': { |
| 59 | 'id': {'type': ['integer', 'string']}, |
| 60 | 'name': {'type': 'string'}, |
| 61 | 'status': {'type': 'string'}, |
| 62 | 'image': { |
| 63 | 'type': 'object', |
| 64 | 'properties': { |
| 65 | 'id': {'type': ['integer', 'string']}, |
| 66 | 'links': parameter_types.links |
| 67 | }, |
| 68 | 'required': ['id', 'links'] |
| 69 | }, |
| 70 | 'flavor': { |
| 71 | 'type': 'object', |
| 72 | 'properties': { |
| 73 | 'id': {'type': ['integer', 'string']}, |
| 74 | 'links': parameter_types.links |
| 75 | }, |
| 76 | 'required': ['id', 'links'] |
| 77 | }, |
| 78 | 'user_id': {'type': 'string'}, |
| 79 | 'tenant_id': {'type': 'string'}, |
| 80 | 'created': {'type': 'string'}, |
| 81 | 'updated': {'type': 'string'}, |
| 82 | 'progress': {'type': 'integer'}, |
| 83 | 'metadata': {'type': 'object'}, |
| 84 | 'links': parameter_types.links, |
| 85 | 'addresses': parameter_types.addresses, |
| 86 | }, |
| 87 | 'required': ['id', 'name', 'status', 'image', 'flavor', |
| 88 | 'user_id', 'tenant_id', 'created', 'updated', |
| 89 | 'progress', 'metadata', 'links', 'addresses'] |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
Ghanshyam | 4ac0274 | 2014-04-17 19:15:47 +0900 | [diff] [blame] | 95 | delete_server = { |
| 96 | 'status_code': [204], |
| 97 | } |
Haiwei Xu | 3d2b7af | 2014-04-12 02:50:26 +0900 | [diff] [blame] | 98 | |
| 99 | set_server_metadata = { |
| 100 | 'status_code': [200], |
| 101 | 'response_body': { |
| 102 | 'type': 'object', |
| 103 | 'properties': { |
Ghanshyam | eaaa6a4 | 2014-04-25 18:38:21 +0900 | [diff] [blame] | 104 | 'metadata': { |
| 105 | 'type': 'object', |
| 106 | 'patternProperties': { |
| 107 | '^.+$': {'type': 'string'} |
| 108 | } |
| 109 | } |
Haiwei Xu | 3d2b7af | 2014-04-12 02:50:26 +0900 | [diff] [blame] | 110 | }, |
| 111 | 'required': ['metadata'] |
| 112 | } |
| 113 | } |
Ghanshyam | a8f6653 | 2014-04-23 17:18:14 +0900 | [diff] [blame] | 114 | |
| 115 | list_server_metadata = copy.deepcopy(set_server_metadata) |
Ghanshyam | eaaa6a4 | 2014-04-25 18:38:21 +0900 | [diff] [blame] | 116 | |
| 117 | delete_server_metadata_item = { |
| 118 | 'status_code': [204] |
| 119 | } |