summaryrefslogtreecommitdiff
path: root/api-ref/source/baremetal-api-v1-nodes-vifs.inc
blob: 298bd1e2452dc9c2836f9a2a2dbf0c01c0501a0f (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
.. -*- rst -*-

==================================
VIFs (Virtual Interfaces) of nodes
==================================

.. versionadded:: 1.28

Attaching and detaching VIFs (Virtual Interfaces) to or from a node are done
via the ``v1/nodes/{node_ident}/vifs`` endpoint. Attaching a VIF to a node
means that a VIF will be mapped to a free port or port group of the specified
node.

List attached VIFs of a Node
============================

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

Return a list of VIFs that are attached to the node.

Normal response code: 200

Error codes: 400,401,403,404

Response
--------

.. rest_parameters:: parameters.yaml

    - id: node_vif_ident
    - vifs: n_vifs
    - node_ident: node_ident

**Example list of VIFs that are attached to the node:**

.. literalinclude:: samples/node-vif-list-response.json
   :language: javascript


Attach a VIF to a node
======================

.. rest_method:: POST /v1/nodes/{node_ident}/vifs

Attach a VIF to a node.

Normal response code: 204

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

Request
-------

.. rest_parameters:: parameters.yaml

    - id: node_vif_ident
    - node_ident: node_ident

**Example request to attach a VIF to a Node:**

.. literalinclude:: samples/node-vif-attach-request.json


Detach VIF from a node
======================

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

Detach VIF from a Node.

Normal response code: 204

Error codes: 400,401,403,404

Request
-------

.. rest_parameters:: parameters.yaml

    - node_ident: node_ident
    - node_vif_ident: node_vif_ident