summaryrefslogtreecommitdiff
path: root/api-ref/source
diff options
context:
space:
mode:
authorCenne <cennedee+opendev@protonmail.com>2021-07-08 18:37:45 +0200
committerCenne <cennedee+opendev@protonmail.com>2021-08-23 19:38:58 +0200
commitbc95c92f7c122b1217459a1d7a125fae47749e6e (patch)
tree6ffd3cc271ac841e2a2a5fc72524ee2f1f625a37 /api-ref/source
parent9f32ceda1a87ac83d4ac84faec16c01ba27c549e (diff)
downloadironic-bc95c92f7c122b1217459a1d7a125fae47749e6e.tar.gz
Add api endpoints for changing boot_mode and secure_boot state
Done: - Node API endpoints expose - RPC methods - Conductor Manager methods - Conductor utils new methods - RBAC new policies - Node API tests - Manager Tests (+ some testing for utils methods) - RBAC tests - Docs (api-ref) - REST API version history - Releasenotes Story: 2008567 Task: 41709 Change-Id: I2d72389edf546b99c536c6b130ca85ababf80591
Diffstat (limited to 'api-ref/source')
-rw-r--r--api-ref/source/baremetal-api-v1-node-management.inc69
-rw-r--r--api-ref/source/parameters.yaml14
-rw-r--r--api-ref/source/samples/node-set-boot-mode-bios.json3
-rw-r--r--api-ref/source/samples/node-set-boot-mode-uefi.json3
-rw-r--r--api-ref/source/samples/node-set-secure-boot-off.json3
-rw-r--r--api-ref/source/samples/node-set-secure-boot-on.json3
6 files changed, 95 insertions, 0 deletions
diff --git a/api-ref/source/baremetal-api-v1-node-management.inc b/api-ref/source/baremetal-api-v1-node-management.inc
index 0f2f3e175..60986be71 100644
--- a/api-ref/source/baremetal-api-v1-node-management.inc
+++ b/api-ref/source/baremetal-api-v1-node-management.inc
@@ -299,6 +299,75 @@ Response
.. literalinclude:: samples/node-get-state-response.json
+Change Node Boot Mode
+=====================
+
+.. rest_method:: PUT /v1/nodes/{node_ident}/states/boot_mode
+
+Request a change to the Node's boot mode.
+
+.. versionadded:: 1.76
+ A change in node's boot mode can be requested.
+
+Normal response code: 202 (Accepted)
+
+Error codes:
+ - 409 (Conflict, NodeLocked, ClientError)
+ - 400 (Invalid, InvalidStateRequested, InvalidParameterValue)
+ - 404 (NotFound)
+ - 503 (NoFreeConductorWorkers)
+
+Request
+-------
+
+.. rest_parameters:: parameters.yaml
+
+ - node_ident: node_ident
+ - target: req_target_boot_mode
+
+**Example request for UEFI boot:**
+
+.. literalinclude:: samples/node-set-boot-mode-uefi.json
+
+**Example request for Legacy BIOS boot:**
+
+.. literalinclude:: samples/node-set-boot-mode-bios.json
+
+
+Change Node Secure Boot
+=======================
+
+.. rest_method:: PUT /v1/nodes/{node_ident}/states/secure_boot
+
+Request a change to the Node's secure boot state.
+
+.. versionadded:: 1.76
+ A change in node's secure boot state can be requested.
+
+Normal response code: 202 (Accepted)
+
+Error codes:
+ - 409 (Conflict, NodeLocked, ClientError)
+ - 400 (Invalid, InvalidStateRequested, InvalidParameterValue)
+ - 404 (NotFound)
+ - 503 (NoFreeConductorWorkers)
+
+Request
+-------
+
+.. rest_parameters:: parameters.yaml
+
+ - node_ident: node_ident
+ - target: req_target_secure_boot
+
+**Example request to turn off secure boot:**
+
+.. literalinclude:: samples/node-set-secure-boot-off.json
+
+**Example request to turn on secure boot:**
+
+.. literalinclude:: samples/node-set-secure-boot-on.json
+
Change Node Power State
=======================
diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml
index 04b58aa91..266986c1b 100644
--- a/api-ref/source/parameters.yaml
+++ b/api-ref/source/parameters.yaml
@@ -1754,6 +1754,13 @@ req_storage_interface:
in: body
required: false
type: string
+req_target_boot_mode:
+ description: |
+ If a boot mode change has been requested, this field represents the
+ requested (ie, "target") state, either "uefi" or "bios".
+ in: body
+ required: true
+ type: string
req_target_power_state:
description: |
If a power state transition has been requested, this field represents the
@@ -1770,6 +1777,13 @@ req_target_raid_config:
in: body
required: true
type: JSON
+req_target_secure_boot:
+ description: |
+ If a secure boot change has been requested, this field represents the
+ requested (ie, "target") state, either ``true`` or ``false``.
+ in: body
+ required: true
+ type: boolean
req_uuid:
description: |
The UUID for the resource.
diff --git a/api-ref/source/samples/node-set-boot-mode-bios.json b/api-ref/source/samples/node-set-boot-mode-bios.json
new file mode 100644
index 000000000..cb81af186
--- /dev/null
+++ b/api-ref/source/samples/node-set-boot-mode-bios.json
@@ -0,0 +1,3 @@
+{
+ "target": "bios"
+}
diff --git a/api-ref/source/samples/node-set-boot-mode-uefi.json b/api-ref/source/samples/node-set-boot-mode-uefi.json
new file mode 100644
index 000000000..461a5818b
--- /dev/null
+++ b/api-ref/source/samples/node-set-boot-mode-uefi.json
@@ -0,0 +1,3 @@
+{
+ "target": "uefi"
+}
diff --git a/api-ref/source/samples/node-set-secure-boot-off.json b/api-ref/source/samples/node-set-secure-boot-off.json
new file mode 100644
index 000000000..e8ad3700e
--- /dev/null
+++ b/api-ref/source/samples/node-set-secure-boot-off.json
@@ -0,0 +1,3 @@
+{
+ "target": false
+}
diff --git a/api-ref/source/samples/node-set-secure-boot-on.json b/api-ref/source/samples/node-set-secure-boot-on.json
new file mode 100644
index 000000000..4c1a00634
--- /dev/null
+++ b/api-ref/source/samples/node-set-secure-boot-on.json
@@ -0,0 +1,3 @@
+{
+ "target": true
+}