RESTful knowledge exchange
Post Reply
ChadC
Lurker
Posts: 2
Liked: never
Joined: Nov 18, 2021 7:38 pm
Contact:

API job status via linux bash script :?:

Post by ChadC »

I have a script that lets me start a job through the API of the Enterprise Manager (Veeam 11) server. The initial status I get back is just for the "start job" task so that is not helpful for determining if the backup job itself is still running. However, I am looking for help to get the running or completed status of that job once it starts.

Is there a way to pull the NAS backup job status once you have the task ID or is there another method of getting the job status someone can help me with?

Brief history: We have a bash script for mounting a storage filesystem copy to another server and run the backup from there. We have it working with another backup system but have migrated to Veeam and trying to integrate that into our script. Because of the size of the backup, currently 8TB and growing, we have been advised the NAS (NFS) type backup will be the fastest backup and restore for this single filesystem.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: API job status via linux bash script :?:

Post by oleg.feoktistov »

Hi,

I'm afraid task id won't get you far as it doesn't reference actual object a task creates.
The way you could get around it is through query service. Here are the steps:
1. Obtain nas job object via GET /nas/jobs/{id}.
2. Parse UID property, change NasJob to Job in its value (urn:veeam:NasJob:id => urn:veeam:Job:id) and save to a variable.
3. Use saved value for this request along with any other available parameters if needed.
For example, to get working sessions for a particular job you would need to send something like this:

Code: Select all

/query?type=BackupJobSession&format=Entities&filter=State==Working&JobUid==urn:veeam:Job:xxxx
Make sure to place State parameter before JobUid to make query work.


Hope it helps,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests