搜索

6.268.3. remoteviewerconnectionfile POST

download PDF

生成与 remote-viewer 客户端兼容的 文件。

使用以下请求为图形控制台生成远程查看器连接文件:请注意,只有在虚拟机正在运行时,此操作才会生成 文件。

POST /ovirt-engine/api/vms/123/graphicsconsoles/456/remoteviewerconnectionfile

remoteviewerconnectionfile 操作不执行任何特定于操作的参数,因此请求正文应包含空 操作

<action/>

响应中包含 文件,可用于 remote-viewer 客户端。

<action>
  <remote_viewer_connection_file>
    [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=...
  </remote_viewer_connection_file>
</action>

例如,要获取远程查看器连接文件的内容并将其保存到临时文件中,用户可以按如下方式使用 oVirt Python SDK:

# 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)

当您创建远程 viewer 连接文件时,您可以连接到虚拟机图形控制台,如下所示:

#!/bin/sh -ex

remote-viewer --ovirt-ca-file=/etc/pki/ovirt-engine/ca.pem /tmp/remote_viewer_connection_file.vv
表 6.837. 参数摘要
名称类型方向概述

remote_viewer_connection_file

字符串

out

包含与 remote-viewer 客户端兼容的 文件。

6.268.3.1. remote_viewer_connection_file

包含与 remote-viewer 客户端兼容的 文件。

用户可以使用此属性的内容创建 文件,该文件可以传递到 remote-viewer 客户端以连接到虚拟机图形控制台。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.