REST API knowledge exchange
Post Reply
Cragdoo
Veeam Vanguard
Posts: 629
Liked: 251 times
Joined: Sep 27, 2011 12:17 pm
Full Name: Craig Dalrymple
Location: Scotland
Contact:

API query format - date range

Post by Cragdoo »

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
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: API query format - date range

Post by veremin »

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 1 guest