| :py:mod:`airflow.providers.microsoft.psrp.hooks.psrp` |
| ===================================================== |
| |
| .. py:module:: airflow.providers.microsoft.psrp.hooks.psrp |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.microsoft.psrp.hooks.psrp.PsrpHook |
| |
| |
| |
| |
| Attributes |
| ~~~~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.microsoft.psrp.hooks.psrp.INFORMATIONAL_RECORD_LEVEL_MAP |
| airflow.providers.microsoft.psrp.hooks.psrp.OutputCallback |
| |
| |
| .. py:data:: INFORMATIONAL_RECORD_LEVEL_MAP |
| |
| |
| |
| |
| .. py:data:: OutputCallback |
| |
| |
| |
| |
| .. py:class:: 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) |
| |
| Bases: :py:obj:`airflow.hooks.base.BaseHook` |
| |
| Hook for PowerShell Remoting Protocol execution. |
| |
| When used as a context manager, the runspace pool is reused between shell |
| sessions. |
| |
| :param psrp_conn_id: Required. The name of the PSRP connection. |
| :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 operation_timeout: Override the default WSMan timeout when polling the pipeline. |
| :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 on_output_callback: |
| Optional callback function to be called whenever an output response item is |
| received during job status polling. |
| :param exchange_keys: |
| If true (default), automatically initiate a session key exchange when the |
| hook is used as a context manager. |
| :param host: |
| 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. |
| |
| .. py:method:: __enter__(self) |
| |
| |
| .. py:method:: __exit__(self, exc_type, exc_value, traceback) |
| |
| |
| .. py:method:: get_conn(self) |
| |
| Returns a runspace pool. |
| |
| The returned object must be used as a context manager. |
| |
| |
| .. py:method:: invoke(self) |
| |
| Context manager that yields a PowerShell object to which commands can be |
| added. Upon exit, the commands will be invoked. |
| |
| |
| .. py:method:: invoke_cmdlet(self, name, use_local_scope=None, **parameters) |
| |
| Invoke a PowerShell cmdlet and return session. |
| |
| |
| .. py:method:: invoke_powershell(self, script) |
| |
| Invoke a PowerShell script and return session. |
| |
| |
| |