File: local-ips.inc

package info (click to toggle)
python-neutron-lib 3.18.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,652 kB
  • sloc: python: 22,800; sh: 145; makefile: 24
file content (413 lines) | stat: -rw-r--r-- 9,927 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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
.. -*- rst -*-

=====================
Local IPs (local_ips)
=====================

Extension that allows users to create a virtual IP that can later be assigned
to multiple ports/VMs (similar to anycast IP) and is guaranteed to only be
reachable within the same physical server/node boundaries.

Resource timestamps
===================

The ``standard-attr-timestamp`` extension adds the ``created_at`` and
``updated_at`` attributes to all resources that have standard attributes.

List Local IPs
==============

.. rest_method::  GET /v2.0/local_ips

Lists Local IPs visible to the user.

Default policy settings return only the Local IPs owned by the user's
project, unless the user has admin role.

.. include:: filtering-list.inc

Normal response codes: 200

Error response codes: 401

Request
-------

.. rest_parameters:: parameters.yaml

   - id: local_ip-id-query
   - name: name-query
   - description: description-query
   - project_id: project_id-query
   - local_port_id: local_ip-local_port_id-query
   - network_id: network_id-query
   - local_ip_address: local_ip_address-query
   - ip_mode: local_ip-ip_mode-query
   - revision_number: revision_number-query
   - sort_dir: sort_dir
   - sort_key: local_ip-sort_key
   - fields: fields

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

.. rest_parameters:: parameters.yaml

   - local_ips: local_ips
   - id: local_ip-id
   - name: name
   - description: description
   - project_id: project_id
   - local_port_id: local_ip-local_port_id
   - network_id: network_id
   - local_ip_address: local_ip_address
   - ip_mode: local_ip-ip_mode
   - created_at: created_at_resource
   - updated_at: updated_at_resource
   - revision_number: revision_number

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

.. literalinclude:: samples/local_ips/local-ips-list-response.json
   :language: javascript

Create Local IP
===============

.. rest_method::  POST /v2.0/local_ips

Creates a Local IP, and, if you don't specify existing port ID,
allocates an internal port with IP address from specified network.

The operation returns the ``Bad Request (400)`` response code for one of
reasons:

  - The requested local IP address does not fall in the subnet
    range for the specified network.

  - The local IP address is not valid.

  - Specified local_port_id has no fixed IP address

  - Specified local_port_id has multiple fixed IP address and local_ip
    was not specified

  - Specified ip_mode is not supported

If the local_port_id or network_id is not valid, this operation returns
``404`` response code.

The operation returns the ``Conflict (409)`` response code for one of
reasons:

  - Both local_port_id and network_id are specified in the request

  - Both local_port_id and local_ip are specified, but port has no such
    local IP

  - Both network_id and local_ip_address are specified, but network has
    no subnets to satisfy the IP requested

Normal response codes: 201

Error response codes: 400, 401, 404, 409

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip: local_ip
   - name: name-request
   - description: description-request
   - project_id: project_id-request
   - local_port_ip: local_ip-local_port_id-request
   - network_id: local_ip-network_id-request
   - local_ip_address: local_ip_address-request
   - ip_mode: local_ip-ip_mode-request

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

.. literalinclude:: samples/local_ips/local_ip-create-request.json
   :language: javascript

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

.. rest_parameters:: parameters.yaml

   - local_ip: local_ip
   - id: local_ip-id
   - name: name
   - description: description
   - project_id: project_id
   - local_port_id: local_ip-local_port_id
   - network_id: local_ip-network_id
   - local_ip_address: local_ip_address
   - ip_mode: local_ip-ip_mode
   - created_at: created_at_resource
   - updated_at: updated_at_resource
   - revision_number: revision_number

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

.. literalinclude:: samples/local_ips/local_ip-create-response.json
   :language: javascript

Show Local IP details
=====================

.. rest_method::  GET /v2.0/local_ips/{local_ip_id}

Shows details for a Local IP.

.. include:: filtering-show.inc

Normal response codes: 200

Error response codes: 401, 403, 404

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip_id: local_ip-id-path
   - fields: fields

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

.. rest_parameters:: parameters.yaml

   - local_ip: local_ip
   - id: local_ip-id
   - name: name
   - description: description
   - project_id: project_id
   - local_port_id: local_ip-local_port_id
   - network_id: local_ip-network_id
   - local_ip_address: local_ip_address
   - ip_mode: local_ip-ip_mode
   - created_at: created_at_resource
   - updated_at: updated_at_resource
   - revision_number: revision_number

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

