summaryrefslogtreecommitdiff
path: root/api-ref/source/baremetal-api-v1-nodes.inc
blob: 47bcceb58c927283581723e329dbc63fd6c545cd (plain)
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
.. -*- rst -*-

=============
Nodes (nodes)
=============

List, Searching, Creating, Updating, and Deleting of bare metal Node resources
are done through the ``/v1/nodes`` resource. There are also several sub-resources,
which allow further actions to be performed on a bare metal Node.

A Node is the canonical representation of a discretely allocatable server,
capable of running an Operating System. Each Node must be associated with a
``driver``; this informs Ironic what protocol to use when managing the Node.

.. versionchanged:: 1.6
  A Node may be referenced both by its UUID and by a unique human-readable
  "name" in any request. Throughout this documentation, this is referred to as
  the ``node_ident``. Responses clearly indicate whether a given field is a
  ``uuid`` or a ``name``.

Depending on the Roles assigned to the authenticated OpenStack User, and upon
the configuration of the Bare Metal service, API responses may change. For
example, the default value of the "show_password" settings cause all API
responses to mask passwords within ``driver_info`` with the literal string
"\*\*\*\*\*\*".

Create Node
===========

.. rest_method::  POST /v1/nodes

Creates a new Node resource.

This method requires that a ``driver`` be supplied in the request body.  Most
subresources of a Node (eg, ``properties``, ``driver_info``, etc) may be
supplied when the Node is created, or the resource may be updated later.

.. versionadded:: 1.2
  Added ``available`` state name, which replaced ``None`` as the status of an
  unprovisioned Node. All clients should be updated to use the new
  ``available`` state name.  Nodes in the ``available`` state may have
  workloads provisioned on them; they are "available" for use.

.. versionadded:: 1.5
  Introduced the ``name`` field.

.. versionadded:: 1.7
  Introduced the ``clean_step`` field.

.. versionchanged:: 1.11
  The default initial state of newly-created Nodes from ``available`` to
  ``enroll``. This provides users a workflow to verify the manageability of a
  Node and perform necessary operational functions (eg, building a RAID array)
  before making the Node available for provisioning.

.. versionadded:: 1.12
  Introduced support for the ``raid_config`` and ``target_raid_config`` fields.

.. versionadded:: 1.20
  Introduced the ``network_interface`` field. If this field is not supplied
  when creating the Node, the default value will be used.

.. versionadded:: 1.21
  Introduced the ``resource_class`` field, which may be used to store a
  resource designation for the proposed OpenStack Placement Engine. This field
  has no effect within Ironic.

.. versionadded:: 1.31
  Introduced the ``boot_interface``, ``deploy_interface``,
  ``management_interface``, ``power_interface``, ``inspect_interface``,
  ``console_interface``, ``vendor_interface`` and ``raid_interface`` fields. If
  any of these fields are not supplied when creating the Node, their default
  value will be used.

.. versionchanged:: 1.31
  If the specified driver is a dynamic driver, then all the interfaces
  (boot_interface, deploy_interface, etc.) will be set to the default interface
  for that driver unless another enabled interface is specified in the creation
  request.

.. versionadded:: 1.33
  Introduced the ``storage_interface`` field. If this field is not supplied
  when creating the Node, the default value will be used.

.. versionadded:: 1.38
  Introduced the ``rescue_interface`` field. If this field is not supplied
  when creating the Node, the default value will be used.

.. versionadded:: 1.44
  Introduced the ``deploy_step`` field.

.. versionadded:: 1.46
  Introduced the ``conductor_group`` field.

.. versionadded:: 1.50
  Introduced the ``owner`` field.

.. versionadded:: 1.51
  Introduced the ``description`` field.

.. versionadded:: 1.52
  Introduced the ``allocation_uuid`` field.

.. versionadded:: 1.65
  Introduced the ``lessee`` field.

.. versionadded:: 1.82
  Introduced the ``shard`` field.

Normal response codes: 201

