-
- Influencer
- Posts: 11
- Liked: never
- Joined: Aug 27, 2013 11:37 am
- Contact:
Backup results
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
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
-
- Veeam Software
- Posts: 649
- Liked: 171 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: Backup results
You can use /querySvc to search sessions with certain parameters.
More details about query syntax can be found here.
More details about query syntax can be found here.
-
- Influencer
- Posts: 11
- Liked: never
- Joined: Aug 27, 2013 11:37 am
- Contact:
Re: Backup results
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 ?
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 ?
-
- Veeam Software
- Posts: 649
- Liked: 171 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: Backup results
Yes, you can do it. Just make a filter like: filter=(Result=="Success")
-
- Influencer
- Posts: 11
- Liked: never
- Joined: Aug 27, 2013 11:37 am
- Contact:
Re: Backup results
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"
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"
-
- Veeam Software
- Posts: 649
- Liked: 171 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: Backup results
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?
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?
-
- Influencer
- Posts: 11
- Liked: never
- Joined: Aug 27, 2013 11:37 am
- Contact:
Re: Backup results
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.
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.
-
- Veeam Software
- Posts: 649
- Liked: 171 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: Backup results
I am sorry for inattention! What you've found is definitely a bug, we will fix it in one of upcoming releases.
-
- Influencer
- Posts: 11
- Liked: never
- Joined: Aug 27, 2013 11:37 am
- Contact:
Re: Backup results
No problem.
Thanks for your help.
Thanks for your help.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
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.
I reviewed release notes of each patches but can't find it.
-
- Veeam Software
- Posts: 21165
- Liked: 2148 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: Backup results
Cathy, this was supposed to be fixed in Patch 3, probably just was not included in the list of fixes.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
We updated patch 4 and it worked well. Thanks.
-
- Veeam Software
- Posts: 21165
- Liked: 2148 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: Backup results
Thanks for confirming, much appreciated.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
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.
-
- Product Manager
- Posts: 20673
- Liked: 2378 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup results
You mean when you try to query backuptasksessions, using JobName or JobUID as filter, nothing is returned? Thanks.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
Yes!
We use query?type=BackupTaskSession&format=entities&filter=(JobName==myTest) and get 200 OK with null list.
However, we change to use powershell Get-VBRBackupSession -Name "myTest" could get correct return.
We use query?type=BackupTaskSession&format=entities&filter=(JobName==myTest) and get 200 OK with null list.
However, we change to use powershell Get-VBRBackupSession -Name "myTest" could get correct return.
-
- Product Manager
- Posts: 20673
- Liked: 2378 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup results
In fact, Backup session and Backup Task session are two different entities. If you want to get Backup sessions, you have to query "/BackupSessions" resource, not "/BackupTaskSessions" one. Thanks.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
Yes, we know "The /backupTaskSession resource provides information about a specific task within a backup job session." Backup session and Backup Task session are different.
However, we only use powershell to prove there is a backup job there with JobName=myTest.
powershell:: Get-VBRBackupSession –Name “myTest”|Get-VBRTaskSession did return correct data.
However, we only use powershell to prove there is a backup job there with JobName=myTest.
powershell:: Get-VBRBackupSession –Name “myTest”|Get-VBRTaskSession did return correct data.
-
- Product Manager
- Posts: 20673
- Liked: 2378 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup results
My point was that BackupTaskSession doesn't seem to support JobName or JodUID as querying parameters. And if you want to use them, you should query the higher entity - BackupJobSession. Thanks.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
http://helpcenter.veeam.com/backup/70/r ... ns_id.html
I think (GET)/backupTaskSessions/ should support JobName or JobUid as querying parameters. Or it would not return 200OK.
We want to get VM's restore point and its backup result(for each restore point) in a specific backup JOB. That is why we need to use JobName or JobUid as querying parameter.
I think (GET)/backupTaskSessions/ should support JobName or JobUid as querying parameters. Or it would not return 200OK.
We want to get VM's restore point and its backup result(for each restore point) in a specific backup JOB. That is why we need to use JobName or JobUid as querying parameter.
-
- Product Manager
- Posts: 20673
- Liked: 2378 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup results
After having investigated this behavior further, it was confirmed that backupTaskSession entity should accept JobName and JobUID as querying parameters (thus, the documentation). However, currently it doesn't work that way. So, we tracked that as a bug. Chances are, it will be fixed in the upcoming release. Thanks.
-
- Influencer
- Posts: 16
- Liked: never
- Joined: Jun 13, 2014 3:48 am
- Full Name: Cathy Hu
- Contact:
Re: Backup results
One more thing about query:
We would get 400 error from query?type=restoreSession&format=Entities&sortAsc=name&filter=(VmDisplayName=="vse-in1 (13638542-3fcd-4ebf-a75d-ccf502970f6b)-0"),(VmDisplayName=="vse-in2 (3c07ee1c-66de-4a6f-b086-c68ca215d117)-0"),(VmDisplayName=="win2008-sch (9abc15fc-2a98-463b-a9e4-889e71fbc21d)")
However, it would return 200 OK if we only set 2 VMDisplayName. ex: query?type=restoreSession&format=Entities&sortAsc=name&filter=(VmDisplayName=="vse-in1 (13638542-3fcd-4ebf-a75d-ccf502970f6b)-0"),(VmDisplayName=="vse-in2 (3c07ee1c-66de-4a6f-b086-c68ca215d117)-0")
Just want to make sure we could only set 2 VMDisplayname filter. (Can't set 3 or more VMDisplayname filter.) Or maybe our restful API strings are too long.
We would get 400 error from query?type=restoreSession&format=Entities&sortAsc=name&filter=(VmDisplayName=="vse-in1 (13638542-3fcd-4ebf-a75d-ccf502970f6b)-0"),(VmDisplayName=="vse-in2 (3c07ee1c-66de-4a6f-b086-c68ca215d117)-0"),(VmDisplayName=="win2008-sch (9abc15fc-2a98-463b-a9e4-889e71fbc21d)")
However, it would return 200 OK if we only set 2 VMDisplayName. ex: query?type=restoreSession&format=Entities&sortAsc=name&filter=(VmDisplayName=="vse-in1 (13638542-3fcd-4ebf-a75d-ccf502970f6b)-0"),(VmDisplayName=="vse-in2 (3c07ee1c-66de-4a6f-b086-c68ca215d117)-0")
Just want to make sure we could only set 2 VMDisplayname filter. (Can't set 3 or more VMDisplayname filter.) Or maybe our restful API strings are too long.
-
- Product Manager
- Posts: 20673
- Liked: 2378 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Backup results
I wasn't able to confirm that. I've just query /restoresssions, using three different VM names as a filter, and everything's worked as expected.
Thanks.
Code: Select all
query?type=RestoreSession&format=Entities&sortAsc=name&filter=(VMDisplayName=="First VM"), (VMDisplayName=="Second VM"), (VMDisplayName=="Third VM")
Who is online
Users browsing this forum: No registered users and 16 guests