~ziad-sawalha/keystone/master

« back to all changes in this revision

Viewing changes to keystone/content/service/xsd/version.xsd

  • Committer: Dolph Mathews
  • Author(s): Ziad Sawalha
  • Date: 2011-08-15 14:33:24 UTC
  • Revision ID: git-v1:d9d6a2dd7e01a9ff502b35a1c7b08149c11b362c
Added reponse handling for xsd static file rendering

Change-Id: Iccf2b5b4947d2d8c16ddcf4412657d01bd570729

Schema updates. Split WADLs and extensions and got xsds to compile

Change-Id: I68d34df56f76d86c3764da74b4afe7e67f8ee616

Added reponse handling for xsd static file rendering

Change-Id: Iccf2b5b4947d2d8c16ddcf4412657d01bd570729

Added reponse handling for xsd static file rendering

Change-Id: Iccf2b5b4947d2d8c16ddcf4412657d01bd570729

Extension handling and static file content reorganization

Change-Id: I9f0f66c90df3f43933dc1a578cef2691f4fb332f

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<?xml-stylesheet type="text/xsl" href="../xslt/schema.xslt"?>
 
3
 
 
4
<!-- (C) 2011 OpenStack LLC., All Rights Reserved -->
 
5
 
 
6
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
 
7
           targetNamespace="http://docs.openstack.org/common/api/v1.0"
 
8
           xmlns:vers="http://docs.openstack.org/common/api/v1.0"
 
9
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
 
10
           xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
 
11
           xmlns:html="http://www.w3.org/1999/xhtml"
 
12
           xmlns:atom="http://www.w3.org/2005/Atom"
 
13
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
14
    
 
15
    <xs:annotation>
 
16
        <xs:appinfo
 
17
            xml:lang="EN"
 
18
            xmlns="http://www.w3.org/1999/xhtml">
 
19
            <xsdxt:title>Version Types</xsdxt:title>
 
20
            <xsdxt:link rel="index" href="api-common.xsd" />
 
21
        </xs:appinfo>
 
22
        <xs:documentation
 
23
            xml:lang="EN"
 
24
            xmlns="http://www.w3.org/1999/xhtml">
 
25
            <p>
 
26
                This schema file defines all types related to versioning.
 
27
            </p>
 
28
        </xs:documentation>
 
29
    </xs:annotation>
 
30
 
 
31
    <!-- Import ATOM specific schema definitions -->
 
32
    <xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="atom/atom.xsd" />
 
33
    
 
34
    <!-- Multiple choices -->
 
35
    <xs:element name="choices" type="vers:VersionChoiceList">
 
36
        <xs:annotation>
 
37
            <xs:documentation
 
38
                xml:lang="EN"
 
39
                xmlns="http://www.w3.org/1999/xhtml">
 
40
                <p>
 
41
                    This element is returned when the version of the
 
42
                    resource cannot be determined. The element
 
43
                    provides a list of choices for the resource.
 
44
                </p>
 
45
            </xs:documentation>
 
46
            <xs:appinfo>
 
47
                <xsdxt:samples>
 
48
                    <xsdxt:sample>
 
49
                        <xsdxt:code type="application/xml" href="../samples/choices.xml" />
 
50
                    </xsdxt:sample>
 
51
                    <xsdxt:sample>
 
52
                        <xsdxt:code type="application/json" href="../samples/choices.json" />
 
53
                    </xsdxt:sample>
 
54
                </xsdxt:samples>
 
55
            </xs:appinfo>
 
56
        </xs:annotation>
 
57
    </xs:element>
 
58
 
 
59
    <!-- Versioning -->
 
60
    <xs:element name="versions" type="vers:VersionChoiceList">
 
61
        <xs:annotation>
 
62
            <xs:documentation
 
63
                xml:lang="EN"
 
64
                xmlns="http://www.w3.org/1999/xhtml">
 
65
                <p>
 
66
                    Provides a list of supported versions.
 
67
                </p>
 
68
            </xs:documentation>
 
69
            <xs:appinfo>
 
70
                <xsdxt:samples>
 
71
                    <xsdxt:sample>
 
72
                        <xsdxt:code type="application/xml" href="../samples/versions.xml" />
 
73
                    </xsdxt:sample>
 
74
                    <xsdxt:sample>
 
75
                        <xsdxt:code type="application/json" href="../samples/versions.json" />
 
76
                    </xsdxt:sample>
 
77
                    <xsdxt:sample>
 
78
                        <xsdxt:code type="application/atom+xml" href="../samples/versions-atom.xml" />
 
79
                    </xsdxt:sample>
 
80
                </xsdxt:samples>
 
81
            </xs:appinfo>
 
82
        </xs:annotation>
 
83
    </xs:element>
 
84
    <xs:element name="version" type="vers:VersionChoice" vc:minVersion="1.0" vc:maxVersion="1.1">
 
85
        <xs:annotation>
 
86
            <xs:documentation
 
87
                xml:lang="EN"
 
88
                xmlns="http://www.w3.org/1999/xhtml">
 
89
                <p>
 
90
                    This element provides detailed meta information
 
91
                    regarding the status of the current API version.
 
92
                    This is the XSD 1.0 compatible element definition.
 
93
                </p>
 
94
            </xs:documentation>
 
95
        </xs:annotation>
 
96
    </xs:element>
 
97
 
 
98
    <xs:element name="version2" type="vers:VersionChoiceRoot" vc:minVersion="1.1">
 
99
        <xs:annotation>
 
100
            <xs:documentation
 
101
                xml:lang="EN"
 
102
                xmlns="http://www.w3.org/1999/xhtml">
 
103
                <p>
 
104
                    This element provides detailed meta information
 
105
                    regarding the status of the current API
 
106
                    version. The description should include a pointer
 
107
                    to both a human readable and a machine processable
 
108
                    description of the API service.
 
109
                </p>
 
110
            </xs:documentation>
 
111
            <xs:appinfo>
 
112
                <xsdxt:samples>
 
113
                    <xsdxt:sample>
 
114
                        <xsdxt:code type="application/xml" href="../samples/version.xml" />
 
115
                    </xsdxt:sample>
 
116
                    <xsdxt:sample>
 
117
                        <xsdxt:code type="application/json" href="../samples/version.json" />
 
118
                    </xsdxt:sample>
 
119
                    <xsdxt:sample>
 
120
                        <xsdxt:code type="application/atom+xml" href="../samples/version-atom.xml" />
 
121
                    </xsdxt:sample>
 
122
                </xsdxt:samples>
 
123
            </xs:appinfo>
 
124
        </xs:annotation>
 
125
    </xs:element>
 
126
 
 
127
    <!-- Types -->
 
128
    <xs:simpleType name="VersionStatus">
 
129
        <xs:annotation>
 
130
            <xs:documentation>
 
131
                <html:p>
 
132
                    The VersionStatus type describes a service's operational status.
 
133
                </html:p>
 
134
            </xs:documentation>
 
135
        </xs:annotation>
 
136
        
 
137
        <xs:restriction base="xs:string">
 
138
            <xs:enumeration value="ALPHA">
 
139
                <xs:annotation>
 
140
                    <xs:documentation>
 
141
                        <html:p>
 
142
                            This is a new service the API. Thi API
 
143
                            contract may be set, but the implementaiton
 
144
                            may not be 100% complient with it. Developers
 
145
                            are encouraged to begin testing aganst an
 
146
                            ALPHA version to provide feedback.
 
147
                        </html:p>
 
148
                    </xs:documentation>
 
149
                </xs:annotation>
 
150
            </xs:enumeration>
 
151
            <xs:enumeration value="BETA">
 
152
                <xs:annotation>
 
153
                    <xs:documentation>
 
154
                        <html:p>
 
155
                            A status of BETA indicates that this
 
156
                            version is a candidate for the next major
 
157
                            release and may feature functionality not
 
158
                            available in the current
 
159
                            version. Developers are encouraged to test
 
160
                            and begin the migration processes to a
 
161
                            BETA version. Note that a BETA version is
 
