airflow.providers.microsoft.winrm.operators.winrm

Module Contents

Classes

WinRMOperator

WinRMOperator to execute commands on given remote host using the winrm_hook.

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', timeout=10, **kwargs)[source]

Bases: airflow.models.BaseOperator

WinRMOperator to execute commands on given remote host using the winrm_hook.

Parameters
  • winrm_hook (Optional[airflow.providers.microsoft.winrm.hooks.winrm.WinRMHook]) – predefined ssh_hook to use for remote execution

  • ssh_conn_id (Optional[str]) – connection id from airflow Connections

  • remote_host (Optional[str]) – remote host to connect

  • command (Optional[str]) – command to execute on remote host. (templated)

  • ps_path (Optional[str]) – 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

  • timeout (int) – timeout for executing the command.

template_fields :Sequence[str] = ['command'][source]
template_fields_renderers[source]
execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?