RESTful knowledge exchange
Post Reply
lbonjean
Novice
Posts: 4
Liked: never
Joined: Jul 22, 2016 8:01 am
Full Name: Luc Bonjean
Contact:

enumerate restore points per vm

Post by lbonjean »

Hi,

I'm trying to enumerate all restore points for a given vm.
First I want to do a query for all vm's. the hierarchyref is a required for this query to work.

Code: Select all

http://10.224.3.36:9399/api/hierarchyRoots
This is one of the results:

Code: Select all

{'Href': 'http://10.224.3.36:9399/api/hierarchyRoots/bcbe8d35-fca9-440d-a55d-e1480e8a2de4', 'Type': 'HierarchyRootReference', 'UID': 'urn:veeam:HierarchyRoot:bcbe8d35-fca9-440d-a55d-e1480e8a2de4', 'Name': 'Q01VCE002.q.lan'}
Now I try to find all vm's for this vcenter:

Code: Select all

http://10.224.3.36:9399/api/lookup?type=vm&hierarchyRef=urn:veeam:HierarchyRoot:bcbe8d35-fca9-440d-a55d-e1480e8a2de4
or

Code: Select all

http://10.224.3.36:9399/api/lookup?type=vm&hierarchyRef=bcbe8d35-fca9-440d-a55d-e1480e8a2de4
Both of them return an error 500 (also if I enclose the hierarchyref in quotes)

Code: Select all

Message="Invalid hierarchy object reference "urn:veeam:HierarchyRoot:bcbe8d35-fca9-440d-a55d-e1480e8a2de4""
Does anyone have a suggestion to correct this?
Is the hierarchyref that I use correct?

Thanks in advance,

Luc
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: enumerate restore points per vm

Post by veremin » 1 person likes this post

A restore points of VM having particular ref can be found in the following manner:

Code: Select all

query?type=VmRestorePoint&format=Entities&filter=HierarchyObjRef==%22"Objectref of given VM"%22
Thanks.
lbonjean
Novice
Posts: 4
Liked: never
Joined: Jul 22, 2016 8:01 am
Full Name: Luc Bonjean
Contact:

Re: enumerate restore points per vm

Post by lbonjean »

This was a good solution, it now works.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: enumerate restore points per vm

Post by veremin »

You're welcome. Feel free to reach us, should any additional questions arise. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests