airflow.providers.google.cloud.operators.cloud_monitoring

Classes

CloudMonitoringListAlertPoliciesOperator

Fetches all the Alert Policies identified by the filter passed as filter parameter.

CloudMonitoringEnableAlertPoliciesOperator

Enables one or more disabled alerting policies identified by filter parameter.

CloudMonitoringDisableAlertPoliciesOperator

Disables one or more enabled alerting policies identified by filter parameter.

CloudMonitoringUpsertAlertOperator

Creates a new alert or updates an existing policy identified by the name field in the alerts parameter.

CloudMonitoringDeleteAlertOperator

Deletes an alerting policy.

CloudMonitoringListNotificationChannelsOperator

Fetches all the Notification Channels identified by the filter passed as filter parameter.

CloudMonitoringEnableNotificationChannelsOperator

Enables one or more disabled notification channels identified by filter parameter.

CloudMonitoringDisableNotificationChannelsOperator

Disables one or more enabled notification channels identified by filter parameter.

CloudMonitoringUpsertNotificationChannelOperator

Create a new notification or updates an existing notification channel.

CloudMonitoringDeleteNotificationChannelOperator

Deletes a notification channel.

Module Contents

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringListAlertPoliciesOperator(*, 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

Fetches all the Alert Policies identified by the filter passed as filter parameter.

Returns a list of dictionaries by default, or JSON strings when format_="json".

See also

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

Parameters:
  • format – (Optional) Desired output format. "dict" and "json" return the hook’s list of dictionaries or JSON strings unchanged, respectively. When None (the default) or any other value, protobuf objects are converted to dictionaries for XCom serialization.

  • filter – If provided, this field specifies the criteria that must be met by alert policies to be included in the response. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • order_by (str | None) – A comma-separated list of fields by which to sort the result. Supports the same set of field references as the filter field. Entries can be prefixed with a minus sign to sort by the field in descending order. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • page_size (int | None) – The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project to fetch alerts from.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringEnableAlertPoliciesOperator(*, 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

Enables one or more disabled alerting policies identified by filter parameter.

Inoperative in case the policy is already enabled.

See also

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

Parameters:
  • filter – If provided, this field specifies the criteria that must be met by alert policies to be enabled. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which alert needs to be enabled.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

ui_color = '#e5ffcc'[source]
template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringDisableAlertPoliciesOperator(*, 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

Disables one or more enabled alerting policies identified by filter parameter.

Inoperative in case the policy is already disabled.

See also

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

Parameters:
  • filter – If provided, this field specifies the criteria that must be met by alert policies to be disabled. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which alert needs to be disabled.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

ui_color = '#e5ffcc'[source]
template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringUpsertAlertOperator(*, 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

Creates a new alert or updates an existing policy identified by the name field in the alerts parameter.

See also

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

Parameters:
  • alerts (str) – A JSON string or file that specifies all the alerts that needs to be either created or updated. For more details, see https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#AlertPolicy. (templated)

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which alert needs to be created/updated.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('alerts', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringDeleteAlertOperator(*, 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

Deletes an alerting policy.

See also

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

Parameters:
  • name (str) – The alerting policy to delete. The format is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID].

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project from which alert needs to be deleted.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('name', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringListNotificationChannelsOperator(*, 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

Fetches all the Notification Channels identified by the filter passed as filter parameter.

Returns a list of dictionaries by default, or JSON strings when format_="json".

See also

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

Parameters:
  • format – (Optional) Desired output format. "dict" and "json" return the hook’s list of dictionaries or JSON strings unchanged, respectively. When None (the default) or any other value, protobuf objects are converted to dictionaries for XCom serialization.

  • filter – If provided, this field specifies the criteria that must be met by notification channels to be included in the response. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • order_by (str | None) – A comma-separated list of fields by which to sort the result. Supports the same set of field references as the filter field. Entries can be prefixed with a minus sign to sort by the field in descending order. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • page_size (int | None) – The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project to fetch notification channels from.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringEnableNotificationChannelsOperator(*, 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

Enables one or more disabled notification channels identified by filter parameter.

Inoperative in case the channel is already enabled.

See also

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

Parameters:
  • filter – If provided, this field specifies the criteria that must be met by notification channels to be enabled. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which notification channels need to be enabled.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringDisableNotificationChannelsOperator(*, 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

Disables one or more enabled notification channels identified by filter parameter.

Inoperative in case the channel is already disabled.

See also

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

Parameters:
  • filter – If provided, this field specifies the criteria that must be met by notification channels to be disabled. For more details, see https://cloud.google.com/monitoring/api/v3/sorting-and-filtering.

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which notification channels need to be disabled.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('filter_', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringUpsertNotificationChannelOperator(*, 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

Create a new notification or updates an existing notification channel.

Channel is identified by the name field in the channels parameter.

See also

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

Parameters:
  • channels (str) – A JSON string or file that specifies all the notification channels that needs to be either created or updated. For more details, see https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannels. (templated)

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project in which notification channels need to be created/updated.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('channels', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.google.cloud.operators.cloud_monitoring.CloudMonitoringDeleteNotificationChannelOperator(*, 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

Deletes a notification channel.

See also

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

Parameters:
  • name (str) – The notification channel to delete. The format is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID].

  • retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

  • timeout (float | None) – The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

  • metadata (collections.abc.Sequence[tuple[str, str]]) – Additional metadata that is provided to the method.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud Platform.

  • project_id (str) – The project from which notification channel needs to be deleted.

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

template_fields: collections.abc.Sequence[str] = ('name', 'impersonation_chain', 'gcp_conn_id')[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.cloud_monitoring.CloudMonitoringHook | None = None[source]
execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?