RESTful knowledge exchange
Post Reply
Cragdoo
Veeam Vanguard
Posts: 513
Liked: 204 times
Joined: Sep 27, 2011 12:17 pm
Full Name: Craig Dalrymple
Location: Scotland
Contact:

API query format - date range

Post by Cragdoo » Aug 14, 2017 3:43 pm

Hello

being a relative newcomer to the world of APIs, I was wondering if I could manipulate API queries to say list all successful backups in the last 24 hours

I've been using

Code: Select all

http://ent-manager:9399/api/query?type=backupjobsession&format=entities
as a starter.

Some of the returned values are

Code: Select all

 <JobType>Backup</JobType>
                <CreationTimeUTC>2017-05-28T22:45:06.2Z</CreationTimeUTC>
                <EndTimeUTC>2017-05-29T02:08:09.593Z</EndTimeUTC>
                <State>Stopped</State>
                <Result>Success</Result>
                <Progress>100</Progress>
                <IsRetry>false</IsRetry>
So is it possible to filter the results, just using one API call, using the ?filter (https://helpcenter.veeam.com/docs/backu ... tml?ver=95) to show only those backup sessions that have successfully completed in the previous 24 hours

v.Eremin
Product Manager
Posts: 15967
Liked: 1284 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: API query format - date range

Post by v.Eremin » Aug 14, 2017 5:06 pm

Sure, you need to utilize filter parameter combined with logical and comparison operators.

Take the following as a rough example:

Code: Select all

?filter=result=="Success";entime<"some date"
Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests