airflow.providers.microsoft.winrm.operators.winrm¶
Classes¶
WinRMOperator to execute commands on given remote host using the winrm_hook. |
Module Contents¶
- class airflow.providers.microsoft.winrm.operators.winrm.WinRMOperator(*, winrm_hook=None, ssh_conn_id=None, remote_host=None, command=None, ps_path=None, output_encoding='utf-8', max_output_chunks=100, timeout=None, poll_interval=None, expected_return_code=0, working_directory=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseOperatorWinRMOperator to execute commands on given remote host using the winrm_hook.
- Parameters:
winrm_hook (airflow.providers.microsoft.winrm.hooks.winrm.WinRMHook | None) – predefined ssh_hook to use for remote execution
ssh_conn_id (str | None) – connection id from airflow Connections
remote_host (str | None) – remote host to connect
command (str | None) – command to execute on remote host. (templated)
ps_path (str | None) – path to powershell, powershell for v5.1- and pwsh for v6+. If specified, it will execute the command as powershell script.
output_encoding (str) – the encoding used to decode stout and stderr
max_output_chunks (int) – Maximum number of stdout/stderr chunks to keep in a rolling buffer to prevent excessive memory usage for long-running commands in deferrable mode, defaults to 100.
timeout (int | datetime.timedelta | None) – timeout for executing the command, defaults to 10.
poll_interval (int | datetime.timedelta | None) – How often, in seconds, the trigger should poll the output command of the launched command, defaults to 1.
expected_return_code (int | list[int] | range) – expected return code value(s) of command.
working_directory (str | None) – specify working directory.
deferrable (bool) – Run operator in the deferrable mode
- template_fields: collections.abc.Sequence[str] = ('command', 'working_directory')[source]¶