.. literalinclude:: samples/local_ips/local_ip-show-response.json
   :language: javascript

Update Local IP
===============

.. rest_method::  PUT /v2.0/local_ips/{local_ip_id}

Updates a Local IP.

Normal response codes: 200

Error response codes: 400, 401, 404, 409

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip: local_ip
   - local_ip_id: local_ip-id-path
   - name: name-request
   - description: description-request

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

.. literalinclude:: samples/local_ips/local_ip-update-request.json
   :language: javascript

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

.. rest_parameters:: parameters.yaml

   - local_ip: local_ip
   - id: local_ip-id
   - name: name
   - description: description
   - project_id: project_id
   - local_port_id: local_ip-local_port_id
   - network_id: local_ip-network_id
   - local_ip_address: local_ip_address
   - ip_mode: local_ip-ip_mode
   - created_at: created_at_resource
   - updated_at: updated_at_resource
   - revision_number: revision_number

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

.. literalinclude:: samples/local_ips/local_ip-update-response.json
   :language: javascript

Delete Local IP
===============

.. rest_method::  DELETE /v2.0/local_ips/{local_ip_id}

Deletes a Local IP and, if applicable, its underlying port.
Underlying port is deleted in case it was created specifically for this
Local IP, and has corresponding device_owner and device_id.

The operation returns the ``Precondition Failed  (412)`` response code for
the following reason:

  - The requested Local IP is still associated with some ports.

Normal response codes: 204

Error response codes: 401, 404, 412

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip_id: local_ip-id-path

Response
--------

There is no body content for the response of a successful DELETE request.

=========================================
Local IP Associations (port_associations)
=========================================

The resource lets users assign Local IPs to user Ports.
This is a sub-resource of the Local IP resource.

List Local IP Associations
==========================

.. rest_method::  GET /v2.0/local_ips/{local_ip_id}/port_associations

Lists Associations for the given Local IP.

.. include:: filtering-list.inc

Normal response codes: 200

Error response codes: 401

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip_id: local_ip-id-path
   - fixed_port_id: local_ip_association-fixed_port_id-query
   - fixed_ip: local_ip_association-fixed_ip-query
   - host: local_ip_association-host-query
   - sort_dir: sort_dir
   - sort_key: local_ip_association-sort_key
   - fields: fields

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

.. rest_parameters:: parameters.yaml

   - local_ip_associations: local_ip_associations
   - local_ip_id: local_ip-id
   - local_ip_address: local_ip_address
   - fixed_port_id: local_ip_association-fixed_port_id
   - fixed_ip: local_ip_association-fixed_ip
   - host: local_ip_association-host

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

.. literalinclude:: samples/local_ips/local-ip-list-associations-response.json
   :language: javascript

Create Local IP Association
===========================

.. rest_method::  POST /v2.0/local_ips/{local_ip_id}/port_associations

Creates a Local IP association with a given Port.
If a Port has multiple fixed IPs user must specify which IP to use
for association.

The operation returns the ``Conflict (409)`` response code for one of
reasons:

  - Specified fixed_port_id has multiple fixed IP addresses and fixed_ip
    was not specified

  - Both fixed_port_id and fixed_ip are specified in the request, but port
    has no such fixed IP

Normal response codes: 201

Error response codes: 400, 401, 404, 409

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip_id: local_ip-id-path
   - fixed_port_id: local_ip_association-fixed_port_id-request
   - fixed_ip: local_ip_association-fixed_ip-request

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

.. literalinclude:: samples/local_ips/local_ip_association-create-request.json
   :language: javascript

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

.. rest_parameters:: parameters.yaml

   - local_ip_association: local_ip_association
   - local_ip_id: local_ip_id
   - fixed_port_id: local_ip_association-fixed_port_id
   - fixed_ip: local_ip_association-fixed_ip
   - host: local_ip_association-host

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

.. literalinclude:: samples/local_ips/local_ip_association-create-response.json
   :language: javascript

Delete Local IP Association
===========================

.. rest_method::  DELETE /v2.0/local_ips/{local_ip_id}/port_associations/{fixed_port_id}

Deletes a Local IP association.

Normal response codes: 204

Error response codes: 400, 401, 403, 404

Request
-------

.. rest_parameters:: parameters.yaml

   - local_ip_id: local_ip-id-path
   - fixed_port_id: local_ip_association-fixed_port_id-path

Response
--------

There is no body content for the response of a successful DELETE request.