.. 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 36: Set BIOS URL boot file
==================================

The method **ex36_set_bios_url_boot_file** takes an instance of rest object (or
redfish object if using Redfish API) and a filepath as arguments.

.. code-block:: python

 def ex36_set_bios_url_boot_file(restobj, path='', bios_password=None):

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

.. code-block:: python

 instances = restobj.search_for_type("Bios.")

For the filepath, prepare the request body with only the UrlBootFile we want to
change and perform the PATCH request.

.. code-block:: python

 for instance in instances:
     print instance
     body = {"UrlBootFile": path}
     response = restobj.rest_patch(instance["href"], body, bios_password)
     restobj.error_handler(response)

A successful PATCH response will set the Boot file to the new values provided,
however the changes will go into effect 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.
