Getting progress information about job sessions

You can get progress information about job sessions.

Method and URI

To get a list of jobs with progress information for each item, use a GET method and a URI:

GET     https://{hostname|IPv4}/api/progress

Parameters

Parameter 1: pageSize

Specify the maximum number of objects for each page.

  • Example value: 100

  • Type: Integer.

Parameter 2: filter

Filter results by specifying criteria.

  • Example value: Assume that you want to filter jobs by using the following criteria:

    • Job status: Failed, aborted, partial, or canceled

    • Job types: Virtualized systems

    • {jobsessionId}: 1610664896075

You can use the following JSON object:

"filter": [
    {
        "property": "summaryStatus",
        "value":    "[\"complete\",\"partial\",\"failed\",\"skipped\"]",
        "op":       "IN"
    },
    {
        "property": "type",
        "value":    "HYPERVISORVM",
        "op":       "="
    },
    {
        "property": "sessionId",
        "value":    "1610664896075",
        "op":       "="
    }
]
  • Type: List.

See also

For information about operations parameters for JSON object output, filtering, sorting, and pagination, follow the instructions in Operation parameters for JSON object output.

Parameter 2.1: filter > List > JSON object: summaryStatus

Filter previous jobs based on status. You can use the following values for the summaryStatus key:

summaryStatus value

Job status

complete

Completed

partial

Partial

skipped

Canceled

failed

Failed or aborted

running

Running

pending

Pending

  • Type: JSON object.

Parameter 2.2: filter > List > JSON object: type

Filter jobs based on type. Use the following values for the type key:

type value

Job type

HYPERVISORVM HYPERVISORVM

Virtualized systems (VMware vCenter, Hyper-V, and Amazon Elastic Compute Cloud, EC2)

INSTANCES

Cloud management (Microsoft 365)

DATABASE

(All other types)

  • Type: JSON object.

Parameter 2.3: filter > List > JSON object: sessionId

Filter JSON objects based on {jobsessionId}.

  • Type: JSON object.

Tip

To get a {jobsessionId}, follow the instructions in Getting job session information.

Parameter 3: sort > List > JSON object: id

Sort job items by IDs, which are based on the start time of the job.

  • Example value: Use the following JSON object to sort the job items by their start time in descending order:

{
    "property": "id",
    "value":    "DESC"
}
  • Type: JSON object. Available in the web user interface.

Data

None.

Example 1: Get progress information about incomplete jobs for virtualized systems

Assume that IBM Spectrum Protect Plus was used to run jobs, such as backup jobs for VMware vCenter objects, and you want to get progress information based on the following criteria:

  • Pagination: 10 records per page, get the records between the 1st and 10th

  • Job status: Failed, aborted, partial, or canceled

  • Job types: Virtualized systems

  • Sorting order: Sort the records by their start time in ascending order

Tip

The response body can be extremely large. Use filters and pagination.

A Python snippet that is similar to the following example can be used to request a list of jobs with progress information:

_params = {
    "pageSize": 10,
    "pageStartIndex": 0,
    "filter": {
        json.dumps([
            {
                "property": "summaryStatus",
                "value":    "[\"failed\", \"partial\", \"skipped\"]",
                "op":       "IN"
            },
            {
                "property": "type",
                "value":    "HYPERVISORVM",
                "op":       "="
            }
        ])
    },
    "sort": {
        json.dumps([
            {
                "property":  "id",
                "direction": "ASC"
            }
        ])
    }
}

_response = requests.get('https://' + spp_ipv4
    + '/api/progress',
    headers={...}, params=_params, verify=...)

print(_response.text)

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK).

