本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
获得命令的帮助
使用 Amazon DCV Session Manager CLI 时,您可以获得任何命令的帮助。为此,只需在命令名称末尾键入 --help
。
例如,以下命令显示常规 DCV SM CLI 选项和可用顶级命令的帮助。
dcvsm --help
以下示例显示 CLI 帮助输出。
Usage: dcvsm [OPTIONS] COMMAND [ARGS]... Amazon DCV Session Manager CLI Options: --conf TEXT Name of the configuration file to read the configuration parameters --broker-url TEXT The URL of the broker --debug Specify to enable the debug mode. By default is disabled --no-verify-ssl Specify to disable the verification of SSL certification. By default is enabled --output-format TEXT Specify the format of the output --ca-bundle TEXT Specifies the path to a custom certificate bundle (a file with a .pem extension) of CA to use when establishing SSL/TLS connections --auth-server TEXT URL of the authentication server used to request the token --version Show the version and exit. -h, --help Show this message and exit. Commands: close-servers Closes one or more Amazon DCV server create-session Creates a new Amazon DCV session delete-session Deletes the specified Amazon DCV session describe-servers Describes one or more Amazon DCV servers describe-sessions Describes one or more Amazon DCV sessions get-session-connection-data Gets connection data for a specific Amazon DCV session. get-session-screenshots Gets screenshots of one or more Amazon DCV sessions. open-servers Opens one or more Amazon DCV servers update-session-permissions Updates the user permissions for a specific Amazon DCV session.
所有命令都接受 --help 以获取上下文帮助信息。例如,以下命令显示 create-session 命令的帮助。
dcvsm create-session --help
以下示例显示 create-session --help
命令的输出。
Usage: dcvsm create-session [OPTIONS] Create sessions API Options: --name TEXT The name for the session [required] --owner TEXT The name of the session owner [required] --type TEXT Session type: CONSOLE|VIRTUAL [required] --init-file-path TEXT Supported with virtual sessions on Linux Amazon DCV servers --autorun-file TEXT The path to a file on the host server that is to be run inside the session --autorun-file-arguments TEXT Command-line arguments passed to AutorunFile upon its execution inside the session --max-concurrent-clients INTEGER RANGE The maximum number of concurrent Amazon DCV clients, if provided must be between 1 and 100 [1<=x<=100] --dcv-gl-enabled Indicates whether the virtual session is configured to use hardware-based OpenGL. Specify to enable it, by default is disabled --permissions-file TEXT The Base64-encoded contents of the permissions file --requirements TEXT The requirements that the server must satisfy in order to place the session --storage-root TEXT Specifies the path to the folder used for session storage -h, --help Show this message and exit.
Amazon DCV SM CLI 命令参考还包含所有 Amazon DCV SM CLI 命令的帮助内容。Amazon DCV SM CLI 中的所有命令都对应于向经纪商 APIs 发出的请求。每个 API 具有一个 API 参考,可以在《Amazon DCV Session Manager 开发人员指南》的相应小节中找到该参考。
参数类型
如果在设置特定命令的选项或参数的格式时遇到问题,请参阅每个命令的帮助以了解其功能和可接受的选项。
字符串
字符串参数可以包含字母、数字和空格。包含空格的字符串必须用引号引起来。可以将字符串用单引号和双引号引起来,也可以不加引号。我们建议您不要使用符号,因为它可能会导致意外结果。
列表
一个或多个以逗号分隔并用引号引起来的字符串。以下示例显示了一个 --session-ids
列表。
dcvsm describe-sessions --session-ids "session123,session456"
布尔值
打开或关闭某一选项的二进制标志。例如,--debug describe-sessions 具有一个布尔值 --debug 选项,如果指定,该选项将调用 API 以启用调试。
dcvsm --debug describe-sessions
如果您没有明确指定布尔值选项,则默认将其设置为 FALSE。
整数
无符号整数。
dcvsm describe-sessions --max-results 2