Afternoon all
Trying to compile an API call to list all Backup jobs and their status/last run date from Ent Manager API.
i can run a http://VEM:9399/api/jobs and it does give me a list of all the jobs, but not their status/run dates. I'm kind of hoping there is something like the VAC call https://VAC:1281/v2/jobs
Can anyone help?
-
- Veeam Vanguard
- Posts: 629
- Liked: 251 times
- Joined: Sep 27, 2011 12:17 pm
- Full Name: Craig Dalrymple
- Location: Scotland
- Contact:
-
- Veeam Software
- Posts: 149
- Liked: 47 times
- Joined: May 25, 2016 3:29 am
- Full Name: Ben Young
- Contact:
Re: List all job status
Hi Craig,
Easily done, I loosely do the following to get all of the jobs
/api/jobs
Then iterate through these and pull out the backup sessions for that job (big list)
/api/jobs/{JobID}/backupSessions?format=Entity
Which will return loads of these to parse/filter as you see fit
<BackupJobSession Href="http://mybackupserver:9399/api/backupSe ... mat=Entity" Type="BackupJobSession" Name="MyClientBackupJob-10110-DailyAA@2017-05-30 07:30:05" UID="urn:veeam:BackupJobSession:7cbb022e-XXXXX-45XX-94a2-XXXXX6bc4233d">
<Links>
.... lunks removed here
</Links>
<JobUid>urn:veeam:Job:4cd83672-XXX-40e7-XXXX-005403fb2e51</JobUid>
<JobName>MyClientBackupJob-10110-DailyAA</JobName>
<JobType>Backup</JobType>
<CreationTimeUTC>2017-05-30T07:30:05.033Z</CreationTimeUTC>
<EndTimeUTC>2017-05-30T07:30:22.63Z</EndTimeUTC>
<State>Stopped</State>
<Result>Warning</Result>
<Progress>100</Progress>
<IsRetry>false</IsRetry>
</BackupJobSession>
Object reference here - https://helpcenter.veeam.com/docs/backu ... tml?ver=95
You can also parse the /api/backupjobsessions endpoint but a bit unruly and i am always coming in from the job perspective anyway
You can also do some basic filtering using /api/query?type=BackupJobSession
https://helpcenter.veeam.com/docs/backu ... tml?ver=95
https://helpcenter.veeam.com/docs/backu ... tml?ver=95
When i tried a year or so ago mileage did vary as to what could be filtered on for the different objects (not always documented... trial and error), might be different now though
Easily done, I loosely do the following to get all of the jobs
/api/jobs
Then iterate through these and pull out the backup sessions for that job (big list)
/api/jobs/{JobID}/backupSessions?format=Entity
Which will return loads of these to parse/filter as you see fit
<BackupJobSession Href="http://mybackupserver:9399/api/backupSe ... mat=Entity" Type="BackupJobSession" Name="MyClientBackupJob-10110-DailyAA@2017-05-30 07:30:05" UID="urn:veeam:BackupJobSession:7cbb022e-XXXXX-45XX-94a2-XXXXX6bc4233d">
<Links>
.... lunks removed here
</Links>
<JobUid>urn:veeam:Job:4cd83672-XXX-40e7-XXXX-005403fb2e51</JobUid>
<JobName>MyClientBackupJob-10110-DailyAA</JobName>
<JobType>Backup</JobType>
<CreationTimeUTC>2017-05-30T07:30:05.033Z</CreationTimeUTC>
<EndTimeUTC>2017-05-30T07:30:22.63Z</EndTimeUTC>
<State>Stopped</State>
<Result>Warning</Result>
<Progress>100</Progress>
<IsRetry>false</IsRetry>
</BackupJobSession>
Object reference here - https://helpcenter.veeam.com/docs/backu ... tml?ver=95
You can also parse the /api/backupjobsessions endpoint but a bit unruly and i am always coming in from the job perspective anyway
You can also do some basic filtering using /api/query?type=BackupJobSession
https://helpcenter.veeam.com/docs/backu ... tml?ver=95
https://helpcenter.veeam.com/docs/backu ... tml?ver=95
When i tried a year or so ago mileage did vary as to what could be filtered on for the different objects (not always documented... trial and error), might be different now though
Who is online
Users browsing this forum: No registered users and 3 guests