REST API knowledge exchange
Post Reply
eeldivad
Influencer
Posts: 11
Liked: never
Joined: Apr 23, 2019 3:43 pm
Full Name: David Lee
Contact:

How to get list of Machines view

Post by eeldivad »

When we login to Veeam Backup Enterprise manager web portal, there is a tab for "Machines". This view shows me all machines being backed up and last successful backup and other useful information. How can I get this information using the REST API? I've spent a lot of time going through the REST documentation but there's not enough useful examples to follow that would allow me to get this. Has anyone tried and would be nice enough to share their code?

I tried using powershell but I'd have to connect to every backup server and run multiple commands and could end up taking several minutes to return this view. I was able to figure out the stored procedure used to get this view

exec [dbo].[usp.GridReport.DataSrc.VmInBackups] @attributesXml=N'<?xml version="1.0"?><attributes><attr name="userSid" value="AQUAAAAAAAUVAAAA6ZjJ3HxKikVJ5tldqzEAAA==" /></attributes>',@filtersXml=N'<filters><text_filter id="vm_name"><value></value></text_filter></filters>',@ordersXml=N'<orders><order id="vm_name" sort="asc" /></orders>',@start=0,@limit=999999

So running this sproc against the veeambackupreporting database directly will give me what I want within a few seconds but I know this is not the preferred method. If anyone can tell me how to get this info through REST API, I would prefer to go that route.

Thanks
benyoung
Veeam Software
Posts: 149
Liked: 47 times
Joined: May 25, 2016 3:29 am
Full Name: Ben Young
Contact:

Re: How to get list of Machines view

Post by benyoung »

I had a similar challenge with a protection dashboard for our portal. I ended up going a more simple route since we were already talking directly to vSphere for the other vm data / guest info in the same view.

The solution i ran with was having Veeam publish through to the vm annotation/notes upon successful backup and just parse/read that out at the same time.

You could however

Use the querySvc and pull out the available restore points, if you have the list of VM's you want to process you can combine this with a filter name==XXX to speed each call up if you prefer not to parse a large list as in a busy environment this tends to be quite slow. Not sure you can sort by CreationTimeUTC when i last checked just told you that field was invalid. try in the latest version though this may have changed

Or you could parse the last few jobsessions and pull out the list of successful includes / VMs that way
infraerik
Enthusiast
Posts: 28
Liked: 1 time
Joined: Jul 24, 2019 10:04 am
Contact:

Re: How to get list of Machines view

Post by infraerik »

Following up in a bit of a similar situation. I'm currently using the approach of using the Query service against a list of machines extracted from AD and a CMDB. However, as I'm getting more familiar with this environment, I discovered that in some cases, the machines are registered in Veeam under their hostname, and in others, their FQDN.

So I'm in the situation where I need to be able to pull out all of the VM Names, build a hashtable to match the hostname output from AD to the name that it used inside of Veeam so that where I do the query lookup I can use the actual name that is being used, since I can get reports that say a VM isn't backed up because the registered name is the FQDN rather than simply the hostname.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests