diff options
author | Dmitry Tantsur <divius.inside@gmail.com> | 2018-10-18 15:12:06 +0200 |
---|---|---|
committer | Dmitry Tantsur <divius.inside@gmail.com> | 2018-11-27 10:07:30 +0100 |
commit | 68d62f2bee879306a4951b5d7dd54eabaa17d1bc (patch) | |
tree | 3a3b48375c8de2315e4477fdb8a0b3b238aca249 /api-ref | |
parent | 0ea86814ad07278b6a7b542a34c80f0d0ac0f3c8 (diff) | |
download | ironic-68d62f2bee879306a4951b5d7dd54eabaa17d1bc.tar.gz |
Support for protecting nodes from undeploying and rebuilding
When handling the "pet" case, some nodes may be critical for the deployment.
For example, in an OpenStack installer like TripleO you may want to make
sure your controllers are not removed by an incorrect operation.
This changes introduces a new field "protected" on nodes. When it is
set to True, the "deleted" and "rebuild" provisioning actions fail with
HTTP 403. Deleting such nodes is also not possible.
Also adds "protected_reason" for the operators to specify the reason
a node is protected.
Story: #2003869
Task: #26706
Change-Id: I1950bf6dd65b6596cae69d431ef288e578a89d6e
Diffstat (limited to 'api-ref')
-rw-r--r-- | api-ref/source/baremetal-api-v1-nodes.inc | 16 | ||||
-rw-r--r-- | api-ref/source/parameters.yaml | 12 | ||||
-rw-r--r-- | api-ref/source/samples/node-create-response.json | 2 | ||||
-rw-r--r-- | api-ref/source/samples/node-show-response.json | 2 | ||||
-rw-r--r-- | api-ref/source/samples/node-update-driver-info-response.json | 2 | ||||
-rw-r--r-- | api-ref/source/samples/nodes-list-details-response.json | 4 |
6 files changed, 37 insertions, 1 deletions
diff --git a/api-ref/source/baremetal-api-v1-nodes.inc b/api-ref/source/baremetal-api-v1-nodes.inc index 49ac3fe23..28e345be1 100644 --- a/api-ref/source/baremetal-api-v1-nodes.inc +++ b/api-ref/source/baremetal-api-v1-nodes.inc @@ -139,7 +139,7 @@ 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.46. +microversion 1.48. .. rest_parameters:: parameters.yaml @@ -186,6 +186,8 @@ microversion 1.46. - vendor_interface: vendor_interface - volume: n_volume - conductor_group: conductor_group + - protected: protected + - protected_reason: protected_reason **Example JSON representation of a Node:** @@ -302,6 +304,9 @@ Nova instance, eg. with a request to ``v1/nodes/detail?instance_uuid={NOVA INSTA .. versionadded:: 1.46 Introduced the ``conductor_group`` field. +.. versionadded:: 1.48 + Introduced the ``protected`` and ``protected_reason`` fields. + Normal response codes: 200 Error codes: 400,403,406 @@ -372,6 +377,8 @@ Response - vendor_interface: vendor_interface - volume: n_volume - conductor_group: conductor_group + - protected: protected + - protected_reason: protected_reason **Example detailed list of Nodes:** @@ -400,6 +407,9 @@ only the specified set. .. versionadded:: 1.46 Introduced the ``conductor_group`` field. +.. versionadded:: 1.48 + Introduced the ``protected`` and ``protected_reason`` fields. + Normal response codes: 200 Error codes: 400,403,404,406 @@ -460,6 +470,8 @@ Response - vendor_interface: vendor_interface - volume: n_volume - conductor_group: conductor_group + - protected: protected + - protected_reason: protected_reason **Example JSON representation of a Node:** @@ -546,6 +558,8 @@ Response - vendor_interface: vendor_interface - volume: n_volume - conductor_group: conductor_group + - protected: protected + - protected_reason: protected_reason **Example JSON representation of a Node:** diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 5808cebb6..bcf8e190f 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -987,6 +987,18 @@ properties: in: body required: true type: array +protected: + description: | + Whether the node is protected from undeploying, rebuilding and deletion. + in: body + required: false + type: boolean +protected_reason: + description: | + The reason the node is marked as protected. + in: body + required: false + type: string provision_state: description: | The current provisioning state of this Node. diff --git a/api-ref/source/samples/node-create-response.json b/api-ref/source/samples/node-create-response.json index ca165c223..33d075a10 100644 --- a/api-ref/source/samples/node-create-response.json +++ b/api-ref/source/samples/node-create-response.json @@ -59,6 +59,8 @@ "power_interface": null, "power_state": null, "properties": {}, + "protected": false, + "protected_reason": null, "provision_state": "enroll", "provision_updated_at": null, "raid_config": {}, diff --git a/api-ref/source/samples/node-show-response.json b/api-ref/source/samples/node-show-response.json index 2ecf7b4c6..8e0078c8d 100644 --- a/api-ref/source/samples/node-show-response.json +++ b/api-ref/source/samples/node-show-response.json @@ -61,6 +61,8 @@ "power_interface": null, "power_state": "power off", "properties": {}, + "protected": false, + "protected_reason": null, "provision_state": "available", "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", "raid_config": {}, diff --git a/api-ref/source/samples/node-update-driver-info-response.json b/api-ref/source/samples/node-update-driver-info-response.json index 53ec73fd2..420772242 100644 --- a/api-ref/source/samples/node-update-driver-info-response.json +++ b/api-ref/source/samples/node-update-driver-info-response.json @@ -63,6 +63,8 @@ "power_interface": null, "power_state": "power off", "properties": {}, + "protected": false, + "protected_reason": null, "provision_state": "available", "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", "raid_config": {}, diff --git a/api-ref/source/samples/nodes-list-details-response.json b/api-ref/source/samples/nodes-list-details-response.json index f0fc4d8e8..a6ba4480d 100644 --- a/api-ref/source/samples/nodes-list-details-response.json +++ b/api-ref/source/samples/nodes-list-details-response.json @@ -63,6 +63,8 @@ "power_interface": null, "power_state": "power off", "properties": {}, + "protected": false, + "protected_reason": null, "provision_state": "available", "provision_updated_at": "2016-08-18T22:28:49.946416+00:00", "raid_config": {}, @@ -160,6 +162,8 @@ "power_interface": "ipmitool", "power_state": null, "properties": {}, + "protected": false, + "protected_reason": null, "provision_state": "enroll", "provision_updated_at": null, "raid_config": {}, |