{
    "links": {
        "self": {
            "rel": "self",
            "href": "https://10.0.0.100/api/progress",
            "hreflang": null,
            "media": null,
            "title": null,
            "type": null,
            "deprecation": null
        }
    },
    "page": 1,
    "total": 20,
    "summaries": [
        {
            "links": {
                "up": {
                    "rel": "self",
                    "href": "https://10.0.0.100/api/progress",
                    "hreflang": null,
                    "media": null,
                    "title": null,
                    "type": null,
                    "deprecation": null
                }
            },
            "name": "Service-Dallas",
            "type": "HYPERVISORVM",
            "association": null,
            "protectionInfo": null,
            "recoveryInfo": null,
            "recoveryPoint": null,
            "siteId": "10.0.1.1",
            "autoProvisionedsubPolicyName": null,
            "rbacPath": null,
            "rbacPathId": null,
            "extInfo": null,
            "location": "/vmware-dallas1.bluemachines.com.invalid/Production/Ser
   ↪vice-Dallas",
            "metadataPath": null,
            "inHLO": true,
            "jobPK": "1096_1610664896075",
            "resourceName": "Service-Dallas",
            "resourcePk": "221199d6aa263807e7387a0bfcb15326",
            "proxyUsed": "10.0.1.1",
            "proxyUsedId": "2102",
            "isBase": true,
            "vmdkIds": null,
            "vmdkName": null,
            "transportMethod": "[hotadd]",
            "vmdkCount": 1,
            "protectedVmdkCount": 1,
            "totalDataTransferred": "37.59 GB",
            "total": 0,
            "throughput": "217081904",
            "queueTimeStart": 0,
            "queueTimeEnd": 0,
            "isSuccess": true,
            "summaryStatus": "partial",
            "vSnapUsed": "10.0.1.1",
            "vSnapUsedId": null,
            "percentageCompleted": 50,
            "vsnapVolumes": {
                "spp_1096_2207_176f26b6caf__group66c64994fb89402d922491630feba43
   ↪": "2102.volume.3"
            },
            "groupParentPk": null,
            "groupPercentageCompleted": 0,
            "resourcePhaseName": null,
            "resourcePhaseProgressPercentage": 0,
            "phaseNumber": 0,
            "totalPhases": 0,
            "Name": "Service-Dallas",
            "partitionId": null,
            "message": null,
            "backupStartTime": 1610384909,
            "backupEndTime": 1610385140,
            "errorCode": 0,
            "elapsedTime": 230,
            "base": true,
            "success": true,
            "protected": false,
            "failed": false,
            "systemHold": false,
            "id": "1610664896075.221199d6aa263807e7387a0bfcb15326",
            "host": "10.250.250.13",
            "resourceType": "resourcesummary",
            "resourceSummary": {
                "name": "Service-Dallas",
                "type": "HYPERVISORVM",
                "association": null,
                "protectionInfo": null,
                "recoveryInfo": null,
                "recoveryPoint": null,
                "siteId": "10.0.1.1",
                "autoProvisionedsubPolicyName": null,
                "rbacPath": null,
                "rbacPathId": null,
                "extInfo": null,
                "location": "/vmware-dallas1.bluemachines.com.invalid/Production
   ↪/Service-Dallas",
                "metadataPath": null,
                "inHLO": true,
                "jobPK": "1096_1610664896075",
                "resourceName": "Service-Dallas",
                "resourcePk": "221199d6aa263807e7387a0bfcb15326",
                "proxyUsed": "10.0.1.1",
                "proxyUsedId": "2102",
                "isBase": true,
                "vmdkIds": null,
                "vmdkName": null,
                "transportMethod": "[hotadd]",
                "vmdkCount": 1,
                "protectedVmdkCount": 1,
                "totalDataTransferred": "37.59 GB",
                "total": 0,
                "throughput": "217081904",
                "queueTimeStart": 0,
                "queueTimeEnd": 0,
                "isSuccess": true,
                "summaryStatus": "complete",
                "vSnapUsed": "10.0.1.1",
                "vSnapUsedId": null,
                "percentageCompleted": 50,
                "vsnapVolumes": {
                    "spp_1096_2207_176f26b6caf__group66c64994fb89402d922491630fe
   ↪ba43": "2102.volume.3"
                },
                "groupParentPk": null,
                "groupPercentageCompleted": 0,
                "resourcePhaseName": null,
                "resourcePhaseProgressPercentage": 0,
                "phaseNumber": 0,
                "totalPhases": 0,
                "Name": "Service-Dallas",
                "partitionId": null,
                "message": null,
                "backupStartTime": 1610384909,
                "backupEndTime": 1610385140,
                "errorCode": 0,
                "elapsedTime": 230,
                "base": true,
                "success": true,
                "protected": false,
                "failed": false,
                "systemHold": false,
                "id": "1610664896075.221199d6aa263807e7387a0bfcb15326",
                "host": "10.250.250.13"
            }
        },
        {...}, ..., {...}
   ]
}

Example 2: Get progress information about a job

Assume that you want to get progress information about a job with {sessionId} 1610664896075.

A Python snippet that is similar to the following example can be used to request progress information:

_params = {
    "filter": {
        json.dumps([
            {
                "property": "sessionId",
                "value":    "1610664896075",
                "op":       "="
            }
        ])
    }
}

_response = requests.get('https://' + spp_ipv4
    + '/api/progress',
    headers={...}, params=_params, verify=...)

The request prompts a response that is similar to the response body in the previous example.