airflow.providers.microsoft.psrp.hooks.psrp¶
Attributes¶
Classes¶
Hook for PowerShell Remoting Protocol execution. |
Module Contents¶
- class airflow.providers.microsoft.psrp.hooks.psrp.PsrpHook(psrp_conn_id, logging_level=DEBUG, operation_timeout=None, runspace_options=None, wsman_options=None, on_output_callback=None, exchange_keys=True, host=None)[source]¶
Bases:
airflow.hooks.base.BaseHook
Hook for PowerShell Remoting Protocol execution.
When used as a context manager, the runspace pool is reused between shell sessions.
- Parameters:
psrp_conn_id (str) – Required. The name of the PSRP connection.
logging_level (int) – Logging level for message streams which are received during remote execution. The default is to include all messages in the task log.
operation_timeout (int | None) – Override the default WSMan timeout when polling the pipeline.
runspace_options (dict[str, Any] | None) – Optional dictionary which is passed when creating the runspace pool. See
RunspacePool
for a description of the available options.wsman_options (dict[str, Any] | None) – Optional dictionary which is passed when creating the WSMan client. See
WSMan
for a description of the available options.on_output_callback (OutputCallback | None) – Optional callback function to be called whenever an output response item is received during job status polling.
exchange_keys (bool) – If true (default), automatically initiate a session key exchange when the hook is used as a context manager.
host (pypsrp.host.PSHost | None) – Optional PowerShell host instance. If this is not set, the default implementation will be used.
You can provide an alternative configuration_name using either runspace_options or by setting this key as the extra fields of your connection.
- invoke()[source]¶
Yield a PowerShell object to which commands can be added.
Upon exit, the commands will be invoked.