Highlighted
Laurent_1
2 Bronze

NetWorker 9.1 REST API : Is there a way to filter (by date) the GET /backups output?

Hello,

Using the NetWorker rest API, I am able to retrieve the backups using the GET /backups method. However, it seems that the output will contain all the backups in the database.

I would like to be able to "filter by date", i.e. only get the backup since last time I made the call. So I would like to be able to filter, say, on the backup creation date being more recent than a certain date.

The REST API reference doesn't hint at any filtering capabilities. However, the REST API Getting Started guide clearly indicates that filtering exists. It gives a few examples to filter on fields ("Viewing only selected fields for all clients") or to filter on field values ("Searching for clients"). But the filter query feature doesn't seem to be specified.

Does anybody know how to filter on the backup creation date being before or after an arbitrary date?

Thanks,

Laurent.

0 Kudos
3 Replies
ble1
6 Indium

Re: NetWorker 9.1 REST API : Is there a way to filter (by date) the GET /backups output?

As I said in previous thread, didn't try it, but by looking quickly at docs, would something like GET /nwrestapi/v2/global/Backup?fl=clientHostname,name,level&q=creationTime:>=MM/DD/YYYY make sense?

0 Kudos
Laurent_1
2 Bronze

Re: NetWorker 9.1 REST API : Is there a way to filter (by date) the GET /backups output?

It makes sense of course and I tried it but it looks like queries only expect a ":"

Also, I could try many formats for specifying the date and miss the only one that would (possibly) be allowed so I am hoping someone at EMC would know how to do it and give an example.

0 Kudos

Re: NetWorker 9.1 REST API : Is there a way to filter (by da

Hi Laurent_1,

I was working with the NetWorker 9.2 REST-API today and figured out the following solution to the date filtering on the backups endpoint:

https://networker-server-hostname:9090/nwrestapi/v3/global/backups?q=saveTime:['2019-01-01T10:00:00' TO '2019-01-01T10:15:00']

Make sure not to forget the qoutes around the dates.

Best wishes
Stefan Schröder/Schmitz RZ Consult GmbH
BACKUP EAGLE Reporting for NetWorker/www.backup-eagle.com

0 Kudos