airflow.providers.microsoft.azure.hooks.msgraph

DefaultResponseHandler

DefaultResponseHandler 返回 JSON payload、字节内容或响应头。

KiotaRequestAdapterHook

一个 Microsoft Graph API 交互 Hook,是 KiotaRequestAdapter 的封装。

模块内容

airflow.providers.microsoft.azure.hooks.msgraph.DefaultResponseHandler[source]

Bases: kiota_abstractions.response_handler.ResponseHandler

DefaultResponseHandler 返回 JSON payload、字节内容或响应头。

静态 get_value(response)[source]
异步 handle_response_async(response, error_map)[source]

接收到响应时调用此回调方法。

param response: 原生响应对象的类型。 param error_map: 请求失败时使用的错误字典。

airflow.providers.microsoft.azure.hooks.msgraph.KiotaRequestAdapterHook(conn_id=default_conn_name, timeout=None, proxies=None, host=NationalClouds.Global.value, scopes=None, api_version=None)[source]

Bases: airflow.hooks.base.BaseHook

一个 Microsoft Graph API 交互 Hook,是 KiotaRequestAdapter 的封装。

https://github.com/microsoftgraph/msgraph-sdk-python-core

参数
  • conn_id (str) – 用于运行触发器的 HTTP 连接 ID。

  • timeout (float | None) – KiotaRequestAdapter 使用的 HTTP 超时时间(默认为 None)。未指定超时时间或将其设置为 None 时,每个请求都不应用 HTTP 超时。

  • proxies (dict | None) – 定义要使用的 HTTP 代理的字典(默认为 None)。

  • host (str) – 要使用的主机(默认为“https://graph.microsoft.com”)。

  • scopes (str | list[str] | None) – 要使用的范围(默认为 ["https://graph.microsoft.com/.default"])。

  • api_version (msgraph_core.APIVersion | str | None) – 要使用的 Microsoft Graph API 版本(默认为 v1)。您可以传递一个名为 APIVersion 的枚举,它有两个可能的成员:v1 和 beta,或者您可以传递一个字符串,如“v1.0”或“beta”。

DEFAULT_HEADERS[source]
DEFAULT_SCOPE = 'https://graph.microsoft.com/.default'[source]
cached_request_adapters: dict[str, tuple[msgraph_core.APIVersion, kiota_abstractions.request_adapter.RequestAdapter]][source]
conn_type: str = 'msgraph'[source]
conn_name_attr: str = 'conn_id'[source]
default_conn_name: str = 'msgraph_default'[source]
hook_name: str = 'Microsoft Graph API'[source]
conn_id = 'msgraph_default'[source]
timeout = None[source]
proxies = None[source]
host = 'https://graph.microsoft.com'[source]
类方法 get_connection_form_widgets()[source]

返回要添加到连接表单的连接小部件。

类方法 get_ui_field_behaviour()[source]

返回自定义字段行为。

属性 api_version: str | None[source]
静态 resolve_api_version_from_value(api_version, default=None)[source]
get_api_version(config)[source]
get_host(connection)[source]
静态 format_no_proxy_url(url)[source]
类方法 to_httpx_proxies(proxies)[source]
to_msal_proxies(authority, proxies)[source]
get_conn()[source]

返回此 Hook 的连接。

get_proxies(config)[source]
get_credentials(login, password, config, authority, verify, proxies)[source]
test_connection()[source]

测试 HTTP 连接。

异步 run(url='', response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None)[source]
异步 send_request(request_info, response_type=None)[source]
request_information(url, response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None)[source]
静态 normalize_url(url)[source]
静态 encoded_query_parameters(query_parameters)[source]
静态 error_mapping()[source]

本条目有帮助吗?