Error codes: 400,403,406

Request
-------

.. rest_parameters:: parameters.yaml

    - boot_interface: req_boot_interface
    - conductor_group: req_conductor_group
    - console_interface: req_console_interface
    - deploy_interface: req_deploy_interface
    - driver_info: req_driver_info
    - driver: req_driver_name
    - extra: req_extra
    - inspect_interface: req_inspect_interface
    - management_interface: req_management_interface
    - name: node_name
    - network_interface: req_network_interface
    - power_interface: req_power_interface
    - properties: req_properties
    - raid_interface: req_raid_interface
    - rescue_interface: req_rescue_interface
    - resource_class: req_resource_class_create
    - storage_interface: req_storage_interface
    - uuid: req_uuid
    - vendor_interface: req_vendor_interface
    - owner: owner
    - description: req_n_description
    - lessee: lessee
    - shard: shard
    - automated_clean: req_automated_clean
    - bios_interface: req_bios_interface
    - chassis_uuid: req_chassis_uuid
    - instance_info: req_instance_info
    - instance_uuid: req_instance_uuid
    - maintenance: req_maintenance
    - maintenance_reason: maintenance_reason
    - network_data: network_data
    - protected: protected
    - protected_reason: protected_reason
    - retired: retired
    - retired_reason: retired_reason

**Example Node creation request with a dynamic driver:**

.. literalinclude:: samples/node-create-request-dynamic.json
   :language: javascript

Response
--------

The response will contain the complete Node record, with the supplied data,
and any defaults added for non-specified fields. Most fields default to "null"
or "".

The list and example below are representative of the response as of API
microversion 1.81.

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: node_name
    - power_state: power_state
    - target_power_state: target_power_state
    - provision_state: provision_state
    - target_provision_state: target_provision_state
    - maintenance: maintenance
    - maintenance_reason: maintenance_reason
    - fault: fault
    - last_error: last_error
    - reservation: reservation
    - driver: driver_name
    - driver_info: driver_info
    - driver_internal_info: driver_internal_info
    - properties: n_properties
    - instance_info: instance_info
    - instance_uuid: instance_uuid
    - chassis_uuid: chassis_uuid
    - extra: extra
    - console_enabled: console_enabled
    - raid_config: raid_config
    - target_raid_config: target_raid_config
    - clean_step: clean_step
    - deploy_step: deploy_step
    - links: links
    - ports: n_ports
    - portgroups: n_portgroups
    - states: n_states
    - resource_class: resource_class
    - boot_interface: boot_interface
    - console_interface: console_interface
    - deploy_interface: deploy_interface
    - inspect_interface: inspect_interface
    - management_interface: management_interface
    - network_interface: network_interface
    - power_interface: power_interface
    - raid_interface: raid_interface
    - rescue_interface: rescue_interface
    - storage_interface: storage_interface
    - traits: n_traits
    - vendor_interface: vendor_interface
    - volume: n_volume
    - conductor_group: conductor_group
    - protected: protected
    - protected_reason: protected_reason
    - conductor: conductor
    - owner: owner
    - lessee: lessee
    - shard: shard
    - description: n_description
    - allocation_uuid: allocation_uuid
    - automated_clean: automated_clean
    - bios_interface: bios_interface
    - network_data: network_data
    - retired: retired
    - retired_reason: retired_reason

**Example JSON representation of a Node:**

.. literalinclude:: samples/node-create-response.json
   :language: javascript


List Nodes
==========

.. rest_method::  GET /v1/nodes

Return a list of bare metal Nodes, with some useful information about
each Node. Some filtering is possible by passing in flags with the request.

By default, this query will return the name, uuid, instance uuid, power state,
provision state, and maintenance setting for each Node.

.. versionadded:: 1.8
  Added the ``fields`` Request parameter. When specified,
  this causes the content of the Response to include only the specified fields,
  rather than the default set.

.. versionadded:: 1.9
  Added the ``provision_state`` Request parameter, allowing the list of
  returned Nodes to be filtered by their current state.

