blob: 923c744a506468af2a4cb747705345aac5e76851 [file] [log] [blame]
Ghanshyamd34326c2014-03-19 12:18:53 +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
Marc Koderer6fbd74f2014-08-04 09:38:19 +020015from tempest.api_schema.response.compute import parameter_types
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090016
Ghanshyam2b14d422014-03-24 10:46:33 +090017common_image_schema = {
18 'type': 'object',
19 'properties': {
20 'id': {'type': 'string'},
21 'status': {'type': 'string'},
22 'updated': {'type': 'string'},
23 'links': parameter_types.links,
24 'name': {'type': 'string'},
25 'created': {'type': 'string'},
26 'minDisk': {'type': 'integer'},
27 'minRam': {'type': 'integer'},
28 'progress': {'type': 'integer'},
29 'metadata': {'type': 'object'},
30 'server': {
31 'type': 'object',
32 'properties': {
Ghanshyamc5b842d2014-06-10 17:06:05 +090033 'id': {'type': 'string'},
Ghanshyam2b14d422014-03-24 10:46:33 +090034 'links': parameter_types.links
35 },
36 'required': ['id', 'links']
37 },
38 'OS-EXT-IMG-SIZE:size': {'type': 'integer'}
39 },
40 # 'server' attributes only comes in response body if image is
41 # associated with any server. 'OS-EXT-IMG-SIZE:size' is API
42 # extension, So those are not defined as 'required'.
43 'required': ['id', 'status', 'updated', 'links', 'name',
44 'created', 'minDisk', 'minRam', 'progress',
45 'metadata']
46}
47
Ghanshyamd34326c2014-03-19 12:18:53 +090048get_image = {
49 'status_code': [200],
50 'response_body': {
51 'type': 'object',
52 'properties': {
Ghanshyam2b14d422014-03-24 10:46:33 +090053 'image': common_image_schema
Ghanshyamd34326c2014-03-19 12:18:53 +090054 },
55 'required': ['image']
56 }
57}
Ghanshyamfb67f062014-03-24 10:20:57 +090058
59list_images = {
60 'status_code': [200],
61 'response_body': {
62 'type': 'object',
63 'properties': {
64 'images': {
65 'type': 'array',
66 'items': {
67 'type': 'object',
68 'properties': {
69 'id': {'type': 'string'},
Ghanshyam2b14d422014-03-24 10:46:33 +090070 'links': parameter_types.links,
Ghanshyamfb67f062014-03-24 10:20:57 +090071 'name': {'type': 'string'}
72 },
73 'required': ['id', 'links', 'name']
74 }
75 }
76 },
77 'required': ['images']
78 }
79}
Ghanshyamfa9d39f2014-03-28 12:38:43 +090080
81create_image = {
Ken'ichi Ohmichi57b384b2014-03-28 13:58:20 +090082 'status_code': [202],
83 'response_header': {
84 'type': 'object',
85 'properties': {
86 'location': {
87 'type': 'string',
88 'format': 'uri'
89 }
90 },
91 'required': ['location']
92 }
Ghanshyamfa9d39f2014-03-28 12:38:43 +090093}
94
95delete = {
96 'status_code': [204]
97}
Ghanshyamf7873b02014-03-28 12:50:57 +090098
99image_metadata = {
100 'status_code': [200],
101 'response_body': {
102 'type': 'object',
103 'properties': {
104 'metadata': {'type': 'object'}
105 },
106 'required': ['metadata']
107 }
108}
Ghanshyam76c00f02014-03-28 13:02:22 +0900109
110image_meta_item = {
111 'status_code': [200],
112 'response_body': {
113 'type': 'object',
114 'properties': {
115 'meta': {'type': 'object'}
116 },
117 'required': ['meta']
118 }
119}
Ghanshyam2b14d422014-03-24 10:46:33 +0900120
121list_images_details = {
122 'status_code': [200],
123 'response_body': {
124 'type': 'object',
125 'properties': {
126 'images': {
127 'type': 'array',
128 'items': common_image_schema
129 }
130 },
131 'required': ['images']
132 }
133}