| :py:mod:`airflow.providers.google.cloud.hooks.stackdriver` |
| ========================================================== |
| |
| .. py:module:: airflow.providers.google.cloud.hooks.stackdriver |
| |
| .. autoapi-nested-parse:: |
| |
| This module contains Google Cloud Stackdriver operators. |
| |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.google.cloud.hooks.stackdriver.StackdriverHook |
| |
| |
| |
| |
| .. py:class:: StackdriverHook(gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None) |
| |
| Bases: :py:obj:`airflow.providers.google.common.hooks.base_google.GoogleBaseHook` |
| |
| Stackdriver Hook for connecting with Google Cloud Stackdriver |
| |
| .. py:method:: list_alert_policies(project_id = PROVIDE_PROJECT_ID, format_ = None, filter_ = None, order_by = None, page_size = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Fetches all the Alert Policies identified by the filter passed as |
| filter parameter. The desired return type can be specified by the |
| format parameter, the supported formats are "dict", "json" and None |
| which returns python dictionary, stringified JSON and protobuf |
| respectively. |
| |
| :param format_: (Optional) Desired output format of the result. The |
| supported formats are "dict", "json" and None which returns |
| python dictionary, stringified JSON and protobuf respectively. |
| :param 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. |
| :param order_by: 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. |
| :param page_size: 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| :param project_id: The project to fetch alerts from. |
| |
| |
| .. py:method:: enable_alert_policies(project_id = PROVIDE_PROJECT_ID, filter_ = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Enables one or more disabled alerting policies identified by filter |
| parameter. Inoperative in case the policy is already enabled. |
| |
| :param project_id: The project in which alert needs to be enabled. |
| :param 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: disable_alert_policies(project_id = PROVIDE_PROJECT_ID, filter_ = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Disables one or more enabled alerting policies identified by filter |
| parameter. Inoperative in case the policy is already disabled. |
| |
| :param project_id: The project in which alert needs to be disabled. |
| :param 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: upsert_alert(alerts, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Creates a new alert or updates an existing policy identified |
| the name field in the alerts parameter. |
| |
| :param project_id: The project in which alert needs to be created/updated. |
| :param alerts: 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) |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: delete_alert_policy(name, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Deletes an alerting policy. |
| |
| :param name: The alerting policy to delete. The format is: |
| ``projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]``. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: list_notification_channels(project_id = PROVIDE_PROJECT_ID, format_ = None, filter_ = None, order_by = None, page_size = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Fetches all the Notification Channels identified by the filter passed as |
| filter parameter. The desired return type can be specified by the |
| format parameter, the supported formats are "dict", "json" and None |
| which returns python dictionary, stringified JSON and protobuf |
| respectively. |
| |
| :param format_: (Optional) Desired output format of the result. The |
| supported formats are "dict", "json" and None which returns |
| python dictionary, stringified JSON and protobuf respectively. |
| :param 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. |
| :param order_by: 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. |
| :param page_size: 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| :param project_id: The project to fetch notification channels from. |
| |
| |
| .. py:method:: enable_notification_channels(project_id = PROVIDE_PROJECT_ID, filter_ = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Enables one or more disabled alerting policies identified by filter |
| parameter. Inoperative in case the policy is already enabled. |
| |
| :param project_id: The project in which notification channels needs to be enabled. |
| :param 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: disable_notification_channels(project_id, filter_ = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Disables one or more enabled notification channels identified by filter |
| parameter. Inoperative in case the policy is already disabled. |
| |
| :param project_id: The project in which notification channels needs to be enabled. |
| :param 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. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: upsert_channel(channels, project_id, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Creates a new notification or updates an existing notification channel |
| identified the name field in the alerts parameter. |
| |
| :param channels: 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.notificationChannels. |
| (templated) |
| :param project_id: The project in which notification channels needs to be created/updated. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: delete_notification_channel(name, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Deletes a notification channel. |
| |
| :param name: The alerting policy to delete. The format is: |
| ``projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]``. |
| :param retry: A retry object used to retry requests. If ``None`` is |
| specified, requests will be retried using a default configuration. |
| :param timeout: 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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| |