REST API knowledge exchange
Post Reply
YvesB22
Influencer
Posts: 16
Liked: 3 times
Joined: May 18, 2022 6:04 am
Contact:

Veeam B&R Rest API TaskSession

Post by YvesB22 »

Hello,

The selection of servers to back up in our backup jobs is done using VMware tags.
I'm trying to retrieve the status (success, warning, failed) of each VM in each job.
I can do this using the Veeam B&R PowerShell module with the commands below:
- Get-VBRSession -Job (Get-VBRJob -Name $JobName)
- Get-VBRTaskSession -Session (Get-VBRSession -Id $item)
However, using the Veeam B&R APIs, I can only:
- retrieve the job names
/api/vi/jobs
- retrieve the job sessions
/api/vi/sessions

How can I retrieve the equivalent of the "Get-VBRTaskSession" command ?

Veeam version : 12.3

Thank you for your response
david.domask
Veeam Software
Posts: 3143
Liked: 720 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Veeam B&R Rest API TaskSession

Post by david.domask »

Hi YvesB22,

/api/v1/sessions/{id}/taskSessions

It accepts a Job Session ID returned by /api/v1/session - the /api/v1/session endpoint allows you to filter by jobId, so I would go about it by iterating over your jobIds on /api/v1/session, sort the output to get the desired session, then pass the sessionId to /api/v1/sessions/{id}/taskSessions
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest