你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

VirtualMachineRunCommandsOperations 类

警告

请勿直接实例化此类。

相反,应通过以下方式访问以下操作:

ComputeManagementClient's

<xref:virtual_machine_run_commands> 属性。

继承
builtins.object
VirtualMachineRunCommandsOperations

构造函数

VirtualMachineRunCommandsOperations(*args, **kwargs)

方法

begin_create_or_update

用于创建或更新 run 命令的操作。

begin_delete

用于删除 run 命令的操作。

begin_update

用于更新 run 命令的操作。

get

获取某个位置中订阅的特定运行命令。

get_by_virtual_machine

用于获取运行命令的操作。

list

列出某个位置中订阅的所有可用运行命令。

list_by_virtual_machine

用于获取虚拟机的所有运行命令的操作。

begin_create_or_update

用于创建或更新 run 命令的操作。

begin_create_or_update(resource_group_name: str, vm_name: str, run_command_name: str, run_command: _models.VirtualMachineRunCommand, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.VirtualMachineRunCommand]

参数

resource_group_name
str
必需

资源组的名称。 必需。

vm_name
str
必需

应在其中创建或更新运行命令的虚拟机的名称。 必需。

run_command_name
str
必需

虚拟机运行命令的名称。 必需。

run_command
VirtualMachineRunCommandIO
必需

提供给创建虚拟机 RunCommand 操作的参数。 是 VirtualMachineRunCommand 类型或 IO 类型。 必需。

content_type
str

Body 参数内容类型。 已知值为:“application/json”、“text/json”。 默认值为 None。

cls
callable

将传递直接响应的自定义类型或函数

continuation_token
str

用于从保存状态重启轮询的继续标记。

polling
boolPollingMethod

默认情况下,轮询方法将为 ARMPolling。 将此操作传入 False 以不进行轮询,或为个人轮询策略传入你自己的初始化轮询对象。

polling_interval
int

如果没有 Retry-After 标头,则 LRO 操作的两次轮询之间的默认等待时间。

返回

LROPoller 的实例,返回 VirtualMachineRunCommand 或 cls 的结果 (响应)

返回类型

例外

begin_delete

用于删除 run 命令的操作。

begin_delete(resource_group_name: str, vm_name: str, run_command_name: str, **kwargs: Any) -> LROPoller[None]

参数

resource_group_name
str
必需

资源组的名称。 必需。

vm_name
str
必需

应删除运行命令的虚拟机的名称。 必需。

run_command_name
str
必需

虚拟机运行命令的名称。 必需。

cls
callable

将传递直接响应的自定义类型或函数

continuation_token
str

用于从保存状态重启轮询的继续标记。

polling
boolPollingMethod

默认情况下,轮询方法将为 ARMPolling。 将此操作传入 False 以不进行轮询,或为个人轮询策略传入你自己的初始化轮询对象。

polling_interval
int

如果没有 Retry-After 标头,则 LRO 操作的两次轮询之间的默认等待时间。

返回

LROPoller 的实例,返回 None 或 cls 的结果 (响应)

返回类型

例外

begin_update

用于更新 run 命令的操作。

begin_update(resource_group_name: str, vm_name: str, run_command_name: str, run_command: _models.VirtualMachineRunCommandUpdate, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.VirtualMachineRunCommand]

参数

resource_group_name
str
必需

资源组的名称。 必需。

vm_name
str
必需

应在其中更新 run 命令的虚拟机的名称。 必需。

run_command_name
str
必需

虚拟机运行命令的名称。 必需。

run_command
VirtualMachineRunCommandUpdateIO
必需

提供给更新虚拟机 RunCommand 操作的参数。 是 VirtualMachineRunCommandUpdate 类型或 IO 类型。 必需。

content_type
str

Body 参数内容类型。 已知值为:“application/json”、“text/json”。 默认值为 None。

cls
callable

将传递直接响应的自定义类型或函数

continuation_token
str

用于从保存状态重启轮询的继续标记。

polling
boolPollingMethod

默认情况下,轮询方法将为 ARMPolling。 将此操作传入 False 以不进行轮询,或为个人轮询策略传入你自己的初始化轮询对象。

polling_interval
int

如果没有 Retry-After 标头,则 LRO 操作的两次轮询之间的默认等待时间。

返回

LROPoller 的实例,返回 VirtualMachineRunCommand 或 cls 的结果 (响应)

返回类型

例外

get

获取某个位置中订阅的特定运行命令。

get(location: str, command_id: str, **kwargs: Any) -> RunCommandDocument

参数

location
str
必需

查询运行命令的位置。 必需。

command_id
str
必需

命令 ID。必需。

cls
callable

将传递直接响应的自定义类型或函数

返回

RunCommandDocument 或 cls 的结果 (响应)

返回类型

例外

get_by_virtual_machine

用于获取运行命令的操作。

get_by_virtual_machine(resource_group_name: str, vm_name: str, run_command_name: str, *, expand: str | None = None, **kwargs: Any) -> VirtualMachineRunCommand

参数

resource_group_name
str
必需

资源组的名称。 必需。

vm_name
str
必需

包含 run 命令的虚拟机的名称。 必需。

run_command_name
str
必需

虚拟机运行命令的名称。 必需。

expand
str

要应用于操作的 expand 表达式。 默认值为 None。

cls
callable

将传递直接响应的自定义类型或函数

返回

VirtualMachineRunCommand 或 cls 的结果 (响应)

返回类型

例外

list

列出某个位置中订阅的所有可用运行命令。

list(location: str, **kwargs: Any) -> Iterable[RunCommandDocumentBase]

参数

location
str
必需

查询运行命令的位置。 必需。

cls
callable

将传递直接响应的自定义类型或函数

返回

迭代器,如 RunCommandDocumentBase 的实例或 cls 的结果 (响应)

返回类型

例外

list_by_virtual_machine

用于获取虚拟机的所有运行命令的操作。

list_by_virtual_machine(resource_group_name: str, vm_name: str, *, expand: str | None = None, **kwargs: Any) -> Iterable[VirtualMachineRunCommand]

参数

resource_group_name
str
必需

资源组的名称。 必需。

vm_name
str
必需

包含 run 命令的虚拟机的名称。 必需。

expand
str

要应用于操作的 expand 表达式。 默认值为 None。

cls
callable

将传递直接响应的自定义类型或函数

返回

迭代器,如 VirtualMachineRunCommand 的实例或 cls 的结果 (响应)

返回类型

例外

属性

models

models = <module 'azure.mgmt.compute.v2020_06_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.7\\x64\\Lib\\site-packages\\azure\\mgmt\\compute\\v2020_06_01\\models\\__init__.py'>