.. versionadded:: 1.16
  Added the ``driver`` Request parameter, allowing the list of returned Nodes
  to be filtered by their driver name.

.. versionadded:: 1.21
  Added the ``resource_class`` Request parameter, allowing the list of returned
  Nodes to be filtered by this field.

.. versionadded:: 1.42
  Introduced the ``fault`` field.

.. versionadded:: 1.43
  Added the ``detail`` boolean request parameter. When specified ``True`` this
  causes the response to include complete details about each node, as shown
  in the "List Nodes Detailed" section below.

.. versionadded:: 1.46
  Introduced the ``conductor_group`` request parameter, to allow filtering the
  list of returned nodes by conductor group.

.. versionadded:: 1.49
  Introduced the ``conductor`` request parameter, to allow filtering the
  list of returned nodes by conductor.

.. versionadded:: 1.50
  Introduced the ``owner`` field.

.. versionadded:: 1.51
  Introduced the ``description`` field.

.. versionadded:: 1.65
  Introduced the ``lessee`` field.

.. versionadded:: 1.82
  Introduced the ``shard`` field. Introduced the ``sharded`` request parameter.

Normal response codes: 200

Error codes: 400,403,406

Request
-------

.. rest_parameters:: parameters.yaml

   - instance_uuid: r_instance_uuid
   - maintenance: r_maintenance
   - associated: r_associated
   - provision_state: r_provision_state
   - driver: r_driver
   - resource_class: r_resource_class
   - conductor_group: r_conductor_group
   - conductor: r_conductor
   - fault: r_fault
   - owner: owner
   - lessee: lessee
   - shard: req_shard
   - sharded: req_sharded
   - description_contains: r_description_contains
   - fields: fields
   - limit: limit
   - marker: marker
   - sort_dir: sort_dir
   - sort_key: sort_key
   - detail: detail

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: node_name
    - instance_uuid: instance_uuid
    - power_state: power_state
    - provision_state: provision_state
    - maintenance: maintenance
    - links: links

**Example list of Nodes:**

.. literalinclude:: samples/nodes-list-response.json
   :language: javascript


List Nodes Detailed
===================

.. rest_method::  GET /v1/nodes/detail

.. deprecated::
   Use ?detail=True query string instead.

Return a list of bare metal Nodes with complete details. Some filtering is
possible by passing in flags with the request.

This method is particularly useful to locate the Node associated to a given
Nova instance, eg. with a request to ``v1/nodes/detail?instance_uuid={NOVA INSTANCE UUID}``

.. versionadded:: 1.37
  Introduced the ``traits`` field.

.. versionadded:: 1.38
  Introduced the ``rescue_interface`` field.

.. versionadded:: 1.42
  Introduced the ``fault`` field.

.. versionadded:: 1.46
  Introduced the ``conductor_group`` field.

.. versionadded:: 1.48
  Introduced the ``protected`` and ``protected_reason`` fields.

.. versionadded:: 1.49
  Introduced the ``conductor`` request parameter and ``conductor`` field.

.. versionadded:: 1.50
  Introduced the ``owner`` field.

.. versionadded:: 1.51
  Introduced the ``description`` field.

.. versionadded:: 1.52
  Introduced the ``allocation_uuid`` field.

.. versionadded:: 1.65
  Introduced the ``lessee`` field.

.. versionadded:: 1.82
  Introduced the ``shard`` field. Introduced the ``sharded`` request parameter.

Normal response codes: 200

Error codes: 400,403,406

Request
-------

