REST API knowledge exchange
Post Reply
lorenzo95
Lurker
Posts: 2
Liked: 1 time
Joined: Feb 06, 2018 6:22 pm
Full Name: Gera
Contact:

Retrieve RestorePoint by VM

Post by lorenzo95 »

Hello,

I am trying to integrate veeam with my monitoring system to centralize alerting (restore-point age). I am graphing the hours since the last successful restore-point creation. This works great compared to the power-shell module but I noticed it only works on "indexed" vms. This is due to me using the catalog of course. I tried to keep it simple since I search per vm name which is also the hostname. I am trying to avoid having to enumerate the jobs every-time to get the id and then try to find the vm and the disk.

After authenticating i just call this uri.
I just pull out the last date from the response, calculate the timespan and all is good...usually ;)
Does anyone know of an easy way to get the last restore-point of a non-indexed vm that is not in the catalog?


Thank you.
veremin
Product Manager
Posts: 20389
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retrieve RestorePoint by VM

Post by veremin » 1 person likes this post

Query /vmrestorepoints/, using vmdisplayname and creationtime as filters?
lorenzo95
Lurker
Posts: 2
Liked: 1 time
Joined: Feb 06, 2018 6:22 pm
Full Name: Gera
Contact:

Re: Retrieve RestorePoint by VM

Post by lorenzo95 » 1 person likes this post

Ah, yes. Good thing I asked. That did the trick. :D

I completely missed those options in the documentation until now. Here is the working uri:

Code: Select all

$uri="http://server:9399/api/query?type=VmRestorePoint&filter=VmDisplayName==$hostname&sortDesc=CreationTime&format=entities"
And parse out the last restore point date with:

Code: Select all

([datetime]([xml]$response.Content).QueryResult.Entities.VmRestorePoints.VmRestorePoint.CreationTimeUTC[0]).ToLocalTime()
Thank you for pointing me in the right direction
Much appreciated.
veremin
Product Manager
Posts: 20389
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Retrieve RestorePoint by VM

Post by veremin »

You're welcome. Should you encounter other issues, don't hesitate reaching us. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests