Interface VmGraphicsConsoleService.RemoteViewerConnectionFileRequest

  • All Superinterfaces:
    Request<VmGraphicsConsoleService.RemoteViewerConnectionFileRequest,​VmGraphicsConsoleService.RemoteViewerConnectionFileResponse>
    Enclosing interface:
    VmGraphicsConsoleService

    public static interface VmGraphicsConsoleService.RemoteViewerConnectionFileRequest
    extends Request<VmGraphicsConsoleService.RemoteViewerConnectionFileRequest,​VmGraphicsConsoleService.RemoteViewerConnectionFileResponse>
    Generates the file which is compatible with `remote-viewer` client. Use the following request to generate remote viewer connection file of the graphics console. Note that this action generates the file only if virtual machine is running. [source] ---- POST /ovirt-engine/api/vms/123/graphicsconsoles/456/remoteviewerconnectionfile ---- The `remoteviewerconnectionfile` action does not take any action specific parameters, so the request body should contain an empty `action`: [source,xml] ---- ---- The response contains the file, which can be used with `remote-viewer` client. [source,xml] ---- [virt-viewer] type=spice host=192.168.1.101 port=-1 password=123456789 delete-this-file=1 fullscreen=0 toggle-fullscreen=shift+f11 release-cursor=shift+f12 secure-attention=ctrl+alt+end tls-port=5900 enable-smartcard=0 enable-usb-autoshare=0 usb-filter=null tls-ciphers=DEFAULT host-subject=O=local,CN=example.com ca=... ---- E.g., to fetch the content of remote viewer connection file and save it into temporary file, user can use oVirt Python SDK as follows: [source,python] ---- # Find the virtual machine: vm = vms_service.list(search='name=myvm')[0] # Locate the service that manages the virtual machine, as that is where # the locators are defined: vm_service = vms_service.vm_service(vm.id) # Find the graphic console of the virtual machine: graphics_consoles_service = vm_service.graphics_consoles_service() graphics_console = graphics_consoles_service.list()[0] # Generate the remote viewer connection file: console_service = graphics_consoles_service.console_service(graphics_console.id) remote_viewer_connection_file = console_service.remote_viewer_connection_file() # Write the content to file "/tmp/remote_viewer_connection_file.vv" path = "/tmp/remote_viewer_connection_file.vv" with open(path, "w") as f: f.write(remote_viewer_connection_file) ---- When you create the remote viewer connection file, then you can connect to virtual machine graphic console, as follows: [source,bash] ---- #!/bin/sh -ex remote-viewer --ovirt-ca-file=/etc/pki/ovirt-engine/ca.pem /tmp/remote_viewer_connection_file.vv ----