.. image:: /images/hpe_logo2.png
   :width: 150pt

|

First create an instance of Rest or Redfish Object using the **RestObject** or
**RedfishObject** class respectively. The class constructor takes iLO hostname/
ip address formatted as a string ("https://xx.xx.xx.xx"), iLO login username
and password as arguments. The class also initializes a login session, gets
systems resources and message registries.

Rest Object creation:

.. code-block:: python

 REST_OBJ = RestObject(iLO_https_host, login_account, login_password)

Redfish Object creation:

.. code-block:: python

 REDFISH_OBJ = RedfishObject(iLO_https_host, login_account, login_password)

Example 6: Revert to default BIOS setting
=========================================

The method **ex6_bios_revert_default** takes an instance of rest object (or
redfish object if using redfish API) as parameter.

.. code-block:: python

 def ex6_bios_revert_default(restobj):

Find and get the BIOS settings URI(s) from the systems resources collection.

.. code-block:: python

 instances = restobj.search_for_type("Bios.")

Next the HTTP request body is set with default configuration.

.. code-block:: python

 for instance in instances:
     body = {"BaseConfig": "default"}

PUT request is performed next and response error is handled if any.

.. code-block:: python

 response = restobj.rest_put(instance["href"], body)
 restobj.error_handler(response)

A successful PUT response implies that BIOS is set to default settings, however
the changes will get affected only after a system reset or reboot.

**Note:** The Bios. type is not supported in Gen9 servers for Redfish but the
example includes Redfish implementation for Redfish Bios. type support in
Gen10. Rest works as intended.
