[ovirt-users] Getting SPICE connection parameters with Python-SDK

Fabrice Bacchella fabrice.bacchella at orange.fr
Mon Jun 6 04:49:10 EDT 2016


Le 5 juin 2016 à 13:22, Michal Skrivanek <michal.skrivanek at redhat.com> a écrit :


On 05 Jun 2016, at 12:37, nicolas at devels.es wrote:

Hi,

On user portal, when users click on the "Connect" link of a VM that is configured to be run with "Native client" and SPICE protocol, a .vv file is generated with the connection parameters so the SPICE client knows where to connect: host, port, password, ...

Currently, is there a way to generate those parameters with the Python SDK? Especially the session password so it's possible to connect to the VM directly with a SPICE client.

Yes, you can either get either only the password/ticket or the whole vv file, which was introduced by https://bugzilla.redhat.com/show_bug.cgi?id=1128763

But this call is missing from the python SDK 3.6.5.2.

In the example, I see :
curl -k -u admin at internal:1 ... -H "Accept: application/x-virt-viewer"

But in ovirtsdk/infrastructure/connectionspool.py, line 106, I see:

    header_lines.append("Accept: application/xml")

The Accept parameter is hard coded, the python SDK doesn't not allow to get the vv file, because that's the only settings that make a difference betwen getting the object and getting the vv file, as it's indicated in the rsdl :

<link href="/api/vms/{vm:id}/graphicsconsoles/{graphicsconsole:id}" rel="get">
    <description>Get active graphics console of a VM.</description>
    <request>
        <http_method>GET</http_method>
        <headers>
            <header required="false">
                <name>Content-Type</name>
                <value>application/xml|json|x-virt-viewer</value>
            </header>
        </headers>
        <url>
            <parameters_set>
                <parameter required="false" type="xs:boolean" context="matrix">
                    <name>current</name>
                    <value>true|false</value>
                </parameter>
            </parameters_set>
        </url>
        <body/>
    </request>
    <response>
        <type>GraphicsConsole</type>
    </response>
</link>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160606/ed86fa50/attachment.html>


More information about the Users mailing list