blob: ebc211baa27ee03a1ce86edbf1ea7530ed451fcc [file] [log] [blame]
:py:mod:`airflow.providers.microsoft.psrp.operators.psrp`
=========================================================
.. py:module:: airflow.providers.microsoft.psrp.operators.psrp
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.microsoft.psrp.operators.psrp.PsrpOperator
Functions
~~~~~~~~~
.. autoapisummary::
airflow.providers.microsoft.psrp.operators.psrp.exactly_one
.. py:function:: exactly_one(*args)
.. py:class:: PsrpOperator(*, psrp_conn_id, command = None, powershell = None, cmdlet = None, parameters = None, logging_level = DEBUG, runspace_options = None, wsman_options = None, psrp_session_init = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
PowerShell Remoting Protocol operator.
Use one of the 'command', 'cmdlet', or 'powershell' arguments.
The 'securestring' template filter can be used to tag a value for
serialization into a `System.Security.SecureString` (applicable only
for DAGs which have `render_template_as_native_obj=True`).
When using the `cmdlet` or `powershell` arguments and when `do_xcom_push`
is enabled, the command output is converted to JSON by PowerShell using
the `ConvertTo-Json
<https://docs.microsoft.com/en-us/powershell/
module/microsoft.powershell.utility/convertto-json>`__ cmdlet such
that the operator return value is serializable to an XCom value.
:param psrp_conn_id: connection id
:param command: command to execute on remote host. (templated)
:param powershell: powershell to execute on remote host. (templated)
:param cmdlet:
cmdlet to execute on remote host (templated). Also used as the default
value for `task_id`.
:param parameters:
When using the `cmdlet` or `powershell` arguments, use this parameter to
provide parameters (templated). Note that a parameter with a value of `None`
becomes an *argument* (i.e., switch).
:param logging_level:
Logging level for message streams which are received during remote execution.
The default is to include all messages in the task log.
:param runspace_options:
optional dictionary which is passed when creating the runspace pool. See
:py:class:`~pypsrp.powershell.RunspacePool` for a description of the
available options.
:param wsman_options:
optional dictionary which is passed when creating the `WSMan` client. See
:py:class:`~pypsrp.wsman.WSMan` for a description of the available options.
:param psrp_session_init:
Optional command which will be added to the pipeline when a new PowerShell
session has been established, prior to invoking the action specified using
the `cmdlet`, `command`, or `powershell` parameters.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['cmdlet', 'command', 'parameters', 'powershell']
.. py:attribute:: template_fields_renderers
.. py:attribute:: ui_color
:annotation: = #c2e2ff
.. py:method:: execute(self, context)
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.
.. py:method:: get_template_env(self)
Fetch a Jinja template environment from the DAG or instantiate empty environment if no DAG.