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 |
|
Storage server inventory |
|
Application server inventory |
|
Hypervisor inventory |
|
Protection |
|
For more information about {applicationName}
, follow the instructions in 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. Then, you assigned the policy to SQL Server instances. In this case, you must add the prefix “sql_
” to the SLA policy name. 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