Python cli available?

Latest response

Hello,

with version 2.2 I was able to create some useful scripts with powershell.

An example was to provision more dekstops in a pool when the available number decreased under a certain value...

Now with rhev 3.0 I read about powershell substituted by a Python based cli, but I don't find any docs about it.

Is this available or not yet in 3.0? When will it be in case, also in preview?

Just beginning to read Rest API but it seems more complicated ... just my opinion

 

Thanks,

Gianluca

Responses

RHEV 3.1 will include an ovirt shell CLI.

But in the mean time have a look at the upstream project - it will work with RHEV.

 

http://www.ovirt.org/wiki/CLI

Thanks Andrew.

Sorry for late coming back to this.. but I had some problems connecting to groups these days..

 

So I downloaded nightly builds for ovirt-engine-sdk and ovirt-engine-cli for my F16 and their dependencies in Fedora repo:

Mar 16 10:52:21 Installed: python-devel-2.7.2-5.2.fc16.x86_64
Mar 16 10:52:22 Installed: python-setuptools-0.6.24-1.fc16.noarch
Mar 16 11:02:30 Installed: python-lxml-2.3-1.fc16.x86_64
Mar 16 11:02:30 Installed: ovirt-engine-sdk-1.6.1-1.fc16.noarch
Mar 16 11:02:30 Installed: pexpect-2.3-6.fc15.noarch
Mar 16 11:02:30 Installed: python-ply-3.3-5.fc15.noarch
Mar 16 11:02:30 Installed: ovirt-engine-cli-2.1.2-1.fc16.noarch
 

But at the moment the cli fails to start...

$ ovirt-shell --help
Traceback (most recent call last):
  File "/usr/bin/ovirt-shell", line 9, in <module>
    load_entry_point('ovirt-shell==2.1.2-SNAPSHOT', 'console_scripts', 'ovirt-shell')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2279, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/ovirtcli/main.py", line 20, in <module>
    from ovirtcli.context import OvirtCliExecutionContext
  File "/usr/lib/python2.7/site-packages/ovirtcli/context.py", line 18, in <module>
    from cli.command import *
  File "/usr/lib/python2.7/site-packages/cli/command/__init__.py", line 2, in <module>
    from cli.command.command import Command
  File "/usr/lib/python2.7/site-packages/cli/command/command.py", line 21, in <module>
    from ovirtcli.utils.methodhelper import MethodHelper
  File "/usr/lib/python2.7/site-packages/ovirtcli/utils/methodhelper.py", line 20, in <module>
    from codegen.doc.documentation import Documentation
ImportError: No module named codegen.doc.documentation
 

I have to check eventally upstream what else I'm missing...

In the mean time if you have any hints... they are welcome ;-)

Just for the note:

It seems it works with the rpms packaged as in

http://lists.ovirt.org/pipermail/users/2012-March/001176.html

ovirt-engine-cli-2.1.3-1.fc16.


noarch.rpm
ovirt-engine-sdk-1.6.2-1.fc16.noarch.rpm

at least with the basic run of
$ ovirt-shell --help
and
$ ovirt-shell

 ++++++++++++++++++++++++++++++++++++++++++

         Welcome to oVirt shell

 ++++++++++++++++++++++++++++++++++++++++++

[oVirt shell (disconnected)]# exit

I'm going to test further with connection to RHEV infra.