summaryrefslogtreecommitdiff
path: root/api-ref
diff options
context:
space:
mode:
Diffstat (limited to 'api-ref')
-rw-r--r--api-ref/source/baremetal-api-v1-nodes-inventory.inc40
-rw-r--r--api-ref/source/parameters.yaml12
-rw-r--r--api-ref/source/samples/node-inventory-response.json31
3 files changed, 83 insertions, 0 deletions
diff --git a/api-ref/source/baremetal-api-v1-nodes-inventory.inc b/api-ref/source/baremetal-api-v1-nodes-inventory.inc
new file mode 100644
index 000000000..4c36e5aa2
--- /dev/null
+++ b/api-ref/source/baremetal-api-v1-nodes-inventory.inc
@@ -0,0 +1,40 @@
+.. -*- rst -*-
+
+==============
+Node inventory
+==============
+
+.. versionadded:: 1.81
+
+Given a Node identifier, the API provides access to the introspection data
+associated to the Node via ``v1/nodes/{node_ident}/inventory`` endpoint.
+
+Fetch node inventory
+===============================
+
+.. rest_method:: GET /v1/nodes/{node_ident}/inventory
+
+Normal response code: 200
+
+Error codes:
+ - 404 (NodeNotFound, InventoryNotRecorded)
+
+Request
+-------
+
+.. rest_parameters:: parameters.yaml
+
+ - node_ident: node_ident
+
+Response
+--------
+
+.. rest_parameters:: parameters.yaml
+
+ - inventory: n_inventory
+ - plugin_data: n_plugin_data
+
+**Example of inventory from a node:**
+
+.. literalinclude:: samples/node-inventory-response.json
+ :language: javascript
diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml
index d0da64ec2..b55ef405f 100644
--- a/api-ref/source/parameters.yaml
+++ b/api-ref/source/parameters.yaml
@@ -1191,6 +1191,18 @@ n_indicators:
in: body
required: true
type: array
+n_inventory:
+ description: |
+ Inventory of this node.
+ in: body
+ required: false
+ type: JSON
+n_plugin_data:
+ description: |
+ Plugin data of this node.
+ in: body
+ required: false
+ type: JSON
n_portgroups:
description: |
Links to the collection of portgroups on this node.
diff --git a/api-ref/source/samples/node-inventory-response.json b/api-ref/source/samples/node-inventory-response.json
new file mode 100644
index 000000000..7916f6717
--- /dev/null
+++ b/api-ref/source/samples/node-inventory-response.json
@@ -0,0 +1,31 @@
+{
+ "inventory": {
+ "interfaces":[
+ {
+ "name":"eth0",
+ "mac_address":"52:54:00:90:35:d6",
+ "ipv4_address":"192.168.122.128",
+ "ipv6_address":"fe80::5054:ff:fe90:35d6%eth0",
+ "has_carrier":true,
+ "lldp":null,
+ "vendor":"0x1af4",
+ "product":"0x0001"
+ }
+ ],
+ "cpu":{
+ "model_name":"QEMU Virtual CPU version 2.5+",
+ "frequency":null,
+ "count":1,
+ "architecture":"x86_64"
+ }
+ },
+ "plugin_data":{
+ "macs":[
+ "52:54:00:90:35:d6"
+ ],
+ "local_gb":10,
+ "cpus":1,
+ "cpu_arch":"x86_64",
+ "memory_mb":2048
+ }
+}