blob: 41b8fff5c3f919035dedf1ad6bce9a336c61aeec [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
15get_image = {
16 'status_code': [200],
17 'response_body': {
18 'type': 'object',
19 'properties': {
20 'image': {
21 'type': 'object',
22 'properties': {
23 'id': {'type': 'string'},
24 'status': {'type': 'string'},
25 'updated': {'type': 'string'},
26 'links': {
27 'type': 'array',
28 'items': {
29 'type': 'object',
30 'properties': {
31 'href': {
32 'type': 'string',
33 'format': 'uri'
34 },
35 'rel': {'type': 'string'}
36 },
37 'required': ['href', 'rel']
38 }
39 },
40 'name': {'type': 'string'},
41 'created': {'type': 'string'},
42 'OS-EXT-IMG-SIZE:size': {'type': 'integer'},
43 'minDisk': {'type': 'integer'},
44 'minRam': {'type': 'integer'},
45 'progress': {'type': 'integer'},
46 'metadata': {'type': 'object'},
47 'server': {
48 'type': 'object',
49 'properties': {
50 # NOTE: Now the type of 'id' is integer, but here
51 # allows 'string' also because we will be able to
52 # change it to 'uuid' in the future.
53 'id': {'type': ['integer', 'string']},
54 'links': {
55 'type': 'array',
56 'items': {
57 'type': 'object',
58 'properties': {
59 'href': {
60 'type': 'string',
61 'format': 'uri'
62 },
63 'rel': {'type': 'string'}
64 },
65 'required': ['href', 'rel']
66 }
67 }
68 },
69 'required': ['id', 'links']
70 }
71 },
72 # 'server' attributes only comes in response body if image is
73 # associated with any server. So it is not 'required'
74 'required': ['id', 'status', 'updated', 'links', 'name',
75 'created', 'OS-EXT-IMG-SIZE:size', 'minDisk',
76 'minRam', 'progress', 'metadata']
77 }
78 },
79 'required': ['image']
80 }
81}
Ghanshyamfb67f062014-03-24 10:20:57 +090082
83list_images = {
84 'status_code': [200],
85 'response_body': {
86 'type': 'object',
87 'properties': {
88 'images': {
89 'type': 'array',
90 'items': {
91 'type': 'object',
92 'properties': {
93 'id': {'type': 'string'},
94 'links': {
95 'type': 'array',
96 'items': {
97 'type': 'object',
98 'properties': {
99 'href': {
100 'type': 'string',
101 'format': 'uri'
102 },
103 'rel': {'type': 'string'}
104 },
105 'required': ['href', 'rel']
106 }
107 },
108 'name': {'type': 'string'}
109 },
110 'required': ['id', 'links', 'name']
111 }
112 }
113 },
114 'required': ['images']
115 }
116}