blob: 7fd6b8481860eac5edeac99cbfb962d0cccfe3bb [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
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090015from tempest.api_schema.compute import parameter_types
16
Ghanshyamd34326c2014-03-19 12:18:53 +090017get_image = {
18 'status_code': [200],
19 'response_body': {
20 'type': 'object',
21 'properties': {
22 'image': {
23 'type': 'object',
24 'properties': {
25 'id': {'type': 'string'},
26 'status': {'type': 'string'},
27 'updated': {'type': 'string'},
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090028 'links': parameter_types.links,
Ghanshyamd34326c2014-03-19 12:18:53 +090029 'name': {'type': 'string'},
30 'created': {'type': 'string'},
31 'OS-EXT-IMG-SIZE:size': {'type': 'integer'},
32 'minDisk': {'type': 'integer'},
33 'minRam': {'type': 'integer'},
34 'progress': {'type': 'integer'},
35 'metadata': {'type': 'object'},
36 'server': {
37 'type': 'object',
38 'properties': {
39 # NOTE: Now the type of 'id' is integer, but here
40 # allows 'string' also because we will be able to
41 # change it to 'uuid' in the future.
42 'id': {'type': ['integer', 'string']},
Ken'ichi Ohmichi024cdae2014-03-24 08:05:59 +090043 'links': parameter_types.links
Ghanshyamd34326c2014-03-19 12:18:53 +090044 },
45 'required': ['id', 'links']
46 }
47 },
48 # 'server' attributes only comes in response body if image is
49 # associated with any server. So it is not 'required'
50 'required': ['id', 'status', 'updated', 'links', 'name',
51 'created', 'OS-EXT-IMG-SIZE:size', 'minDisk',
52 'minRam', 'progress', 'metadata']
53 }
54 },
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'},
70 'links': {
71 'type': 'array',
72 'items': {
73 'type': 'object',
74 'properties': {
75 'href': {
76 'type': 'string',
77 'format': 'uri'
78 },
79 'rel': {'type': 'string'}
80 },
81 'required': ['href', 'rel']
82 }
83 },
84 'name': {'type': 'string'}
85 },
86 'required': ['id', 'links', 'name']
87 }
88 }
89 },
90 'required': ['images']
91 }
92}
Ghanshyamfa9d39f2014-03-28 12:38:43 +090093
94create_image = {
95 'status_code': [202]
96}
97
98delete = {
99 'status_code': [204]
100}
Ghanshyamf7873b02014-03-28 12:50:57 +0900101
102image_metadata = {
103 'status_code': [200],
104 'response_body': {
105 'type': 'object',
106 'properties': {
107 'metadata': {'type': 'object'}
108 },
109 'required': ['metadata']
110 }
111}