airflow.providers.microsoft.azure.hooks.msgraph¶
Attributes¶
Classes¶
Wraps an async Azure credential to prevent |
|
DefaultResponseHandler returns JSON payload or content in bytes or response headers. |
|
A Microsoft Graph API interaction hook, a Wrapper around KiotaRequestAdapter. |
Functions¶
|
Dynamically call a function by matching its signature to provided args/kwargs. |
Module Contents¶
- airflow.providers.microsoft.azure.hooks.msgraph.execute_callable(func, *args, **kwargs)[source]¶
Dynamically call a function by matching its signature to provided args/kwargs.
- class airflow.providers.microsoft.azure.hooks.msgraph.CachedAsyncTokenCredential(credential)[source]¶
Bases:
azure.core.credentials_async.AsyncTokenCredentialWraps an async Azure credential to prevent
kiotafrom closing it after each token request.kiota_authentication_azurecallsawait credential.close()after every successfulget_tokencall (seeAzureIdentityAccessTokenProvider.get_authorization_token). That tears down the underlyingAioHttpTransportsession so the next request fails with “HTTP transport has already been closed”. Suppressingclose()keeps the session alive for the lifetime of the cachedRequestAdapter.- async __aexit__(exc_type=None, exc_value=None, traceback=None)[source]¶
Raise any exception triggered within the runtime context.
- async get_token(*args, **kwargs)[source]¶
Request an access token for scopes.
- Parameters:
scopes (str) – The type of access needed.
claims (str) – Additional claims required in the token, such as those returned in a resource provider’s claims challenge following an authorization failure.
tenant_id (str) – Optional tenant to include in the token request.
enable_cae (bool) – Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token. Defaults to False.
- Return type:
AccessToken
- Returns:
An AccessToken instance containing the token string and its expiration time in Unix time.
- class airflow.providers.microsoft.azure.hooks.msgraph.DefaultResponseHandler[source]¶
Bases:
kiota_abstractions.response_handler.ResponseHandlerDefaultResponseHandler returns JSON payload or content in bytes or response headers.
- class airflow.providers.microsoft.azure.hooks.msgraph.KiotaRequestAdapterHook(conn_id=default_conn_name, timeout=None, proxies=None, host=None, scopes=None, api_version=None)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseHookA Microsoft Graph API interaction hook, a Wrapper around KiotaRequestAdapter.
https://github.com/microsoftgraph/msgraph-sdk-python-core
- Parameters:
conn_id (str) – The HTTP Connection ID to run the trigger against.
timeout (float | None) – The HTTP timeout being used by the KiotaRequestAdapter (default is None). When no timeout is specified or set to None then no HTTP timeout is applied on each request.
proxies (dict | None) – A Dict defining the HTTP proxies to be used (default is None).
host (str | None) – The host to be used (default is “https://graph.microsoft.com”).
scopes (str | list[str] | None) – The scopes to be used (default is [”https://graph.microsoft.com/.default”]).
api_version (msgraph_core.APIVersion | str | None) – The API version of the Microsoft Graph API to be used (default is v1). You can pass an enum named APIVersion which has 2 possible members v1 and beta, or you can pass a string as “v1.0” or “beta”.
- cached_request_adapters: dict[str, tuple[str, kiota_abstractions.request_adapter.RequestAdapter]][source]¶
- classmethod get_connection_form_widgets()[source]¶
Return connection widgets to add to connection form.
- get_conn()[source]¶
Initiate a new RequestAdapter connection.
Warning
This method is deprecated. Use
get_async_conn()instead.
- static default_pagination(response, url=None, query_parameters=None, responses=lambda : ...)[source]¶
- async run(url='', response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None)[source]¶
- async paginated_run(url='', response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None, pagination_function=None)[source]¶