Debian Codegraph @

glanceclient/v2/namespace_schema.py

raw symbols SCIP
1 # Copyright 2015 OpenStack Foundation
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15
16
17 # NOTE(flaper87): Keep a copy of the current default schema so that
18 # we can react on cases where there's no connection to an OpenStack
19 # deployment. See #1481729
20 BASE_SCHEMA = {
21 "additionalProperties": False,
22 "definitions": {
23 "positiveInteger": {
24 "minimum": 0,
25 "type": "integer"
26 },
27 "positiveIntegerDefault0": {
28 "allOf": [
29 {"$ref": "#/definitions/positiveInteger"},
30 {"default": 0}
31 ]
32 },
33 "stringArray": {
34 "type": "array",
35 "items": {"type": "string"},
36 "uniqueItems": True
37 },
38 "property": {
39 "type": "object",
40 "additionalProperties": {
41 "type": "object",
42 "required": ["title", "type"],
43 "properties": {
44 "name": {
45 "type": "string"
46 },
47 "title": {
48 "type": "string"
49 },
50 "description": {
51 "type": "string"
52 },
53 "operators": {
54 "type": "array",
55 "items": {
56 "type": "string"
57 }
58 },
59 "type": {
60 "type": "string",
61 "enum": [
62 "array",
63 "boolean",
64 "integer",
65 "number",
66 "object",
67 "string",
68 None
69 ]
70 },
71 "required": {
72 "$ref": "#/definitions/stringArray"
73 },
74 "minimum": {
75 "type": "number"
76 },
77 "maximum": {
78 "type": "number"
79 },
80 "maxLength": {
81 "$ref": "#/definitions/positiveInteger"
82 },
83 "minLength": {
84 "$ref": "#/definitions/positiveIntegerDefault0"
85 },
86 "pattern": {
87 "type": "string",
88 "format": "regex"
89 },
90 "enum": {
91 "type": "array"
92 },
93 "readonly": {
94 "type": "boolean"
95 },
96 "default": {},
97 "items": {
98 "type": "object",
99 "properties": {
100 "type": {
101 "type": "string",
102 "enum": [
103 "array",
104 "boolean",
105 "integer",
106 "number",
107 "object",
108 "string",
109 None
110 ]
111 },
112 "enum": {
113 "type": "array"
114 }
115 }
116 },
117 "maxItems": {
118 "$ref": "#/definitions/positiveInteger"
119 },
120 "minItems": {
121 "$ref": "#/definitions/positiveIntegerDefault0"
122 },
123 "uniqueItems": {
124 "type": "boolean",
125 "default": False
126 },
127 "additionalItems": {
128 "type": "boolean"
129 },
130 }
131 }
132 }
133 },
134 "required": ["namespace"],
135 "name": "namespace",
136 "properties": {
137 "namespace": {
138 "type": "string",
139 "description": "The unique namespace text.",
140 "maxLength": 80
141 },
142 "display_name": {
143 "type": "string",
144 "description": "The user friendly name for the namespace. Used by "
145 "UI if available.",
146 "maxLength": 80
147 },
148 "description": {
149 "type": "string",
150 "description": "Provides a user friendly description of the "
151 "namespace.",
152 "maxLength": 500
153 },
154 "visibility": {
155 "enum": [
156 "public",
157 "private"
158 ],
159 "type": "string",
160 "description": "Scope of namespace accessibility."
161 },
162 "protected": {
163 "type": "boolean",
164 "description": "If true, namespace will not be deletable."
165 },
166 "owner": {
167 "type": "string",
168 "description": "Owner of the namespace.",
169 "maxLength": 255
170 },
171 "created_at": {
172 "type": "string",
173 "readOnly": True,
174 "description": "Date and time of namespace creation.",
175 "format": "date-time"
176 },
177 "updated_at": {
178 "type": "string",
179 "readOnly": True,
180 "description": "Date and time of the last namespace modification.",
181 "format": "date-time"
182 },
183 "schema": {
184 "readOnly": True,
185 "type": "string"
186 },
187 "self": {
188 "readOnly": True,
189 "type": "string"
190 },
191 "resource_type_associations": {
192 "type": "array",
193 "items": {
194 "type": "object",
195 "properties": {
196 "name": {
197 "type": "string"
198 },
199 "prefix": {
200 "type": "string"
201 },
202 "properties_target": {
203 "type": "string"
204 }
205 }
206 }
207 },
208 "properties": {
209 "$ref": "#/definitions/property"
210 },
211 "objects": {
212 "items": {
213 "type": "object",
214 "properties": {
215 "required": {
216 "$ref": "#/definitions/stringArray"
217 },
218 "description": {
219 "type": "string"
220 },
221 "name": {
222 "type": "string"
223 },
224 "properties": {
225 "$ref": "#/definitions/property"
226 }
227 }
228 },
229 "type": "array"
230 },
231 "tags": {
232 "items": {
233 "type": "object",
234 "properties": {
235 "name": {
236 "type": "string"
237 }
238 }
239 },
240 "type": "array"
241 },
242 }
243 }