summaryrefslogtreecommitdiff
path: root/api-ref
diff options
context:
space:
mode:
authorBob Fournier <bfournie@redhat.com>2021-04-16 15:15:53 -0400
committerBob Fournier <bfournie@redhat.com>2021-05-27 12:15:20 -0400
commite15440370cca1f1a998d3607910697c3129d040a (patch)
tree679da9689641befecc922a83f2c4542999807825 /api-ref
parentcaa4c8fd2964cd0c75025705497b7040c973dbe0 (diff)
downloadironic-e15440370cca1f1a998d3607910697c3129d040a.tar.gz
Include bios registry fields in bios API
Provide the fields in the BIOS setting API - ``/v1/nodes/{node}/bios/{setting}``, and in the BIOS setting list API when details are requested - ``/v1/nodes/<node>/bios?detail=True``. Story: #2008571 Task: #42483 Change-Id: Ie86ec57e428e2bb2efd099a839105e51a94824ab
Diffstat (limited to 'api-ref')
-rw-r--r--api-ref/source/baremetal-api-v1-nodes-bios.inc68
-rw-r--r--api-ref/source/parameters.yaml67
-rw-r--r--api-ref/source/samples/node-bios-detail-response.json13
-rw-r--r--api-ref/source/samples/node-bios-list-details-response.json30
-rw-r--r--api-ref/source/samples/node-bios-list-response.json4
5 files changed, 177 insertions, 5 deletions
diff --git a/api-ref/source/baremetal-api-v1-nodes-bios.inc b/api-ref/source/baremetal-api-v1-nodes-bios.inc
index 4602b134b..887e2029a 100644
--- a/api-ref/source/baremetal-api-v1-nodes-bios.inc
+++ b/api-ref/source/baremetal-api-v1-nodes-bios.inc
@@ -19,6 +19,11 @@ List all Bios settings by Node
Return a list of Bios settings associated with ``node_ident``.
+.. versionadded:: 1.74
+ Added additional fields from bios registry which can be retrieved using
+ ``?detail=True`` (see detailed response below).
+ Added ``fields`` selector to query for particular fields.
+
Normal response code: 200
Error codes: 404
@@ -29,6 +34,8 @@ Request
.. rest_parameters:: parameters.yaml
- node_ident: node_ident
+ - fields: fields
+ - detail: detail
Response
--------
@@ -46,6 +53,55 @@ Response
.. literalinclude:: samples/node-bios-list-response.json
+List detailed Bios settings by Node
+===================================
+
+.. rest_method:: GET /v1/nodes/{node_ident}/bios/?detail=True
+
+Return a list of detailed Bios settings associated with ``node_ident``.
+The detailed list includes the BIOS Attribute Registry information
+retrieved via Redfish.
+
+.. versionadded:: 1.74
+ Introduced
+
+
+Normal response code: 200
+
+Error codes: 404
+
+Request
+-------
+
+.. rest_parameters:: parameters.yaml
+
+ - node_ident: node_ident
+
+Response
+--------
+
+.. rest_parameters:: parameters.yaml
+
+ - bios: bios_settings
+ - created_at: created_at
+ - updated_at: updated_at
+ - links: links
+ - name: bios_setting_name
+ - value: bios_setting_value
+ - attribute_type: bios_setting_attribute_type
+ - allowable_values: bios_setting_allowable_values
+ - lower_bound: bios_setting_lower_bound
+ - max_length: bios_setting_max_length
+ - min_length: bios_setting_min_length
+ - read_only: bios_setting_read_only
+ - reset_required: bios_setting_reset_required
+ - unique: bios_setting_unique
+ - upper_bound: bios_setting_upper_bound
+
+**Example list of a Node's Bios settings:**
+
+.. literalinclude:: samples/node-bios-list-details-response.json
+
Show single Bios setting of a Node
==================================
@@ -55,6 +111,9 @@ Show single Bios setting of a Node
Return the content of the specific bios ``bios_setting`` associated with
``node_ident``.
+. versionadded:: 1.74
+ Introduced fields from the BIOS registry.
+
Normal response code: 200
Error codes: 404
@@ -78,6 +137,15 @@ Response
- links: links
- name: bios_setting_name
- value: bios_setting_value
+ - attribute_type: bios_setting_attribute_type
+ - allowable_values: bios_setting_allowable_values
+ - lower_bound: bios_setting_lower_bound
+ - max_length: bios_setting_max_length
+ - min_length: bios_setting_min_length
+ - read_only: bios_setting_read_only
+ - reset_required: bios_setting_reset_required
+ - unique: bios_setting_unique
+ - upper_bound: bios_setting_upper_bound
**Example details of a Node's Bios setting details:**
diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml
index 5129333f0..ef9b1b975 100644
--- a/api-ref/source/parameters.yaml
+++ b/api-ref/source/parameters.yaml
@@ -505,12 +505,75 @@ bios_interface:
in: body
required: true
type: string
+bios_setting_allowable_values:
+ description: |
+ A list of allowable values when the attribute_type is "Enumeration",
+ otherwise None.
+ in: body
+ required: true
+ type: array
+bios_setting_attribute_type:
+ description: |
+ A string describing the type of the Bios setting - "Enumeration",
+ "Integer", "String", "Boolean", or "Password". May be None.
+ in: body
+ required: true
+ type: string
+bios_setting_lower_bound:
+ description: |
+ The lowest allowed value when attribute_type is "Integer".
+ May be None.
+ in: body
+ required: true
+ type: integer
+bios_setting_max_length:
+ description: |
+ The maximum length when attribute_type is "String".
+ May be None.
+ in: body
+ required: true
+ type: integer
+bios_setting_min_length:
+ description: |
+ The minimum length when attribute_type is "String".
+ May be None.
+ in: body
+ required: true
+ type: integer
bios_setting_name:
description: |
The name of a Bios setting for a Node, eg. "virtualization".
in: body
required: true
type: string
+bios_setting_read_only:
+ description: |
+ This Bios seting is read only and can't be changed.
+ May be None.
+ in: body
+ required: true
+ type: boolean
+bios_setting_reset_required:
+ description: |
+ After setting this Bios setting a node reboot is required.
+ May be None.
+ in: body
+ required: true
+ type: boolean
+bios_setting_unique:
+ description: |
+ This Bios setting is unique to this node.
+ May be None.
+ in: body
+ required: true
+ type: boolean
+bios_setting_upper_bound:
+ description: |
+ The lowest allowed value when attribute_type is "Integer".
+ May be None.
+ in: body
+ required: true
+ type: integer
bios_setting_value:
description: |
The value of a Bios setting for a Node, eg. "on".
@@ -520,7 +583,9 @@ bios_setting_value:
bios_settings:
description: |
Optional list of one or more Bios settings. It includes following fields
- "created_at", "updated_at", "links", "name", "value".
+ "created_at", "updated_at", "links", "name", "value", "attribute_type",
+ "allowable_values", "lower_bound", "max_length", "min_length", "read_only",
+ "reset_required", "unique", "upper_bound"
in: body
required: true
type: array
diff --git a/api-ref/source/samples/node-bios-detail-response.json b/api-ref/source/samples/node-bios-detail-response.json
index a7b01028c..195f89721 100644
--- a/api-ref/source/samples/node-bios-detail-response.json
+++ b/api-ref/source/samples/node-bios-detail-response.json
@@ -12,7 +12,16 @@
"rel": "bookmark"
}
],
- "name": "virtualization",
- "value": "on"
+ "name": "Virtualization",
+ "value": "Enabled",
+ "attribute_type": "Enumeration",
+ "allowable_values": ["Enabled", "Disabled"],
+ "lower_bound": None,
+ "max_length": None,
+ "min_length": None,
+ "read_only": false,
+ "reset_required": None,
+ "unique": None,
+ "upper_bound": None
}
}
diff --git a/api-ref/source/samples/node-bios-list-details-response.json b/api-ref/source/samples/node-bios-list-details-response.json
new file mode 100644
index 000000000..52a48b3b1
--- /dev/null
+++ b/api-ref/source/samples/node-bios-list-details-response.json
@@ -0,0 +1,30 @@
+{
+ "bios": [
+ {
+ "created_at": "2016-08-18T22:28:49.653974+00:00",
+ "updated_at": "2016-08-18T22:28:49.653974+00:00",
+ "links": [
+ {
+ "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization",
+ "rel": "self"
+ },
+ {
+ "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization",
+ "rel": "bookmark"
+ }
+ ],
+ "name": "Virtualization",
+ "value": "Enabled",
+ "attribute_type": "Enumeration",
+ "allowable_values": ["Enabled", "Disabled"],
+ "lower_bound": None,
+ "max_length": None,
+ "min_length": None,
+ "read_only": false,
+ "reset_required": None,
+ "unique": None,
+ "upper_bound": None
+ }
+ ]
+}
+
diff --git a/api-ref/source/samples/node-bios-list-response.json b/api-ref/source/samples/node-bios-list-response.json
index 87d5e9c89..8255c240e 100644
--- a/api-ref/source/samples/node-bios-list-response.json
+++ b/api-ref/source/samples/node-bios-list-response.json
@@ -13,8 +13,8 @@
"rel": "bookmark"
}
],
- "name": "virtualization",
- "value": "on"
+ "name": "Virtualization",
+ "value": "Enabled"
}
]
}