.. rest_parameters:: parameters.yaml

   - instance_uuid: r_instance_uuid
   - maintenance: r_maintenance
   - fault: r_fault
   - associated: r_associated
   - provision_state: r_provision_state
   - driver: r_driver
   - resource_class: r_resource_class
   - conductor_group: r_conductor_group
   - conductor: r_conductor
   - owner: owner
   - lessee: lessee
   - shard: req_shard
   - sharded: req_sharded
   - description_contains: r_description_contains
   - limit: limit
   - marker: marker
   - sort_dir: sort_dir
   - sort_key: sort_key

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: node_name
    - power_state: power_state
    - target_power_state: target_power_state
    - provision_state: provision_state
    - target_provision_state: target_provision_state
    - maintenance: maintenance
    - maintenance_reason: maintenance_reason
    - fault: fault
    - last_error: last_error
    - reservation: reservation
    - driver: driver_name
    - driver_info: driver_info
    - driver_internal_info: driver_internal_info
    - properties: n_properties
    - instance_info: instance_info
    - instance_uuid: instance_uuid
    - chassis_uuid: chassis_uuid
    - extra: extra
    - console_enabled: console_enabled
    - raid_config: raid_config
    - target_raid_config: target_raid_config
    - clean_step: clean_step
    - deploy_step: deploy_step
    - links: links
    - ports: n_ports
    - portgroups: n_portgroups
    - states: n_states
    - resource_class: resource_class
    - bios_interface: bios_interface
    - boot_interface: boot_interface
    - console_interface: console_interface
    - deploy_interface: deploy_interface
    - inspect_interface: inspect_interface
    - management_interface: management_interface
    - network_interface: network_interface
    - power_interface: power_interface
    - raid_interface: raid_interface
    - rescue_interface: rescue_interface
    - storage_interface: storage_interface
    - traits: n_traits
    - vendor_interface: vendor_interface
    - volume: n_volume
    - conductor_group: conductor_group
    - protected: protected
    - protected_reason: protected_reason
    - owner: owner
    - lessee: lessee
    - shard: shard
    - description: n_description
    - conductor: conductor
    - allocation_uuid: allocation_uuid
    - retired: retired
    - retired_reason: retired_reason
    - network_data: network_data

**Example detailed list of Nodes:**

.. literalinclude:: samples/nodes-list-details-response.json
   :language: javascript


Show Node Details
=================

.. rest_method::  GET /v1/nodes/{node_ident}

Shows details for a node. By default, this will return the full representation
of the resource; an optional ``fields`` parameter can be supplied to return
only the specified set.

.. versionadded:: 1.37
  Introduced the ``traits`` field.

.. versionadded:: 1.38
  Introduced the ``rescue_interface`` field.

.. versionadded:: 1.42
  Introduced the ``fault`` field.

.. versionadded:: 1.46
  Introduced the ``conductor_group`` field.

.. versionadded:: 1.48
  Introduced the ``protected`` and ``protected_reason`` fields.

.. versionadded:: 1.49
  Introduced the ``conductor`` field

.. versionadded:: 1.50
  Introduced the ``owner`` field.

.. versionadded:: 1.51
  Introduced the ``description`` field.

.. versionadded:: 1.52
  Introduced the ``allocation_uuid`` field.

.. versionadded:: 1.61
  Introduced the ``retired`` and ``retired_reason`` fields.

.. versionadded:: 1.65
  Introduced the ``lessee`` field.

.. versionadded:: 1.66
  Introduced the ``network_data`` field.

.. versionadded:: 1.82
  Introduced the ``shard`` field.

Normal response codes: 200

Error codes: 400,403,404,406

Request
-------

.. rest_parameters:: parameters.yaml

    - node_ident: node_ident
    - fields: fields

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: node_name
    - power_state: power_state
    - target_power_state: target_power_state
    - provision_state: provision_state
    - target_provision_state: target_provision_state
    - maintenance: maintenance
    - maintenance_reason: maintenance_reason
    - fault: fault
    - last_error: last_error
    - reservation: reservation
    - driver: driver_name
    - driver_info: driver_info
    - driver_internal_info: driver_internal_info
    - properties: n_properties
    - instance_info: instance_info
    - instance_uuid: instance_uuid
    - chassis_uuid: chassis_uuid
    - extra: extra
    - console_enabled: console_enabled
    - raid_config: raid_config
    - target_raid_config: target_raid_config
    - clean_step: clean_step
    - deploy_step: deploy_step
    - links: links
    - ports: n_ports
    - portgroups: n_portgroups
    - states: n_states
    - resource_class: resource_class
    - bios_interface: bios_interface
    - boot_interface: boot_interface
    - console_interface: console_interface
    - deploy_interface: deploy_interface
    - inspect_interface: inspect_interface
    - management_interface: management_interface
    - network_interface: network_interface
    - power_interface: power_interface
    - raid_interface: raid_interface
    - rescue_interface: rescue_interface
    - storage_interface: storage_interface
    - traits: n_traits
    - vendor_interface: vendor_interface
    - volume: n_volume
    - conductor_group: conductor_group
    - protected: protected
    - protected_reason: protected_reason
    - owner: owner
    - lessee: lessee
    - shard: shard
    - description: n_description
    - conductor: conductor
    - allocation_uuid: allocation_uuid
    - network_data: network_data

**Example JSON representation of a Node:**

.. literalinclude:: samples/node-show-response.json
   :language: javascript


Update Node
===========

.. rest_method::  PATCH /v1/nodes/{node_ident}

Updates the information stored about a Node.

Note that this endpoint can not be used to request state changes, which are
managed through sub-resources.

.. versionadded:: 1.25
  Introduced the ability to unset a node's chassis UUID.

.. versionadded:: 1.51
  Introduced the ability to set/unset a node's description.

.. versionadded:: 1.82
  Introduced the ability to set/unset a node's shard.

Normal response codes: 200

Error codes: 400,403,404,406,409

Request
-------

The BODY of the PATCH request must be a JSON PATCH document, adhering to
`RFC 6902 <https://tools.ietf.org/html/rfc6902>`_.

.. rest_parameters:: parameters.yaml

   - node_ident: node_ident

**Example PATCH document updating Node driver_info:**

.. literalinclude:: samples/node-update-driver-info-request.json

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: node_name
    - power_state: power_state
    - target_power_state: target_power_state
    - provision_state: provision_state
    - target_provision_state: target_provision_state
    - maintenance: maintenance
    - maintenance_reason: maintenance_reason
    - fault: fault
    - last_error: last_error
    - reservation: reservation
    - driver: driver_name
    - driver_info: driver_info
    - driver_internal_info: driver_internal_info
    - properties: n_properties
    - instance_info: instance_info
    - instance_uuid: instance_uuid
    - chassis_uuid: chassis_uuid
    - extra: extra
    - console_enabled: console_enabled
    - raid_config: raid_config
    - target_raid_config: target_raid_config
    - clean_step: clean_step
    - deploy_step: deploy_step
    - links: links
    - ports: n_ports
    - portgroups: n_portgroups
    - states: n_states
    - resource_class: resource_class
    - boot_interface: boot_interface
    - console_interface: console_interface
    - deploy_interface: deploy_interface
    - inspect_interface: inspect_interface
    - management_interface: management_interface
    - network_interface: network_interface
    - power_interface: power_interface
    - raid_interface: raid_interface
    - rescue_interface: rescue_interface
    - storage_interface: storage_interface
    - traits: n_traits
    - vendor_interface: vendor_interface
    - volume: n_volume
    - conductor_group: conductor_group
    - protected: protected
    - protected_reason: protected_reason
    - owner: owner
    - lessee: lessee
    - shard: shard
    - description: n_description
    - conductor: conductor
    - allocation_uuid: allocation_uuid
    - network_data: network_data

**Example JSON representation of a Node:**

.. literalinclude:: samples/node-update-driver-info-response.json
   :language: javascript


Delete Node
===========

.. rest_method::  DELETE /v1/nodes/{node_ident}

Deletes a node.

Normal response codes: 204

Error codes: 400,403,404,409

Request
-------

.. rest_parameters:: parameters.yaml

   - node_ident: node_ident