RemoteComputeAttachConfiguration 类

表示用于附加远程计算目标的配置参数。

使用 RemoteCompute 类的 attach_configuration 方法指定附加参数。

初始化配置对象。

继承
RemoteComputeAttachConfiguration

构造函数

RemoteComputeAttachConfiguration(username, subscription_id=None, resource_group=None, vm_name=None, resource_id=None, address=None, ssh_port=22, password='', private_key_file='', private_key_passphrase='')

参数

username
str
必需

访问资源所需的用户名。

subscription_id
str
默认值: None

虚拟机所在的 Azure 订阅 ID。

resource_group
str
默认值: None

虚拟机所在的资源组的名称。

vm_name
str
默认值: None

虚拟机名称。

resource_id
str
默认值: None

要附加的资源的 arm resource_id。

address
str
默认值: None

要附加的资源的地址。

ssh_port
int
默认值: 22

资源的已公开端口。 默认值为 22。

password
str
必需

访问资源所需的密码。

private_key_file
str
必需

包含资源私钥的文件的路径。

private_key_passphrase
str
必需

访问资源所需的私钥短语。

username
str
必需

访问资源所需的用户名。

subscription_id
str
必需

虚拟机所在的 Azure 订阅 ID。

resource_group
str
必需

虚拟机所在的资源组的名称。

vm_name
str
必需

虚拟机名称。

resource_id
str
必需

要附加的资源的 arm resource_id。

address
str
必需

要附加的资源的地址。

ssh_port
int
必需

资源的已公开端口。 默认值为 22。

password
str
必需

访问资源所需的密码。

private_key_file
str
必需

包含资源私钥的文件的路径。

private_key_passphrase
str
必需

访问资源所需的私钥短语。

方法

validate_configuration

检查指定的配置值是否有效。

如果验证失败,则会引发 ComputeTargetException

validate_configuration

检查指定的配置值是否有效。

如果验证失败,则会引发 ComputeTargetException

validate_configuration()

例外