Merge "Add VIFs attach/detach to api-ref"

This commit is contained in:
Jenkins 2017-01-18 23:09:28 +00:00 committed by Gerrit Code Review
commit c1c86e81af
7 changed files with 101 additions and 3 deletions

View File

@ -11,7 +11,7 @@ fi
OS_AUTH_TOKEN=$(openstack token issue | grep ' id ' | awk '{print $4}')
IRONIC_URL="http://127.0.0.1:6385"
IRONIC_API_VERSION="1.24"
IRONIC_API_VERSION="1.28"
export OS_AUTH_TOKEN IRONIC_URL
@ -238,6 +238,12 @@ GET v1/nodes/$NID/management/boot_device/supported > node-get-supported-boot-dev
PUT v1/nodes/$NID/management/boot_device node-set-boot-device.json
GET v1/nodes/$NID/management/boot_device > node-get-boot-device-response.json
#############################
# NODES VIF ATTACH/DETACH API
POST v1/nodes/$NID/vifs node-vif-attach-request.json
GET v1/nodes/$NID/vifs > node-vif-list-response.json
#####################
# Replace automatically generated UUIDs by already used in documentation

View File

@ -0,0 +1,69 @@
.. -*- rst -*-
==================================
VIFs (Virtual Interfaces) of nodes
==================================
Starting with API version 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
**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
**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

View File

@ -10,6 +10,7 @@
.. include:: baremetal-api-v1-nodes.inc
.. include:: baremetal-api-v1-node-management.inc
.. include:: baremetal-api-v1-node-passthru.inc
.. include:: baremetal-api-v1-nodes-vifs.inc
.. include:: baremetal-api-v1-portgroups.inc
.. include:: baremetal-api-v1-nodes-portgroups.inc
.. include:: baremetal-api-v1-ports.inc

View File

@ -489,6 +489,12 @@ n_states:
in: body
required: true
type: array
n_vifs:
description: |
VIFs attached to this node. Added in API microversion 1.28.
in: body
required: true
type: array
name:
description: |
The name of the driver.
@ -515,6 +521,12 @@ node_uuid:
in: body
required: true
type: string
node_vif_ident:
description: |
The UUID or name of the VIF. Added in API microversion 1.28.
in: body
required: true
type: string
nodes:
description: |
Links to the collection of nodes contained in

View File

@ -9,7 +9,7 @@
],
"min_version": "1.1",
"status": "CURRENT",
"version": "1.24"
"version": "1.28"
},
"description": "Ironic is an OpenStack project which aims to provision baremetal machines.",
"name": "OpenStack Ironic API",
@ -24,7 +24,7 @@
],
"min_version": "1.1",
"status": "CURRENT",
"version": "1.24"
"version": "1.28"
}
]
}

View File

@ -0,0 +1,3 @@
{
"id": "1974dcfa-836f-41b2-b541-686c100900e5"
}

View File

@ -0,0 +1,7 @@
{
"vifs": [
{
"id": "1974dcfa-836f-41b2-b541-686c100900e5"
}
]
}