Getting status of a hypervisor inventory job¶
Get status information about a currently running inventory job and the previous one.
Method and URI¶
To get information about the present and previous hypervisor inventory jobs, use a GET method and a URI:
GET https://{hostname|IP}/endeavour/job/1004
Parameters¶
None.
Example¶
Here is a Python snippet that requests status information about the present and previous hypervisor inventory job:
requests.get('https://' + spp_ipv4 + '/api/endeavour/job/1004',
headers={...}, verify=...)
Assume that you ran an inventory job for virtualized systems and send the request to see the status of it. Normally, the inventory job takes a few minutes to complete and so you should see the running status. In your browser, the blue Run Inventory button has been grayed out and reading Inventory In Progress. Here is an example response with the HTTP status code of 200 (OK).
{
"links": {...},
"name": "Hypervisor Inventory",
"description": null,
"policyId": "1004",
"policyName": "Hypervisor Inventory",
"type": "catalog",
"typeDisplayName": "Catalog",
"subType": "hypervisor",
"subTypeDisplayName": "Hypervisor",
"serviceId": "serviceprovider.catalog.hypervisor",
"displayName": "Hypervisor Inventory",
"status": "RUNNING",
"statusDisplayName": "Running",
"lastSessionStatus": "PARTIAL",
"lastSessionStatusDisplayName": "Partial",
"triggerIds": [
"1004"
],
"triggerData": [
{
"triggerId": "1004",
"triggerInfo": null
}
],
"lastRunTime": 1578679221737,
"nextFireTime": 1578729600000,
"lastSessionDuration": 685498,
"tenantId": 1000,
"actions": null,
"statistics": null,
"lastrun": {
"sessionId": "1578679221158",
"jobName": "Hypervisor Inventory",
"type": "catalog",
"subType": "hypervisor",
"serviceId": "serviceprovider.catalog.hypervisor",
"start": 1578679221737,
"end": 1578679907235,
"duration": 685498,
"status": "PARTIAL",
"results": "Started",
"properties": null,
"numTasks": 4,
"previousLastTask": 0,
"lastUpdate": 1578679907240,
"percent": 100,
"policySnapshot": null
},
"id": "1004"
}
In the example response above, the status
value reads RUNNING
which means the hypervisor inventory job was running at the time you sent the request. You can also see the information about the previous hypervisor inventory job.
A few minutes later, you send the same request again to see the status. At this time, the button in the browser comes back to the original, blue Run Inventory button. Here is an example response with the HTTP status code 200 (OK). As you see, the status
value reads IDLE
.
{
"links": {...},
...
"status": "IDLE",
"statusDisplayName": "Idle",
"lastSessionStatus": "PARTIAL",
"lastSessionStatusDisplayName": "Partial",
"triggerIds": [
"1004"
],
"triggerData": [
{
"triggerId": "1004",
"triggerInfo": null
}
],
"lastRunTime": 1578681060744,
"nextFireTime": 1578729600000,
"lastSessionDuration": 529178,
"tenantId": 1000,
"actions": null,
"statistics": null,
"lastrun": {...},
...
}
Warning
Do not determine the status of the hypervisor inventory jobs by referring to the HTTP status code in a response. This request will make a response with the HTTP status code of 200 (OK) regardless of the status. Instead, refer to the relevant key-value pairs in the resposne to check the status.