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.

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: ..., 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 | 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.

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

append_result(result, append_result_as_list_if_absent=False)[source]
push_xcom(context, value)[source]
pull_execute_complete(context, event=None)[source]
static paginate(operator, response)[source]

Was this entry helpful?