Getting the status of an inventory job for application servers

You can get status information about a currently running inventory job and the previous inventory job for application servers.

Method and URI

To get information about current and previous application inventory jobs, use a GET method and a URI, where {jobId} is the ID for the application server inventory job:

GET     https://{hostname|IP}/api/endeavour/job/{jobId}

Parameters

None.

Data

None.

Example: Get status of an inventory job for application servers

Assume that the {jobId} of the application server inventory job is 1004.

A Python snippet that is similar to the following example can be used to request information about the present and previous application server inventory jobs:

job_id = "1004"  # Application Server Inventory

requests.get('https://' + spp_ipv4 + '/api/endeavour/job/' + job_id,
    headers={...}, verify=...)
_images/reference_appserver_inventory01.png

Figure 27 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click Manage Protection and any page under File Systems, Containers, Cloud Management, or Datbases. In the Backup section, you will see either the Inventory In Progress button, which indicates the inventory job for application servers are in progress, or the Run Inventory button otherwise.

Assume that you ran an application inventory job 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": "Application Server Inventory",
    "description": null,
    "policyId": "1003",
    "policyName": "Application Server Inventory",
    "type": "catalog",
    "typeDisplayName": "Catalog",
    "subType": "application",
    "subTypeDisplayName": "Application",
    "serviceId": "serviceprovider.catalog.application",
    "displayName": "Application Server Inventory",
    "status": "RUNNING",
    "statusDisplayName": "Running",
    "lastSessionStatus": "PARTIAL",
    "lastSessionStatusDisplayName": "Partial",
    "triggerIds": [
        "1003"
    ],
    "triggerData": [
        {
            "triggerId": "1003",
            "triggerInfo": null
        }
    ],
    "lastRunTime": 1578684906215,
    "nextFireTime": 1578729600000,
    "lastSessionDuration": 20549,
    "tenantId": 1000,
    "actions": null,
    "statistics": null,
    "lastrun": {
        "sessionId": "1578684905188",
        "jobName": "Application Server Inventory",
        "type": "catalog",
        "subType": "application",
        "serviceId": "serviceprovider.catalog.application",
        "start": 1578684906215,
        "end": 1578684926764,
        "duration": 20549,
        "status": "PARTIAL",
        "results": "Started",
        "properties": null,
        "numTasks": 2,
        "previousLastTask": 0,
        "lastUpdate": 1578684926769,
        "percent": 0,
        "policySnapshot": null
    },
    "id": "1003"
}

In the example response above, the status value reads RUNNING which means the application 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": {...},
    ...
}

Restriction: Do not determine the status of the application 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 response to check the status.