from pprint import pprint

from config_loader import try_load_from_file
from hpOneView.oneview_client import OneViewClient

config = {
    "ip": "<oneview_ip>",
    "credentials": {
        "userName": "<oneview_administrator_name>",
        "password": "<oneview_administrator_password>",
    }
}

# To run this example you must define a path to a valid file
firmware_path = "<path_to_firmware_bundle>"

# Try load config from a file (if there is a config file)
config = try_load_from_file(config)
oneview_client = OneViewClient(config)

# Upload a firmware bundle
print("Upload a firmware bundle")
firmware_bundle_information = oneview_client.firmware_bundles.upload(file_path=firmware_path)
pprint(firmware_bundle_information)
