blob: afcceacd2691b06d19f03f784e13509119d83360 [file] [log] [blame]
Ken'ichi Ohmichi02604582014-03-14 16:23:41 +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
Ken'ichi Ohmichi29cd5122014-04-28 11:04:52 +090015import copy
16
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090017from tempest.api_schema.compute import parameter_types
Ken'ichi Ohmichi29cd5122014-04-28 11:04:52 +090018from tempest.api_schema.compute import servers
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090019
Ken'ichi Ohmichi02604582014-03-14 16:23:41 +090020create_server = {
21 'status_code': [202],
22 'response_body': {
23 'type': 'object',
24 'properties': {
25 'server': {
26 'type': 'object',
27 'properties': {
Ghanshyamc5b842d2014-06-10 17:06:05 +090028 'id': {'type': 'string'},
Ken'ichi Ohmichi02604582014-03-14 16:23:41 +090029 'security_groups': {'type': 'array'},
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090030 'links': parameter_types.links,
Ken'ichi Ohmichi02604582014-03-14 16:23:41 +090031 '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'.
JordanP551140c2014-04-02 11:16:09 +020037 # 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 Ohmichi02604582014-03-14 16:23:41 +090040 }
41 },
42 'required': ['server']
43 }
44}
Ghanshyam08ce58d2014-04-04 14:51:14 +090045
Ken'ichi Ohmichi29cd5122014-04-28 11:04:52 +090046update_server = copy.deepcopy(servers.base_update_server)
47update_server['response_body']['properties']['server']['properties'].update({
48 'hostId': {'type': 'string'},
49 'OS-DCF:diskConfig': {'type': 'string'},
50 'accessIPv4': parameter_types.access_ip_v4,
51 'accessIPv6': parameter_types.access_ip_v6
52})
53update_server['response_body']['properties']['server']['required'].append(
54 # NOTE: OS-DCF:diskConfig and accessIPv4/v6 are API
55 # extensions, and some environments return a response
56 # without these attributes. So they are not 'required'.
57 'hostId'
58)
59
Ghanshyam08ce58d2014-04-04 14:51:14 +090060list_virtual_interfaces = {
61 'status_code': [200],
62 'response_body': {
63 'type': 'object',
64 'properties': {
65 'virtual_interfaces': {
66 'type': 'array',
67 'items': {
68 'type': 'object',
69 'properties': {
70 'id': {'type': 'string'},
71 'mac_address': parameter_types.mac_address,
72 'OS-EXT-VIF-NET:net_id': {'type': 'string'}
73 },
74 # 'OS-EXT-VIF-NET:net_id' is API extension So it is
75 # not defined as 'required'
76 'required': ['id', 'mac_address']
77 }
78 }
79 },
80 'required': ['virtual_interfaces']
81 }
82}
Ghanshyam385c4e72014-03-27 11:42:25 +090083
84attach_volume = {
85 'status_code': [200],
86 'response_body': {
87 'type': 'object',
88 'properties': {
89 'volumeAttachment': {
90 'type': 'object',
91 'properties': {
92 'id': {'type': 'string'},
93 'device': {'type': 'string'},
94 'volumeId': {'type': 'string'},
95 'serverId': {'type': ['integer', 'string']}
96 },
97 'required': ['id', 'device', 'volumeId', 'serverId']
98 }
99 },
100 'required': ['volumeAttachment']
101 }
102}
103
104detach_volume = {
105 'status_code': [202]
106}
Ghanshyameaaa6a42014-04-25 18:38:21 +0900107
108set_get_server_metadata_item = {
109 'status_code': [200],
110 'response_body': {
111 'type': 'object',
112 'properties': {
113 'meta': {
114 'type': 'object',
115 'patternProperties': {
116 '^.+$': {'type': 'string'}
117 }
118 }
119 },
120 'required': ['meta']
121 }
122}
Ghanshyam9541ad12014-05-07 16:38:43 +0900123
124list_addresses_by_network = {
125 'status_code': [200],
126 'response_body': parameter_types.addresses
127}
Ghanshyam997c9092014-04-03 19:00:20 +0900128
129server_actions_confirm_resize = copy.deepcopy(
130 servers.server_actions_delete_password)
Ghanshyamd847c582014-05-07 16:21:36 +0900131
132list_addresses = {
133 'status_code': [200],
134 'response_body': {
135 'type': 'object',
136 'properties': {
137 'addresses': parameter_types.addresses
138 },
139 'required': ['addresses']
140 }
141}