I use the RESTful API to launch and check the status of my backup jobs.
I'm using State, Result and Progress to check the status of the backup job, but is it possible to get the status of the snapshot completion instead of the status of the entire backup job?
Code: Select all
#!/user/bin/python3
import requests
import json
# session_id, job_name are already set using API
headers={
'X-RestSvcSessionId': session_id,
'Accept': 'application/json'
}
params={
'type': 'BackupJobSession',
'format': 'Entities',
'sortDesc': 'Name',
'filter': 'jobname="{0}"'.format(job_name),
'pageSize': 1
}
url='https://<ip>:9398/api/query'
response = requests.get(url, headers=headers, params=params, verify=False)
data = json.loads(response.text)