Skip to content

Commit a8c4750

Browse files
committed
Add version function to oca.client
The function calls the one.system.version XML-RPC method and returns the OpenNebula version of the connected server. Can be used to check if the client can connect properly (user/pass and url correct)
1 parent 7f912be commit a8c4750

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

oca/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ def call(self, function, *args):
120120
raise OpenNebulaException(data)
121121
return data
122122

123+
def version(self):
124+
'''
125+
Get the version of the connected OpenNebula server.
126+
'''
127+
return self.call('system.version')
128+
123129
__all__ = [Client, OpenNebulaException, Host, HostPool, VirtualMachine,
124130
VirtualMachinePool, User, UserPool,
125131
Image, ImagePool, VirtualNetwork, VirtualNetworkPool,

0 commit comments

Comments
 (0)