airflow.providers.google.cloud.operators.stackdriver

StackdriverListAlertPoliciesOperator

获取由 filter 参数传递的过滤器标识的所有警报策略。

StackdriverEnableAlertPoliciesOperator

启用由 filter 参数标识的一个或多个已禁用的警报策略。

StackdriverDisableAlertPoliciesOperator

禁用由 filter 参数标识的一个或多个已启用的警报策略。

StackdriverUpsertAlertOperator

创建新的警报或更新 alerts 参数中 name 字段标识的现有策略。

StackdriverDeleteAlertOperator

删除一个警报策略。

StackdriverListNotificationChannelsOperator

获取由 filter 参数传递的过滤器标识的所有通知渠道。

StackdriverEnableNotificationChannelsOperator

启用由 filter 参数标识的一个或多个已禁用的警报策略。

StackdriverDisableNotificationChannelsOperator

禁用由 filter 参数标识的一个或多个已启用的通知渠道。

StackdriverUpsertNotificationChannelOperator

创建新的通知或更新现有通知渠道。

StackdriverDeleteNotificationChannelOperator

删除一个通知渠道。

模块内容

class airflow.providers.google.cloud.operators.stackdriver.StackdriverListAlertPoliciesOperator(*, format_=None, filter_=None, order_by=None, page_size=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

获取由 filter 参数传递的过滤器标识的所有警报策略。

期望的返回类型可以通过 format 参数指定,支持的格式包括 “dict”、“json” 和 None,它们分别返回 Python 字典、JSON 字符串和 protobuf。

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:StackdriverListAlertPoliciesOperator

参数:
  • format – (可选) 结果的期望输出格式。支持的格式包括 “dict”、“json” 和 None,它们分别返回 Python 字典、JSON 字符串和 protobuf。

  • filter – 如果提供,此字段指定警报策略必须满足的条件才能包含在响应中。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • order_by (str | None) – 用于排序结果的字段的逗号分隔列表。支持与 filter 字段相同的字段引用集。条目可以以减号 (-) 为前缀,以按降序排序字段。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • page_size (int | None) – 底层 API 响应中包含的最大资源数。如果按资源进行分页流式处理,此参数不影响返回值。如果按页进行分页流式处理,此参数决定了每页的最大资源数。

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 从哪个项目获取警报。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
format_ = None[source]
filter_ = None[source]
order_by = None[source]
page_size = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverEnableAlertPoliciesOperator(*, filter_=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

启用由 filter 参数标识的一个或多个已禁用的警报策略。

如果策略已启用,则此操作无效。

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:StackdriverEnableAlertPoliciesOperator

参数:
  • filter – 如果提供,此字段指定警报策略必须满足的条件才能被启用。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要启用警报的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

ui_color = '#e5ffcc'[source]
template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
filter_ = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverDisableAlertPoliciesOperator(*, filter_=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

禁用由 filter 参数标识的一个或多个已启用的警报策略。

如果策略已禁用,则此操作无效。

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:StackdriverDisableAlertPoliciesOperator

参数:
  • filter – 如果提供,此字段指定警报策略必须满足的条件才能被禁用。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要禁用警报的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

ui_color = '#e5ffcc'[source]
template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
filter_ = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverUpsertAlertOperator(*, alerts, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

创建新的警报或更新 alerts 参数中 name 字段标识的现有策略。

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:StackdriverUpsertAlertOperator

参数:
  • alerts (str) – 一个 JSON 字符串或文件,指定所有需要创建或更新的告警。更多详细信息,请参阅 https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#AlertPolicy。(模板化)

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要创建/更新告警的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('alerts', 'impersonation_chain')[source]
template_ext: collections.abc.Sequence[str] = ('.json',)[source]
ui_color = '#e5ffcc'[source]
alerts[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverDeleteAlertOperator(*, name, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

删除一个警报策略。

另请参阅

有关如何使用此运算符的更多信息,请参阅指南: StackdriverDeleteAlertOperator

参数:
  • name (str) – 要删除的告警策略。格式为: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要删除告警的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('name', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
name[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverListNotificationChannelsOperator(*, format_=None, filter_=None, order_by=None, page_size=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

获取由 filter 参数传递的过滤器标识的所有通知渠道。

期望的返回类型可以通过 format 参数指定,支持的格式包括 “dict”、“json” 和 None,它们分别返回 Python 字典、JSON 字符串和 protobuf。

另请参阅

有关如何使用此运算符的更多信息,请参阅指南: StackdriverListNotificationChannelsOperator

参数:
  • format – (可选) 结果的期望输出格式。支持的格式包括 “dict”、“json” 和 None,它们分别返回 Python 字典、JSON 字符串和 protobuf。

  • filter – 如果提供,此字段指定通知渠道必须满足的条件才能包含在响应中。更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • order_by (str | None) – 用于排序结果的字段的逗号分隔列表。支持与 filter 字段相同的字段引用集。条目可以以减号 (-) 为前缀,以按降序排序字段。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • page_size (int | None) – 底层 API 响应中包含的最大资源数。如果按资源进行分页流式处理,此参数不影响返回值。如果按页进行分页流式处理,此参数决定了每页的最大资源数。

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 从中获取通知渠道的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
format_ = None[source]
filter_ = None[source]
order_by = None[source]
page_size = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverEnableNotificationChannelsOperator(*, filter_=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

启用由 filter 参数标识的一个或多个已禁用的警报策略。

如果策略已启用,则此操作无效。

另请参阅

有关如何使用此运算符的更多信息,请参阅指南: StackdriverEnableNotificationChannelsOperator

参数:
  • filter – 如果提供,此字段指定通知渠道必须满足的条件才能启用。更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 用于操作的位置。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
filter_ = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverDisableNotificationChannelsOperator(*, filter_=None, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

禁用由 filter 参数标识的一个或多个已启用的通知渠道。

如果策略已禁用,则此操作无效。

另请参阅

有关如何使用此运算符的更多信息,请参阅指南: StackdriverDisableNotificationChannelsOperator

参数:
  • filter – 如果提供,此字段指定警报策略必须满足的条件才能被禁用。有关更多详细信息,请参阅 https://cloud.google.com/monitoring/api/v3/sorting-and-filtering

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要启用通知渠道的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
filter_ = None[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverUpsertNotificationChannelOperator(*, channels, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

创建新的通知或更新现有通知渠道。

通知通道通过 alerts 参数中的 name 字段来标识。

另请参阅

有关如何使用此 Operator 的更多信息,请参阅指南:StackdriverUpsertNotificationChannelOperator

参数:
  • channels (str) – 一个 JSON 字符串或文件,用于指定所有需要创建或更新的告警。更多详情请参阅 https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannels。(模板化的)

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要创建/更新通知通道的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('channels', 'impersonation_chain')[source]
template_ext: collections.abc.Sequence[str] = ('.json',)[source]
ui_color = '#e5ffcc'[source]
channels[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

class airflow.providers.google.cloud.operators.stackdriver.StackdriverDeleteNotificationChannelOperator(*, name, retry=DEFAULT, timeout=None, metadata=(), gcp_conn_id='google_cloud_default', project_id=PROVIDE_PROJECT_ID, impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator

删除一个通知渠道。

另请参阅

有关如何使用此 Operator 的更多信息,请参阅指南:StackdriverDeleteNotificationChannelOperator

参数:
  • name (str) – 要删除的告警策略。格式为:projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – 用于重试请求的重试对象。如果指定 None,将使用默认配置重试请求。

  • timeout (float | None) – 等待请求完成的时间(秒)。请注意,如果指定了 retry,则超时适用于每次尝试。

  • metadata (collections.abc.Sequence[tuple[str, str]]) – 提供给方法的附加元数据。

  • gcp_conn_id (str) – (可选) 用于连接 Google Cloud Platform 的连接 ID。

  • project_id (str) – 需要从中删除通知通道的项目。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – (可选) 使用短期凭据模拟的服务帐号,或获取链中最后一个帐号 (将在请求中被模拟) 的 access_token 所需的链式帐号列表。如果设置为字符串,则该帐号必须授予发起帐号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须向紧邻的前一个身份授予 Service Account Token Creator IAM 角色,列表中第一个帐号将此角色授予发起帐号(模板化)。

template_fields: collections.abc.Sequence[str] = ('name', 'impersonation_chain')[source]
ui_color = '#e5ffcc'[source]
name[source]
retry[source]
timeout = None[source]
metadata = ()[source]
gcp_conn_id = 'google_cloud_default'[source]
project_id = None[source]
impersonation_chain = None[source]
hook: airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook | None = None[source]
execute(context)[source]

在创建 operator 时派生。

Context 与渲染 jinja 模板时使用的字典相同。

请参阅 get_template_context 了解更多 Context。

此条目是否有帮助?