API Guide
Table Of Contents
- OpenManage Integration for VMware vCenter Version 5.3 API Guide
- Contents
- Overview
- Get started
- Security
- Use cases
- Session management
- License management
- Console management
- Repository profile management
- Cluster profile management
- Firmware repository inventory management
- Firmware inventory management
- Firmware update management
- System profile management
- Drift management
- Get subsystem health report (OMIVV Host Health)
- Host management
- Request body
- Response body
- OMIVV-Specific error codes
● OMIVV has at least one license installed.
● You have verified all the pre-requisites mentioned in the Prerequisites on page 9.
About this task
OMIVV requires a valid license to successfully manage the hosts. Multiple licenses can be installed at a time to the appliance.
This topic describes how to get list of all licenses installed in OMIVV and retrieve information of individual license.
Steps
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.
● Get all licenses
Invoke /Services/LicenseService/Licenses API get list of all licenses.
The API response contains following attributes for all the licenses installed:
● Id - License ID generated by OMIVV when the license is installed
● href - URI to individual license in the format /Services/LicenseService/Licenses/{Id}
● objectType - Type of the JSON object. Value is "LicenseInfo"
● entitlementID: Unique license ID
● licenseType - License term. Possible values are Evaluation or Standard or Perpetual
●
maxHosts - Maximum hosts that can be managed with this license
● startDate - License start date
● expirationDate - License expiration date
● duration - License validity duration in days
● licenseStatus - Current license status. Possible values are Active or Inactive or Expired
Sample code to get the list of all licenses:
```
def get_all_licenses(omivv_ip, bearer_token):
"""Get all license jobs"""
url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/LicenseService/Licenses"
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)
return json_response
else:
print("Get all license jobs failed.")
```
● Get individual license information
Invoke /Services/LicenseService/Licenses/{Id} API get list of all licenses.
The attributes are same as /Services/LicenseService/Licenses response.
Sample code to get the individual license information:
```
def get_license_deatil_by_id(omivv_ip, bearer_token, licesne_id):
""" Get the license details"""
url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/LicenseService/
Licenses/" + licesne_id;
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)
return json_response
else:
print("Get all license jobs failed.")
```
30
Use cases