Starting a job manually

IBM Spectrum Protect Plus IBM Spectrum Protect Plus can start backup jobs that are associated with service level agreement (SLA) policies in two ways:

  1. An SLA policy for associated instances of hypervisors, application servers, and IBM Spectrum Protect Plus catalogs. Backup jobs are started automatically after the SLA policy is defined.

  2. An SLA policy for associated instances of specific types of virtualized systems, application servers or IBM Spectrum Protect Plus. Backup jobs must be started manually regardless of how the SLA policy is defined.

For example, assume that you have a custom SLA policy, Diamond, which starts every day at midnight UTC. You associate the SLA policy with some instances of VMware, Oracle Database, and IBM Db2.

In this case, you do not have to create a script to start this SLA policy because backup jobs are started automatically by IBM Spectrum Protect Plus. But in some cases, you want to start the backup jobs manually. A manual start is supported for some types of virtualized systems, application servers, and IBM Spectrum Protect Plus. In that case, the SLA policy name has one of the following prefixes:

Prefix

Product

vmware

VMware vCenter

hyperv

Hyper-V

oracle

Oracle Database

sql

SQL Server

db2

Db2

exch

Exchange Server

mongo

MongoDB

office365

Microsoft 365

catalog

IBM Spectrum Protect Plus

Method and URI

To start a job manually, use a POST method and a URI:

POST    https://{hostname|IP}/api/endeavour/job/{slapolicyId}

Tip

To get an {slapolicyId} value based on its name, follow the instructions in Getting an {slapolicyId}.

Parameters

Parameter 1: action

Specify the type of action.

  • Value: inventory

  • Type: System string. Required. Available in the web interface.

Parameter 2: actionname

Specify the step of the action.

  • Value: start

  • Type: System string. Required. Available in the web interface.

Data

None.

Example: Start a job manually

Assume that you want to start a job, vmware_Gold ({slapolicyId} 1021), manually.

A Python snippet that is similar to the following example can be used to start a job manually:

sla_id = "1021"    # vmware_Gold

_params = {
    "action":     "start",
    "actionname": "start"
}

requests.post('https://' + spp_ipv4 + '/api/endeavour/job/' + sla_id,
     headers={...}, params=_params, data="", verify=...)
_images/reference_slapolicy_start1.png

Figure 7 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click Jobs and Operations and click the Schedule tab. You will see a list of jobs. For the job that you want to start, click Actions > Start.

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

{
    "links": {...},
    "name": "vmware_Gold",
    "description": "Auto-generated job for Policy vmware_Gold",
    "policyId": "1021",
    "policyName": "vmware_Gold",
    "type": "protection",
    "typeDisplayName": "Protection",
    "subType": "vmware",
    "subTypeDisplayName": "VMware",
    "serviceId": "serviceprovider.protection.hypervisor",
    "displayName": "Hypervisor Backup",
    "status": "RESOURCE ACTIVE",
    "statusDisplayName": "Resource active",
    "lastSessionStatus": "PARTIAL",
    "lastSessionStatusDisplayName": "Partial",
    "triggerIds": [
        "1015"
    ],
    "triggerData": [
        {
            "triggerId": "1015",
            "triggerInfo": {
                "subpolicy_id": "VADP Backup(2000)"
            }
        }
    ],
    "lastRunTime": 1576153580805,
    "nextFireTime": 1576167979000,
    "lastSessionDuration": 3572,
    "tenantId": 1000,
    "actions": null,
    "statistics": null,
    "policy": {
        "links": {...},
        "name": "vmware_Gold",
        "type": "protection",
        "subType": "vmware",
        "serviceId": "serviceprovider.protection.hypervisor",
        "description": "",
        "version": "3.0",
        "rbacPath": "root:0/policy:0/policytype:serviceprovider.protection.hyper
↪visor/policy:1021",
        "tenantId": 1000,
        "creationTime": 1570192798811,
        "lastUpdated": 0,
        "spec": {
            "source": [],
            "storageworkflow": [
                {
                    "id": "2000",
                    "name": "Gold",
                    "href": "http://localhost:8082/api/spec/storageprofile/2000"
                }
            ],
            "option": {
                "maxtasks": 0,
                "vmsnapshot": {
                    "takesnapshot": false,
                    "concurrentsnapshotsonesx": 3,
                    "includememory": false,
                    "consistency": false,
                    "consistencyvms": [],
                    "scriptvms": [],
                    "truncateapplicationlogs": false
                },
                "skipreadonlydatastores": true
            },
            "notification": []
        },
        "logicalDelete": false,
        "script": {
            "preScript": null,
            "postScript": null,
            "preSnap": null,
            "postSnap": null,
            "preGuest": null,
            "postGuest": null,
            "preGuestSnap": null,
            "postGuestSnap": null,
            "continueScriptsOnError": false
        },
        "id": "1021"
    },
    "triggers": [
        {
            "links": {...},
            "name": "1021__VADP Backup(2000)",
            "type": "Schedule",
            "category": "INTERNAL",
            "triggerInfo": {
                "id": 1015,
                "name": "1015:1021",
                "comment": null,
                "creatorId": 0,
                "creationTime": 1570192799690,
                "type": null,
                "flags": 0,
                "pk": null,
                "triggerId": "1015",
                "jobId": "1021",
                "triggerInfo": {
                    "subpolicy_id": "VADP Backup(2000)"
                },
                "category": "INTERNAL"
            },
            "properties": {
                "activateDate": 1564604779173,
                "deactivateDate": null,
                "frequency": 4,
                "type": "HOURLY",
                "dowList": [
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "domList": [
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ]
            },
            "rbacPath": "trigger:0/trigger:1015",
            "onHold": false,
            "id": "1015"
        }
    ],
    "lastrun": {
        "sessionId": "1576153579173",
        "jobName": "vmware_Gold",
        "type": "protection",
        "subType": "vmware",
        "serviceId": "serviceprovider.protection.hypervisor",
        "start": 1576153580805,
        "end": 1576153584377,
        "duration": 3572,
        "status": "PARTIAL",
        "results": null,
        "properties": {
            "statistics": []
        },
        "numTasks": 2,
        "previousLastTask": 0,
        "lastUpdate": 1576153584402,
        "percent": 5,
        "policySnapshot": null
    },
    "id": "1021"
}