airflow.contrib.operators.winrm_operator

Module Contents

class airflow.contrib.operators.winrm_operator.WinRMOperator(winrm_hook=None, ssh_conn_id=None, remote_host=None, command=None, timeout=10, do_xcom_push=False, *args, **kwargs)[source]

Bases: airflow.models.BaseOperator

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

Parameters
  • winrm_hook (airflow.contrib.hooks.winrm_hook.WinRMHook) – predefined ssh_hook to use for remote execution

  • ssh_conn_id (str) – connection id from airflow Connections

  • remote_host (str) – remote host to connect

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

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

  • do_xcom_push (bool) – return the stdout which also get set in xcom by airflow platform

template_fields = ['command'][source]
execute(self, context)[source]