Job

For the Job collection resource, you can use an object value to return another value for the same object.

Getting a {jobName}

IBM Spectrum Protect Plus assigns a name {jobName} to each scheduled job. Use one of the following policy names:

Scheduled job

Policy name

Maintenance

Maintenance

Storage server inventory

Storage Server Inventory

Application server inventory

Application Server Inventory

Hypervisor inventory

Hypervisor Inventory

Protection

{applicationName}_{slaPolicyName}

For more information about {applicationName}, see Getting an {applicationName}.

Getting a {jobId}

IBM Spectrum Protect Plus assigns an ID {jobId} to each scheduled job.

Method and URI: To convert the value of an object for a scheduled job, use a GET method with a URI:

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

Path: Response body (JSON) > jobs > policyName & id.

Example: Assume that you added an SLA policy, Gold, to IBM Spectrum Protect Plus. Assign it to SQL Server instances. In this case, the policy name is sql_Gold. A Python snippet that is similar to the following example can be used to return its {jobId} value, 1011:

object_name = "sql_Gold"

_response = requests.get('https://' + spp_ipv4 + '/api/endeavour/job',
    headers=..., verify=...)

_response_json = json.loads(_response.text)    # Convert to JSON

object_json = _response_json['jobs']

for keys in object_json:
    if keys['policyName'] == object_name
        object_id = keys['id']

print(object_id)
1011