airflow.providers.microsoft.azure.operators.msgraph

Module Contents

Classes

MSGraphAsyncOperator

A Microsoft Graph API operator which allows you to execute REST call to the Microsoft Graph API.

Functions

default_event_handler(context[, event])

airflow.providers.microsoft.azure.operators.msgraph.default_event_handler(context, event=None)[source]
class airflow.providers.microsoft.azure.operators.msgraph.MSGraphAsyncOperator(*, url, response_type=None, path_parameters=None, url_template=None, method='GET', query_parameters=None, headers=None, data=None, conn_id=KiotaRequestAdapterHook.default_conn_name, key=XCOM_RETURN_KEY, timeout=None, proxies=None, api_version=None, pagination_function=None, result_processor=lambda context, result: ..., event_handler=None, serializer=ResponseSerializer, **kwargs)[source]

Bases: airflow.models.BaseOperator

A Microsoft Graph API operator which allows you to execute REST call to the Microsoft Graph API.

https://learn.microsoft.com/en-us/graph/use-the-api

See also

For more information on how to use this operator, take a look at the guide: MSGraphAsyncOperator

Parameters
  • url (str) – The url being executed on the Microsoft Graph API (templated).

  • response_type (kiota_abstractions.request_adapter.ResponseType | None) – The expected return type of the response as a string. Possible value are: bytes, str, int, float, bool and datetime (default is None).

  • method (str) – The HTTP method being used to do the REST call (default is GET).

  • conn_id (str) – The HTTP Connection ID to run the operator against (templated).

  • key (str) – The key that will be used to store XCom’s (“return_value” is default).

  • timeout (float | None) – The HTTP timeout being used by the KiotaRequestAdapter (default is None). When no timeout is specified or set to None then there is no HTTP timeout on each request.

  • proxies (dict | None) – A dict defining the HTTP proxies to be used (default is None).

  • 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.

  • result_processor (Callable[[airflow.utils.context.Context, Any], Any]) – Function to further process the response from MS Graph API (default is lambda: context, response: response). When the response returned by the KiotaRequestAdapterHook are bytes, then those will be base64 encoded into a string.

  • event_handler (Callable[[airflow.utils.context.Context, dict[Any, Any] | None], Any] | None) – Function to process the event returned from MSGraphTrigger. By default, when the event returned by the MSGraphTrigger has a failed status, an AirflowException is being raised with the message from the event, otherwise the response from the event payload is returned.

  • serializer (type[airflow.providers.microsoft.azure.triggers.msgraph.ResponseSerializer]) – Class which handles response serialization (default is ResponseSerializer). Bytes will be base64 encoded into a string, so it can be stored as an XCom.

template_fields: Sequence[str] = ('url', 'response_type', 'path_parameters', 'url_template', 'query_parameters', 'headers',...[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

execute_complete(context, event=None)[source]

Execute callback when MSGraphTrigger finishes execution.

This method gets executed automatically when MSGraphTrigger completes its execution.

classmethod append_result(results, result, append_result_as_list_if_absent=False)[source]
pull_xcom(context)[source]
push_xcom(context, value)[source]
static paginate(operator, response, context)[source]

Was this entry helpful?