File: metadefs-namespaces-properties.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 (306 lines) | stat: -rw-r--r-- 6,401 bytes parent folder | download | duplicates (2)
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
.. -*- rst -*-

Metadata definition properties
******************************

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

*Since API v2.2*

Create property
~~~~~~~~~~~~~~~

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

Creates a property definition in a namespace.

The schema is a subset of the JSON property definition schema.

Normal response codes: 201

Error response codes: 400, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - name: name-property
   - title: title
   - type: type
   - additionalItems: additionalItems
   - description: property-description-in-request
   - default: default
   - items: items
   - operators: operators
   - enum: enum
   - maximum: maximum
   - minItems: minItems
   - readonly: readonly
   - minimum: minimum
   - maxItems: maxItems
   - maxLength: maxLength
   - uniqueItems: uniqueItems
   - pattern: pattern
   - minLength: minLength

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

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


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

.. rest_parameters:: metadefs-parameters.yaml

   - additionalItems: additionalItems
   - description: property-description
   - title: title
   - default: default
   - items: items
   - operators: operators
   - enum: enum
   - maximum: maximum
   - minItems: minItems
   - readonly: readonly
   - minimum: minimum
   - maxItems: maxItems
   - maxLength: maxLength
   - uniqueItems: uniqueItems
   - pattern: pattern
   - type: type
   - minLength: minLength
   - name: name-property

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

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


List properties
~~~~~~~~~~~~~~~

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

Lists property definitions in a namespace.

Normal response codes: 200

Error response codes: 400, 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name

There is no request body.


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

.. rest_parameters:: metadefs-parameters.yaml

   - properties: properties-dict


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

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


Show property definition
~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::
   GET /v2/metadefs/namespaces/{namespace_name}/properties/{property_name}

Shows the definition for a property.

If you use the ``resource_type`` query parameter, the API removes the prefix of
the resource type from the property name before it submits the query. This
enables you to look for a property name that starts with a prefix from an
associated resource type.

The response body shows a single property entity.


Normal response codes: 200

Error response codes: 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - property_name: property_name
   - namespace_name: namespace_name
   - resource_type: resource_type-in-query


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

.. rest_parameters:: metadefs-parameters.yaml

   - additionalItems: additionalItems
   - description: property-description
   - title: title
   - default: default
   - items: items
   - operators: operators
   - enum: enum
   - maximum: maximum
   - minItems: minItems
   - readonly: readonly
   - minimum: minimum
   - maxItems: maxItems
   - maxLength: maxLength
   - uniqueItems: uniqueItems
   - pattern: pattern
   - type: type
   - minLength: minLength
   - name: name-property



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

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




Update property definition
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::
   PUT /v2/metadefs/namespaces/{namespace_name}/properties/{property_name}

Updates a property definition.

Normal response codes: 200

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


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - namespace_name: namespace_name
   - property_name: property_name
   - name: name-property
   - title: title
   - type: type
   - additionalItems: additionalItems
   - description: description
   - default: default
   - items: items
   - operators: operators
   - enum: enum
   - maximum: maximum
   - minItems: minItems
   - readonly: readonly
   - minimum: minimum
   - maxItems: maxItems
   - maxLength: maxLength
   - uniqueItems: uniqueItems
   - pattern: pattern
   - minLength: minLength

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

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


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

.. rest_parameters:: metadefs-parameters.yaml

   - additionalItems: additionalItems
   - description: description
   - title: title
   - default: default
   - items: items
   - operators: operators
   - enum: enum
   - maximum: maximum
   - minItems: minItems
   - readonly: readonly
   - minimum: minimum
   - maxItems: maxItems
   - maxLength: maxLength
   - uniqueItems: uniqueItems
   - pattern: pattern
   - type: type
   - minLength: minLength
   - name: name-property



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

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



Remove property definition
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::
   DELETE /v2/metadefs/namespaces/{namespace_name}/properties/{property_name}

Removes a property definition from a namespace.

.. note::
    If the namespace containing the property 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 property.

    * If you try to delete a property 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 a property from a namespace, the
response is empty and the response code is ``204``.

Normal response codes: 204

Error response codes: 401, 403, 404


Request
-------

.. rest_parameters:: metadefs-parameters.yaml

   - property_name: property_name
   - namespace_name: namespace_name