162
                            undergoing testing, it has not been
 
163
                            officially released, and my not be stable.
 
164
                        </html:p>
 
165
                    </xs:documentation>
 
166
                </xs:annotation>
 
167
            </xs:enumeration>
 
168
            <xs:enumeration value="CURRENT">
 
169
                <xs:annotation>
 
170
                    <xs:documentation>
 
171
                        <html:p>
 
172
                            The API version is stable and has been
 
173
                            tested. Developers are encouraged to
 
174
                            develop against this API version. The
 
175
                            current released version of the API will
 
176
                            always be marked as CURRENT.
 
177
                        </html:p>
 
178
                    </xs:documentation>
 
179
                </xs:annotation>
 
180
            </xs:enumeration>
 
181
            <xs:enumeration value="DEPRECATED">
 
182
                <xs:annotation>
 
183
                    <xs:documentation>
 
184
                        <html:p>
 
185
                            A status of DEPRECATED indicates that a
 
186
                            newer version of the API is
 
187
                            available. Application developers are
 
188
                            discouraged from using this version and
 
189
                            should instead develop against the latest
 
190
                            current version of the API.
 
191
                        </html:p>
 
192
                    </xs:documentation>
 
193
                </xs:annotation>
 
194
            </xs:enumeration>
 
195
        </xs:restriction>
 
196
    </xs:simpleType>
 
197
    
 
198
    <xs:complexType name="VersionChoiceList">
 
199
        <xs:annotation>
 
200
            <xs:documentation>
 
201
                <html:p>
 
202
                    A version choice list outlines a collection of
 
203
                    resources at various versions.
 
204
                </html:p>
 
205
            </xs:documentation>
 
206
        </xs:annotation>
 
207
        <xs:sequence>
 
208
            <xs:element name="version" type="vers:VersionChoice" minOccurs="1" maxOccurs="unbounded" />
 
209
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
 
210
        </xs:sequence>
 
211
        <xs:anyAttribute namespace="##other" processContents="lax"/>
 
212
        <!--TODO(Ziad)resolve assert issue
 
213
            <xs:assert vc:minVersion="1.1" test="every $v in vers:version satisfies $v/atom:link[@rel='self']">
 
214
            <xs:annotation>
 
215
                <xs:documentation>
 
216
                    <html:p>
 
217
                        In version lists, every single version must
 
218
                        contain at least one self link.
 
219
                    </html:p>
 
220
                </xs:documentation>
 
221
            </xs:annotation>
 
222
        </xs:assert>-->
 
223
    </xs:complexType>
 
224
 
 
225
    <xs:complexType name="VersionChoiceRoot" vc:minVersion="1.1">
 
226
        <xs:complexContent>
 
227
            <xs:extension base="vers:VersionChoice">
 
228
                <!--TODO(Ziad)resolve asser issue
 
229
                    <xs:assert test="atom:link[@rel='describedby']">
 
230
                    <xs:annotation>
 
231
                        <xs:documentation>
 
232
                            <html:p>
 
233
                                When used as a root element, a version choice
 
234
                                must contain at least one describedby link.
 
235
                            </html:p>
 
236
                        </xs:documentation>
 
237
                    </xs:annotation>
 
238
                </xs:assert>-->
 
239
            </xs:extension>
 
240
        </xs:complexContent>
 
241
    </xs:complexType>
 
242
 
 
243
    <xs:complexType name="VersionChoice">
 
244
        <xs:annotation>
 
245
            <xs:documentation>
 
246
                <html:p>
 
247
                    A version choice contains relevant information
 
248
                    about an available service that a user can then
 
249
                    use to target a specific version of the service.
 
250
                </html:p>
 
251
            </xs:documentation>
 
252
        </xs:annotation>
 
253
 
 
254
        <xs:sequence>
 
255
            <xs:element name="media-types" type="vers:MediaTypeList" minOccurs="0" maxOccurs="1" />
 
256
            <!--<xs:element vc:minVersion="1.1" ref="atom:link" minOccurs="0" maxOccurs="unbounded" />-->
 
257
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
 
258
        </xs:sequence>
 
259
 
 
260
        <xs:attribute name="id" type="xs:string" use="required">
 
261
            <xs:annotation>
 
262
                <xs:documentation>
 
263
                    <html:p>
 
264
                        The ID of a version choice represents the service version's unique 
 
265
                        identifier. This ID is guaranteed to be unique only among the
 
266
                        service version choices outlined in the VersionChoiceList.
 
267
                    </html:p>
 
268
                </xs:documentation>
 
269
            </xs:annotation>
 
270
        </xs:attribute>
 
271
 
 
272
        <xs:attribute name="status" type="vers:VersionStatus" use="required">
 
273
            <xs:annotation>
 
274
                <xs:documentation>
 
275
                    <html:p>
 
276
                        A version choice's status describes the current operational state of
 
277
                        the given service version. The operational status is captured in a
 
278
                        simple type enumeration called VersionStatus.
 
279
                    </html:p>
 
280
                </xs:documentation>
 
281
            </xs:annotation>
 
282
        </xs:attribute>
 
283
 
 
284
        <xs:attribute name="updated" type="xs:dateTime" use="optional">
 
285
            <xs:annotation>
 
286
                <xs:documentation>
 
287
                    <html:p>
 
288
                        A version choice's updated attribute describes
 
289
                        the time when the version was updated. The
 
290
                        time should be updated anytime
 
291
                        <html:strong>anything</html:strong> in the
 
292
                        version has changed: documentation,
 
293
                        extensions, bug fixes.
 
294
                    </html:p>
 
295
                </xs:documentation>
 
296
            </xs:annotation>
 
297
        </xs:attribute>
 
298
        <xs:anyAttribute namespace="##other" processContents="lax"/>
 
299
    </xs:complexType>
 
300
 
 
301
    <xs:complexType name="MediaTypeList">
 
302
        <xs:annotation>
 
303
            <xs:documentation>
 
304
                <html:p>
 
305
                    A MediaTypeList outlines a collection of valid media types for a given 
 
306
                    service version.
 
307
                </html:p>
 
308
            </xs:documentation>
 
309
        </xs:annotation>
 
310
        
 
311
        <xs:sequence>
 
312
            <xs:element name="media-type" type="vers:MediaType" minOccurs="1" maxOccurs="unbounded" />
 
313
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
 
314
        </xs:sequence>
 
315
        <xs:anyAttribute namespace="##other" processContents="lax"/>
 
316
    </xs:complexType>
 
317
 
 
318
    <xs:complexType name="MediaType">
 
319
        <xs:annotation>
 
320
            <xs:documentation>
 
321
                <html:p>
 
322
                    A MediaType describes what content types the service version understands.
 
323
                </html:p>
 
324
            </xs:documentation>
 
325
        </xs:annotation>
 
326
        <xs:sequence>
 
327
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
 
328
        </xs:sequence>
 
329
        <xs:attribute name="base" type="xs:string" use="optional" default="">
 
330
            <xs:annotation>
 
331
                <xs:documentation>
 
332
                    <html:p>
 
333
                        The base of a given media type describes the
 
334
                        simple MIME type that then a more complicated
 
335
                        media type can be derived from. These types
 
336
                        are basic and provide no namespace or version
 
337
                        specific data are are only provided as a
 
338
                        convenience.
 
339
                    </html:p>
 
340
                </xs:documentation>
 
341
            </xs:annotation>
 
342
        </xs:attribute>
 
343
 
 
344
        <xs:attribute name="type" type="xs:string" use="required">
 
345
            <xs:annotation>
 
346
                <xs:documentation>
 
347
                    <html:p>
 
348
                        The type attribute of a MediaType describes
 
349
                        the MIME specific identifier of the media type
 
350
                        in question.
 
351
                    </html:p>
 
352
                </xs:documentation>
 
353
            </xs:annotation>
 
354
        </xs:attribute>
 
355
        <xs:anyAttribute namespace="##other" processContents="lax"/>
 
356
    </xs:complexType>
 
357
</xs:schema>