1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
Command Line Reference
======================
Integration for two command lines tools are provided: ironicclient_ and
OpenStackClient_.
Integration with ``baremetal`` CLI
----------------------------------
The ``baremetal`` command is provided by ironicclient_, so it has to be
installed, e.g.:
.. code-block:: shell
pip install 'python-ironicclient>=4.1.0'
All commands are prefixed with ``baremetal introspection``. See `standalone
ironic CLI documentation`_ for details on how to use it.
.. _ironicclient: https://docs.openstack.org/python-ironicclient/
.. _standalone ironic CLI documentation: https://docs.openstack.org/python-ironicclient/latest/cli/standalone.html
Integration with ``openstack baremetal`` CLI
--------------------------------------------
The ``openstack`` command is provided by ironicclient_, so it has to be
installed, e.g.:
.. code-block:: shell
pip install python-openstackclient.
All commands are prefixed with ``baremetal introspection``.
Common arguments
~~~~~~~~~~~~~~~~
All commands accept the following arguments:
* ``--inspector-url`` the **Ironic Inspector** API endpoint. If missing,
the endpoint will be fetched from the service catalog.
* ``--inspector-api-version`` requested API version, see :ref:`api-versioning`
for details.
Start introspection on a node
-----------------------------
::
$ openstack baremetal introspection start [--wait] [--check-errors] NODE_ID [NODE_ID ...]
* ``NODE_ID`` - Ironic node UUID or name;
Note that the CLI call accepts several UUID's and will stop on the first error.
.. note::
This CLI call doesn't rely on Ironic, and the introspected node will be
left in ``MANAGEABLE`` state. This means that the Ironic node is not
protected from other operations being performed by Ironic, which could
cause inconsistency in the node's state, and lead to operational errors.
With ``--wait`` flag it waits until introspection ends for all given nodes,
then displays the results as a table.
The ``--check-errors`` flag verifies if any error occurred during the
introspection of the selected nodes while waiting for the results. If any error
has occurred in the introspection result of selected nodes no output is
displayed, otherwise it shows the result as a table.
.. note::
``--check-errors`` can only be used with ``--wait``
Query introspection status
--------------------------
::
$ openstack baremetal introspection status NODE_ID
* ``NODE_ID`` - Ironic node UUID or name.
Returns following information about a node introspection status:
* ``error``: an error string or ``None``
* ``finished``: ``True/False``
* ``finished_at``: an ISO8601 timestamp or ``None`` if not finished
* ``started_at``: an ISO8601 timestamp
* ``uuid``: node UUID
List introspection statuses
---------------------------
This command supports pagination.
::
$ openstack baremetal introspection list [--marker] [--limit]
* ``--marker`` the last item on the previous page, a UUID
* ``--limit`` the amount of items to list, an integer, 50 by default
Shows a table with the following columns:
* ``Error``: an error string or ``None``
* ``Finished at``: an ISO8601 timestamp or ``None`` if not finished
* ``Started at``: and ISO8601 timestamp
* ``UUID``: node UUID
.. note::
The server orders the introspection status items according to the
``Started at`` column, newer items first.
Retrieving introspection data
-----------------------------
::
$ openstack baremetal introspection data save [--file file_name] [--unprocessed] NODE_ID
* ``NODE_ID`` - Ironic node UUID or name;
* ``file_name`` - file name to save data to. If file name is not provided,
the data is dumped to stdout.
* ``--unprocessed`` - if set, retrieves the unprocessed data received from the
ramdisk.
.. note::
This feature requires Swift support to be enabled in **Ironic Inspector**
by setting ``[processing]store_data`` configuration option to ``swift``.
Aborting introspection
----------------------
::
$ openstack baremetal introspection abort NODE_ID
* ``NODE_ID`` - Ironic node UUID or name.
Reprocess stored introspection data
-----------------------------------
::
$ openstack baremetal introspection reprocess NODE_ID
* ``NODE_ID`` - Ironic node UUID or name.
.. note::
This feature requires Swift store to be enabled for **Ironic Inspector**
by setting ``[processing]store_data`` configuration option to ``swift``.
Introspection Rules API
-----------------------
Creating a rule
~~~~~~~~~~~~~~~
::
$ openstack baremetal introspection rule import <JSON FILE>
* ``rule_json`` dictionary with a rule representation, see
:py:meth:`ironic_inspector_client.RulesAPI.from_json` for details.
Listing all rules
~~~~~~~~~~~~~~~~~
::
$ openstack baremetal introspection rule list
Returns list of short rule representations, containing only description, UUID
and links.
Deleting all rules
~~~~~~~~~~~~~~~~~~
::
$ openstack baremetal introspection rule purge
Deleting a rule
~~~~~~~~~~~~~~~
::
$ openstack baremetal introspection rule delete <UUID>
* ``UUID`` rule UUID.
Using names instead of UUID
---------------------------
Starting with baremetal introspection API 1.5 (provided by **Ironic Inspector**
3.3.0) it's possible to use node names instead of UUIDs in all Python and CLI
calls.
.. _introspection rules documentation: https://docs.openstack.org/ironic-inspector/latest/usage.html#introspection-rules
List interface data
-------------------
::
$ openstack baremetal introspection interface list NODE_IDENT
[--fields=<field>] [--vlan=<vlan>]
* ``NODE_IDENT`` - Ironic node UUID or name
* ``fields`` - name of one or more interface columns to display.
* ``vlan`` - list only interfaces configured for this vlan id
Returns a list of interface data, including attached switch information,
for each interface on the node.
Show interface data
-------------------
::
$ openstack baremetal introspection interface show NODE_IDENT INTERFACE
[--fields=<field>]
* ``NODE_IDENT`` - Ironic node UUID or name
* ``INTERFACE`` - interface name on this node
* ``fields`` - name of one or more interface rows to display.
Show interface data, including attached switch information,
for a particular node and interface.
.. _OpenStackClient: https://docs.openstack.org/python-openstackclient/latest/
|