API Guide

Table Of Contents
headers=head)
if (response.status_code == 200):
json_response = json.dumps(response.json(), indent=4, sort_keys=True)
return json_response
else:
print("Get fw report failed.")
```
Next steps
Update firmware for drifted components
The intention is to maintain the desired state for the cluster. For the drifted components in the drift report, trigger firmware
update using the use case described earlier. For sample code, see https://github.com/dell/omivv.
Monitor component health in OMIVV
Prerequisites
Ensure that:
Hosts added in the vCenter
Host Credential Profile is created using OMIVV UI and inventory is run successfully
About this task
OMIVV manages ESXi host in vCenter server and calculates status of different sub systems of the server. This topic helps you
to check the health of various server components.
Steps
1. Start an OMIVV session using OMIVV user credentials. OMIVV credentials are required to authenticate a client of the
RESTFul API.
For more information, see OMIVV authentication on page 11.
2. View component health.
Invoke the following API to retrieve different server component health: Services/InventoryService/Hosts/{host-
id}/SubSystemHealth
Invoke the following API to retrieve host ID: Services/ConsoleService/Consoles/{console-id}
Invoke the following API to retrieve Console id: /Services/ConsoleService/Consoles
```
detail_str -> Only below 4 strings is supported
1.SubSystemHealth
2.HostOverview
3.FirmwareInventory
4.Warranty
e.g def get_host_details(omivv_ip, bearer_token, host_id, 'SubSystemHealth')
def get_host_details(omivv_ip, bearer_token, host_id, details_str):
""" Get the Host details value"""
url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/InventoryService/
Hosts/" + host_id + "/" + details_str
head = {'Authorization': 'Bearer ' + bearer_token}
response = requests.get(url, verify=False, headers=head)
if (response.status_code == 200):
json_response = json.dumps(response.json(), indent=4, sort_keys=True)
print(json_response)
else:
print("Get host details failed.")
```
Use cases
35