Issue in vmpool.showback method in XML-RPC integration API (opennebula 5.0.2)?

Code:
def getshowback(a,b,c,d):
response = getProxy().one.vmpool.showback(one_auth,a,b,c,d)
if response[0]:
return response[1]
else:
raise Exception(response[1])

data = getshowback(-1,-1,-1,-1)
print data

Error:
Traceback (most recent call last):
File “showback_pool.py”, line 18, in
data = getshowback(-1,-1,-1,-1)
File “showback_pool.py”, line 12, in getshowback
response = getProxy().one.vmpool.showback(one_auth,a,b,c,d)
File “/usr/lib/python2.7/xmlrpclib.py”, line 1233, in call
return self.__send(self.__name, args)
File “/usr/lib/python2.7/xmlrpclib.py”, line 1587, in __request
verbose=self.__verbose
File “/usr/lib/python2.7/xmlrpclib.py”, line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File “/usr/lib/python2.7/xmlrpclib.py”, line 1306, in single_request
return self.parse_response(response)
File “/usr/lib/python2.7/xmlrpclib.py”, line 1482, in parse_response
return u.close()
File “/usr/lib/python2.7/xmlrpclib.py”, line 794, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -501: ‘Not enough parameters’>

Even though the parameter and method is correct still it shows not enough parameter. What is this error? and why?

Hi!,
I think documentation for that method is not accurate.

Though five parameters are inputs as you’re using, you should use six parameters. I’ve visited the code and the missing parameter would be the filter flag which it’s an integer like the one used in the one.vmpool.accounting:

Filter flag - < = -3: Connected user’s resources - -2: All resources - -1: Connected user’s and his group’s resources - > = 0: UID User’s Resources.

This is my test with 6 parameters:

So change getshowback(a,b,c,d) to getshowback(a,b,c,d,e) where a is the new parameter for filtering.

Cheers!

what tool are using to test the response status?

Hi!
in my example I’m using a Chrome extension called XML-RPC-Client for https://chrome.google.com/webstore/detail/xml-rpc-client/mbelaappiaalhoceejaopcghdlnhhain

Have a look at this recent post: https://forum.opennebula.io/t/postman-or-similar-application-for-opennebula-api/3201/9 where we’re discussing tools for xml rpc.

Cheers!

Thanks :slight_smile:

1 Like