From 36edf94c5dac1b27ab48c54e9399b07889b6ec62 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Fri, 4 Nov 2016 11:34:35 +0200 Subject: [PATCH] Update ironic-ml2-integration spec This patch updates Rest API impact section and adds new endpoints * /v1/nodes/(node_ident)/portgroups * /v1/nodes/(node_ident)/portgroups/detail * /v1/portgroups/(portgroup_ident)/ports * /v1/portgroups/(portgroup_ident)/ports/detail Update CLI impact section * Add OSC commands Update portgroup json objects with new fields: * internal_info * standalone_ports_supported Related-Bug: #1618754 Change-Id: Id8bc4213ae0e3f64aaed7decc04fac66396525df --- specs/approved/ironic-ml2-integration.rst | 311 ++++++++++++++++++---- 1 file changed, 264 insertions(+), 47 deletions(-) diff --git a/specs/approved/ironic-ml2-integration.rst b/specs/approved/ironic-ml2-integration.rst index dd611dbd..15ed03f3 100644 --- a/specs/approved/ironic-ml2-integration.rst +++ b/specs/approved/ironic-ml2-integration.rst @@ -120,10 +120,16 @@ addition to the base object it will have the following fields: * node_id * address * extra +* internal_info +* standalone_ports_supported The 'address' field represents the MAC address for bonded NICs of the bare metal server. The 'extra' field can be used to hold any additional information that operators or developers want to store in the portgroup. +The 'internal_info' field is used to store internal metadata. This field is +read-only. +The 'standalone_ports_supported' indicates whether ports that are members of +this portgroup can be used as stand-alone ports. The Ironic port object will then have the following fields added to support new functionality: @@ -231,25 +237,29 @@ relationship with the port. The portgroup object is proposed with the following fields and data types: -+-----------------------+-------------------------+ -| Field Name | Field Type | -+=======================+=========================+ -| id | int | -+-----------------------+-------------------------+ -| uuid | str | -+-----------------------+-------------------------+ -| name | str_or_none | -+-----------------------+-------------------------+ -| node_id | int_or_none | -+-----------------------+-------------------------+ -| address | str | -+-----------------------+-------------------------+ -| extra | dict_or_none | -+-----------------------+-------------------------+ -| created_at | datetime_or_str_or_none | -+-----------------------+-------------------------+ -| updated_at | datetime_or_str_or_none | -+-----------------------+-------------------------+ ++----------------------------+-------------------------+ +| Field Name | Field Type | ++============================+=========================+ +| id | int | ++----------------------------+-------------------------+ +| uuid | str | ++----------------------------+-------------------------+ +| name | str_or_none | ++----------------------------+-------------------------+ +| node_id | int_or_none | ++----------------------------+-------------------------+ +| address | str | ++----------------------------+-------------------------+ +| extra | dict_or_none | ++----------------------------+-------------------------+ +| internal_info | dict_or_none | ++----------------------------+-------------------------+ +| standalone_ports_supported | bool | ++----------------------------+-------------------------+ +| created_at | datetime_or_str_or_none | ++----------------------------+-------------------------+ +| updated_at | datetime_or_str_or_none | ++----------------------------+-------------------------+ State Machine Impact -------------------- @@ -595,9 +605,112 @@ model: * Response: - * JSON schema definition of PortgroupCollection + * JSON schema definition of PortgroupCollection with detail. +* ``/v1/nodes/(node_ident)/portgroups`` + + * Retrieve a list of portgroups for node. + + * Method type GET. + + * Normal http response code will be 200. + + * Expected error http response code(s): + + * 400 for bad query or malformed syntax + * 404 for resource (e.g. node) not found + + * Parameters: + + * ``node_ident (uuid_or_name)`` - UUID or logical name of a + node. + + * Body: + + * None + + * Response: + + * JSON schema definition of PortgroupCollection. + +* ``/v1/nodes/(node_ident)/portgroups/detail`` + + * Retrieve a list of portgroups with detail for node. + + * Method type GET. + + * Normal http response code will be 200. + + * Expected error http response code(s): + + * 400 for bad query or malformed syntax + * 404 for resource (e.g. node) not found + + * Parameters: + + * ``node_ident (uuid_or_name)`` - UUID or logical name of a + node. + + * Body: + + * None + + * Response: + + * JSON schema definition of PortgroupCollection with detail. + +* ``/v1/portgroups/(portgroup_ident)/ports`` + + * Retrieve a list of ports for portgroup. + + * Method type GET. + + * Normal http response code will be 200. + + * Expected error http response code(s): + + * 400 for bad query or malformed syntax + * 404 for resource (e.g. portgroup) not found + + * Parameters: + + * ``portgroup_ident (uuid_or_name)`` - UUID or logical name of a + portgroup. + + * Body: + + * None + + * Response: + + * JSON schema definition of PortCollection. + +* ``/v1/portgroups/(portgroup_ident)/ports/detail`` + + * Retrieve a list of ports with detail for portgroup. + + * Method type GET. + + * Normal http response code will be 200. + + * Expected error http response code(s): + + * 400 for bad query or malformed syntax + * 404 for resource (e.g. portgroup) not found + + * Parameters: + + * ``portgroup_ident (uuid_or_name)`` - UUID or logical name of a + portgroup. + + * Body: + + * None + + * Response: + + * JSON schema definition of PortCollection with detail. * JSON schema definition of Portgroup (data sample): @@ -609,19 +722,21 @@ model: "extra": { "foo": "bar", }, + "internal_info": {}, "links": [ { "href": "http://localhost:6385/v1/portgroups/ - 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", "rel": "self" }, { "href": "http://localhost:6385/portgroups/ - 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", "rel": "bookmark" } ], "node_uuid": "e7a6f1e2-7176-4fe8-b8e9-ed71c77d74dd", + "standalone_ports_supported": true, "updated_at": "2015-05-15T09:04:12.011844+00:00", "uuid": "6eb02b44-18a3-4659-8c0b-8d2802581ae4", "name": "node1_portgroup1" @@ -638,20 +753,65 @@ model: "links": [ { "href": "http://localhost:6385/v1/portgroups/ - 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", "rel": "self" }, { "href": "http://localhost:6385/portgroups/ - 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", "rel": "bookmark" } ], + "name": "node1_portgroup1", "uuid": "6eb02b44-18a3-4659-8c0b-8d2802581ae4" } ] } +* JSON schema definition of PortgroupCollection with detail: + +:: + + { + "portgroups": [ + { + "address": "fe:54:00:77:07:d9", + "created_at": "2016-08-18T22:28:48.165105+00:00", + "extra": {}, + "internal_info": {}, + "links": [ + { + "href": "http://127.0.0.1:6385/v1/portgroups/ + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + "rel": "self" + }, + { + "href": "http://127.0.0.1:6385/portgroups/ + 6eb02b44-18a3-4659-8c0b-8d2802581ae4", + "rel": "bookmark" + } + ], + "name": "node1_portgroup1", + "node_uuid": "e7a6f1e2-7176-4fe8-b8e9-ed71c77d74dd", + "ports": [ + { + "href": "http://127.0.0.1:6385/v1/portgroups/ + 6eb02b44-18a3-4659-8c0b-8d2802581ae4/ports", + "rel": "self" + }, + { + "href": "http://127.0.0.1:6385/portgroups/ + 6eb02b44-18a3-4659-8c0b-8d2802581ae4/ports", + "rel": "bookmark" + } + ], + "standalone_ports_supported": true, + "updated_at": "2016-11-04T17:46:09+00:00", + "uuid": "6eb02b44-18a3-4659-8c0b-8d2802581ae4" + } + ] + } + * JSON schema definition of PortgroupPatch would be a subset of JSON schema of Portgroup. @@ -722,6 +882,7 @@ by the caller and the response. { "address": "fe:54:00:77:07:d9", "node_uuid": "e7a6f1e2-7176-4fe8-b8e9-ed71c77d74dd", + "standalone_ports_supported": true, "name": "node1_portgroup1" } @@ -736,6 +897,7 @@ by the caller and the response. "created_at": "2015-05-12T10:10:00.529243+00:00", "extra": { }, + "internal_info": {}, "links": [ { "href": "http://localhost:6385/v1/portgroups/ @@ -748,6 +910,7 @@ by the caller and the response. "rel": "bookmark" } ], + "standalone_ports_supported": true, "updated_at": null, "uuid": "6eb02b44-18a3-4659-8c0b-8d2802581ae4", } @@ -854,7 +1017,8 @@ same time, so this change must work with older clients without breaking them. Client (CLI) impact ------------------- -The python-ironicclient would need updated to support the new portgroup APIs. +The python-ironicclient and OSC would need updated to support the new +portgroups APIs. Example usage of the new methods: @@ -863,46 +1027,99 @@ Example usage of the new methods: portgroup_id and pxe_enabled) and would also support update of these attributes. As examples: - * ironic port-create -a
-n [-e ] - [--local_link_connection ] - [--portgroup_uuid ] [--pxe_enabled ] + "ironic" CLI: - * ironic port-update port_uuid replace portgroup_uuid= + * ironic port-create -a
-n [-e ] + [--local-link-connection ] + [--portgroup-uuid ] [--pxe-enabled ] + + * ironic port-update port_uuid replace portgroup_uuid= + + * ironic port-list [--detail] [--address ] + [--portgroup-uuid ] + + + "openstack baremetal" CLI: + + * openstack baremetal port create --node + [--local-link-connection ] + [--portgroup-uuid ] + [--pxe-enabled ] +
+ + * openstack baremetal port set [--portgroup-uuid ] + + + * openstack baremetal port list --address ] + [--node ] [--portgroup-uuid ] * For portgroups, the CLI would support the following new methods: - * ironic portgroup-create --node [--name ] - [--address ] [-e ] + "ironic" CLI: - * To add ports to a portgroup, the portgroup should first - be created and then port_update called. + * ironic portgroup-create --node [--name ] + [--address ] [-e ] - * ironic portgroup-delete + * ironic portgroup-delete - * ironic portgroup-list [--detail] [--node ] - [--address ] - [--limit ] [--marker ] - [--sort-dir ] + * ironic portgroup-list [--detail] [--node ] + [--address ] + [--limit ] [--marker ] + [--sort-dir ] - * ironic portgroup-show [--address] + * ironic portgroup-show [--address] - * is the UUID of the portgroup (or MAC address if --address is - specified) + * is the UUID of the portgroup (or MAC address if --address is + specified) - * ironic portgroup-update - [ ... ] + * ironic portgroup-update + [ ... ] - * is add, remove or replace. + * is add, remove or replace. - * is the attribute to add, remove or replace. Can be - specified multiple times. For 'remove' only is necessary. + * is the attribute to add, remove or replace. Can be + specified multiple times. For 'remove' only is necessary. + * Note: Even though the ironic CLI includes 'ironic node-port-list', + we are NOT going to provide a corresponding + 'ironic node-portgroup-list'. Rather, the list of portgroups + of a node will be available via ironic portgroup-list --node. + + "openstack baremetal" CLI: + + * openstack baremetal portgroup create --node [--name NAME] + [--extra ] + [--support-standalone-ports | --unsupport-standalone-ports] +
+ + * openstack baremetal portgroup delete [ ...] + + * openstack baremetal portgroup list [--marker ] + [--address ] [--node ] + [--sort [:]] + [--long | --fields [ ...]] + + * openstack baremetal portgroup show [--address] + [--fields [ ...]] + + + * openstack baremetal portgroup set [--address] [--name NAME] + [--node ] [--extra ] + [--support-standalone-ports | --unsupport-standalone-ports] + [--fields [ ...]] + + + * openstack baremetal portgroup unset [--name] [--extra ] + [--node ] + + + * To add ports to a portgroup, the portgroup should first + be created and then port_update or port create called. The python-ironicclient would also need the Port detailed resource extended to include the new port attributes. - RPC API impact --------------