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
Sample code to create repository profile:
```
def create_repository_profile(omivv_ip, bearer_token, create_args_file):
base_url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/
PluginProfileService/RepositoryProfiles"
"""Open the JSON input file"""
input_file = open(create_args_file,"r")
input_data = json.load(input_file)
head = {'Authorization': 'Bearer ' + bearer_token}
jsonReponse = requests.post(base_url, json=input_data, verify=False, headers=head)
if (jsonReponse.status_code == 200):
json_response = json.dumps(jsonReponse.json(), indent=4, sort_keys=True)
print(json_response)
print("Successfully creating the repository profile.")
return json_response
else:
print("Error in creating the repository profile.")
print(json_response)
Sample of input_file:
{
"name":"LocalOnelineCatalog",
"description": "LocalOnlineCatalog",
"globalDefault": "false",
"repoType": "FIRMWARE",
"protocolType": "CIFS",
"uri": "\\\\xx.xx.xx.xx\\ShareFolder\\onlineCatalog\\Catalog.xml",
"credential": {
"username": "xxxx",
"domain": "",
"password": "xxxx"
}
}
```
4. Create system profile. System profile is used to configure hardware attributes for the desired configuration. Create the
system profile in OMIVV UI.
5. Create cluster profile using repository profile and system profile using OMIVV UI.
A cluster profile enables to capture the configuration baseline (hardware configuration, firmware, or driver versions).
6. View drift detection job. A drift detection job is run to find the comparison between the validated baseline and the server
configuration which includes hardware configuration, firmware, and driver versions. Drift job gets triggered automatically
after you create the cluster profile.
Invoke the following API to retrieve all drift job: /Services/DriftDetectionService/Jobs
```
def get_all_drift_jobs(omivv_ip, bearer_token):
"""Get all drift jobs"""
url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/
DriftDetectionService/Jobs"
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 drift jobs failed.")
```
Invoke the following API to get cluster details about a specific job: /Services/DriftDetectionService/Jobs/{id}
Sample code to get the cluster details:
```
def get_drift_job_by_id(omivv_ip, bearer_token, d_job_id):
""" Get the drift job details by job id"""
url = "https://" + omivv_ip + "/Spectre/api/rest/v1/Services/
32
Use cases