ekalkst
(E K)
April 4, 2021, 8:15pm
1
Hi after lots of trial and error ive been able to get a working xmlrpc call, however the method im using one.vm.info takes a param of int for the vm id. Is there a way to make a call to grab vm info by the vm name? I know you can do this in the cli with onevm show [vm name]
I guess second part to the question, is there a way to see the cli command converted into the xmlrpc call?
ekalkst
(E K)
April 5, 2021, 1:51am
2
Found a way to do it if anyone ends up where I am. I’m using powershell for my example. The method is one.vmpool.info
$vc_body= "<?xml version='1.0'?><methodCall><methodName>one.vmpool.info</methodName><params><param><value>username:password</value></param><param><value><int>-2</int></value></param><param><value><int>-1</int></value></param><param><value><int>-1</int></value></param><param><value><int>-1</int></value></param><param><value>$env:COMPUTERNAME</value></param></params></methodCall>"
[xml]$vcvm= (Invoke-RestMethod -Uri "http://URL:2633/RPC2" -Method post -Body $vc_body|Select-Object *).outerxml.Replace( "<","<").Replace( ">",">")
Using the computer variable as the machine is calling in question is calling the api.
Not sure if it’s my issue but the response from the xmlrpc call was using </gt; for < > so i had to do a replace in the seconds line
feldsam
(Kristian Feldsam)
April 5, 2021, 8:20am
3
Hello, I think that you can use vm.pool.info or vm.pool.infoextended method and specify last “filter” argument
https://docs.opennebula.io/5.12/integration/system_interfaces/api.html#one-vmpool-infoextended