File: metadefs-namespaces-objects.inc

package info (click to toggle)
glance 2%3A30.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,416 kB
  • sloc: python: 74,906; sh: 175; makefile: 111
file content (280 lines) | stat: -rw-r--r-- 6,577 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
.. -*- rst -*-

Metadata definition objects
***************************

Creates, lists, shows details for, updates, and deletes metadata definition
objects.

*Since API v2.2*

Create object
~~~~~~~~~~~~~

.. rest_method::  POST /v2/metadefs/namespaces/{namespace_name}/objects

Creates an object definition in a namespace.

Normal response codes: 201

Error response codes: 400, 401, 403, 404, 409


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - name: object-name
   - description: object-description-in-request
   - properties: object-properties-in-request
   - required: object-required-in-request

Request Example
---------------

.. literalinclude:: samples/metadef-object-create-request.json
   :language: json


Response Parameters
-------------------

.. rest_parameters:: metadefs-parameters.yaml

   - created_at: created_at
   - description: object-description
   - name: object-name
   - properties: object-properties
   - required: object-required
   - schema: object-schema
   - self: self
   - updated_at: updated_at

Response Example
----------------

.. literalinclude:: samples/metadef-object-create-response.json
   :language: json


List objects
~~~~~~~~~~~~

.. rest_method::  GET /v2/metadefs/namespaces/{namespace_name}/objects

Lists object definitions in a namespace.

Returns a subset of the larger collection of namespaces and a link
that you can use to get the next set of namespaces. You should
always check for the presence of a ``next`` link and use it as the
URI in a subsequent HTTP GET request. You should follow this
pattern until a ``next`` link is no longer provided. The next link
preserves any query parameters that you send in your initial
request. You can use the ``first`` link to jump back to the first
page of the collection. If you prefer to paginate through
namespaces manually, use the ``limit`` and ``marker`` parameters.

Use the ``resource_types`` and ``visibility`` query parameters to
filter the response.

For example, set the ``resource_types`` query parameter to
``OS::Glance::Image,OS::Nova::Flavor`` to filter the response to
include only namespaces that are associated with the given resource
types.

You can sort the results of this operation by using the
``sort_key`` and ``sort_dir`` parameters. The API uses the natural
sorting of whatever namespace attribute is provided as the
``sort_key``.


Normal response codes: 200

Error response codes: 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - visibility: visibility-in-query
   - resource_types: resource_types-in-query
   - sort_key: sort_key
   - sort_dir: sort_dir


Response Parameters
-------------------

.. rest_parameters:: metadefs-parameters.yaml

   - display_name: display_name
   - description: description
   - namespace: namespace
   - visibility: visibility
   - protected: protected
   - namespaces: namespaces
   - resource_type_associations: resource_type_associations


Response Example
----------------

.. literalinclude:: samples/metadef-objects-list-response.json
   :language: json



Show object
~~~~~~~~~~~

.. rest_method::  GET /v2/metadefs/namespaces/{namespace_name}/objects/{object_name}

Shows the definition for an object.

The response body shows a single object entity.

Normal response codes: 200

.. yep, 400 if the request includes a body

Error response codes: 400, 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - object_name: object_name

There is no request body.


Response Parameters
-------------------

.. rest_parameters:: metadefs-parameters.yaml

   - created_at: created_at
   - description: object-description
   - name: object-name
   - properties: object-properties
   - required: object-required
   - schema: object-schema
   - self: self
   - updated_at: updated_at


Response Example
----------------

.. literalinclude:: samples/metadef-object-details-response.json
   :language: json



Update object
~~~~~~~~~~~~~

.. rest_method::  PUT /v2/metadefs/namespaces/{namespace_name}/objects/{object_name}

Updates an object definition in a namespace.

The object resource is completely replaced by what you specify in the request
body.  Thus, if you leave out any of the optional parameters, and they exist in
the current object, they will be eliminated by this call.

It is possible to change the name of the object with this call; if you do, note
that the URL for the object (specified by the ``self`` field) will change.

Normal response codes: 200

Error response codes: 400, 401, 403, 404, 409


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - object_name: object_name
   - name: object-name
   - description: object-description-in-request
   - properties: object-properties-in-request
   - required: object-required-in-request


Request Example
---------------

.. literalinclude:: samples/metadef-object-update-request.json
   :language: json


Response Parameters
-------------------

.. rest_parameters:: metadefs-parameters.yaml

   - created_at: created_at
   - description: object-description
   - name: object-name
   - properties: object-properties
   - required: object-required
   - schema: object-schema
   - self: self
   - updated_at: updated_at


Response Example
----------------

.. literalinclude:: samples/metadef-object-update-response.json
   :language: json



Delete object
~~~~~~~~~~~~~

.. rest_method::  DELETE /v2/metadefs/namespaces/{namespace_name}/objects/{object_name}

Deletes an object definition from a namespace.

.. note::
    If the namespace containing the object is protected, that is, if the
    ``protected`` attribute of the namespace is ``true``, then you must first
    set the ``protected`` attribute to ``false`` on the namespace before you
    will be permitted to delete the object.

    * If you try to delete an object from a protected namespace, the call
      returns the ``403`` response code.
    * To change the ``protected`` attribute of a namespace, use the
      :ref:`Update namespace <v2-update-namespace>` call.

When you successfully delete an object from a namespace, the
response is empty and the response code is ``204``.

Normal response codes: 204

Error response codes: 400, 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - object_name: object_name

There is no request body.

There is no response body.