Backup results

RESTful knowledge exchange

Backup results

Veeam Logoby abqstu » Wed Jan 08, 2014 12:58 pm

Hi

I'm trying to retrieve the results of backup operations using the REST API.

At the moment I'm using the (GET) /backupTaskSessions call and this returns a list of all the backups ever done for every virtual machine. I then have to parse these results to find the ones I'm interested in, using the VmDisplayName attribute of the BackupTaskSession tag to know which machine each result relates to. Obviously this returns a lot of results I'm not interested in and will return more and more data over time.

Is there any way to get the results for a specific virtual machine (or even better a list of virtual machines) or to limit the results returned by start and/or end date ?

Thanks
Stuart
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Backup results

Veeam Logoby nefes » Thu Jan 09, 2014 7:48 am

You can use /querySvc to search sessions with certain parameters.
More details about query syntax can be found here.
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Backup results

Veeam Logoby abqstu » Mon Jan 13, 2014 9:17 am

Thanks. That's just what I was looking for.
One more question - the filter and sort fields appear to work only with the attributes of the main tag (the BackupTaskSession tag in my case). Is it possible to use the values of sub tags to filter or sort the results ?
For example, the BackupTaskSession tag has a Result sub tag - is it possible to just retrieve results where the value of the Result tag is Success ?
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Backup results

Veeam Logoby nefes » Mon Jan 13, 2014 9:49 am

Yes, you can do it. Just make a filter like: filter=(Result=="Success")
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Backup results

Veeam Logoby abqstu » Mon Jan 13, 2014 10:18 am

Okay. That seems to work with some fields but not with others.
The example you give works okay, but if I try the CreationTimeUTC or EndTimeUTC fields, I get a 400 error with the message "Incorrect field name: CreationTimeUTC"
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Backup results

Veeam Logoby nefes » Mon Jan 13, 2014 1:11 pm

You can view all implemented filter parameters at corresponding section of the guide, for example http://helpcenter.veeam.com/backup/70/r ... ns_id.html for Backup Task Session.
All other parameters also may work, but it was not specially tested so you can see error message like that one.
If you think that some other parameter for querying should be implemented - here is the best place to tell us about it.
Could you please specify a scenario where you need CreationTimeUTC or EndTimeUTC fields to be queryable?
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Backup results

Veeam Logoby abqstu » Mon Jan 13, 2014 1:49 pm

I was looking to restrict how many results I get back by date. i.e. only results after the given date will be returned.
I notice that the parameter names for the two fields (CreationTime and EndTime) are different to the XML tag names (CreationTimeUTC and EndTimeUTC) which is what I had been using in the filter.
However, if I do use CreationTime or EndTime in the filter I then get a 500 error with a System.NotImplementedException in the stacktrace. The documentation shows True in the 'Can Be Used For Filtering' column for those parameters.
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Backup results

Veeam Logoby nefes » Tue Jan 14, 2014 8:53 am

I am sorry for inattention! What you've found is definitely a bug, we will fix it in one of upcoming releases.
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Backup results

Veeam Logoby abqstu » Tue Jan 14, 2014 9:31 am

No problem.
Thanks for your help.
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Backup results

Veeam Logoby Cathy » Thu Aug 21, 2014 5:43 am

May I know this issue is fixed in which patch? Or fixed in Veeam B&R v.8?
I reviewed release notes of each patches but can't find it.
Cathy
Influencer
 
Posts: 16
Liked: never
Joined: Fri Jun 13, 2014 3:48 am
Full Name: Cathy Hu

Re: Backup results

Veeam Logoby foggy » Thu Aug 21, 2014 8:40 am

Cathy, this was supposed to be fixed in Patch 3, probably just was not included in the list of fixes.
foggy
Veeam Software
 
Posts: 14716
Liked: 1075 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Backup results

Veeam Logoby Cathy » Mon Aug 25, 2014 2:11 am

We updated patch 4 and it worked well. Thanks.
Cathy
Influencer
 
Posts: 16
Liked: never
Joined: Fri Jun 13, 2014 3:48 am
Full Name: Cathy Hu

Re: Backup results

Veeam Logoby foggy » Tue Aug 26, 2014 10:31 am

Thanks for confirming, much appreciated.
foggy
Veeam Software
 
Posts: 14716
Liked: 1075 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Backup results

Veeam Logoby Cathy » Fri Aug 29, 2014 7:15 am

After we updated patch 4, filter by time could work. However, we found if we use JobName or JobUid to filter, we get success return with null list.
Cathy
Influencer
 
Posts: 16
Liked: never
Joined: Fri Jun 13, 2014 3:48 am
Full Name: Cathy Hu

Re: Backup results

Veeam Logoby v.Eremin » Sat Aug 30, 2014 10:00 am

You mean when you try to query backuptasksessions, using JobName or JobUID as filter, nothing is returned? Thanks.
v.Eremin
Veeam Software
 
Posts: 13255
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Next

Return to RESTful API



Who is online

Users browsing this forum: No registered users and 3 guests