Skip to content

Commit

Permalink
[AIRFLOW-XXXX] Add cross-references for operators guide (#7760)
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-laj committed Mar 19, 2020
1 parent cc5376d commit ce022a3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class CloudNaturalLanguageAnalyzeEntitiesOperator(BaseOperator):
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:CloudNaturalLanguageAnalyzeEntitiesOperator`
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or google.cloud.language_v1.types.Document
Expand Down
40 changes: 40 additions & 0 deletions airflow/providers/google/cloud/operators/stackdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class StackdriverListAlertPoliciesOperator(BaseOperator):
which returns python dictionary, stringified JSON and protobuf
respectively.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverListAlertPoliciesOperator`
: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.
Expand Down Expand Up @@ -127,6 +131,10 @@ class StackdriverEnableAlertPoliciesOperator(BaseOperator):
Enables one or more disabled alerting policies identified by filter
parameter. Inoperative in case the policy is already enabled.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverEnableAlertPoliciesOperator`
: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.
Expand Down Expand Up @@ -194,6 +202,10 @@ class StackdriverDisableAlertPoliciesOperator(BaseOperator):
Disables one or more enabled alerting policies identified by filter
parameter. Inoperative in case the policy is already disabled.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverDisableAlertPoliciesOperator`
: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.
Expand Down Expand Up @@ -261,6 +273,10 @@ class StackdriverUpsertAlertOperator(BaseOperator):
Creates a new alert or updates an existing policy identified
the name field in the alerts parameter.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverUpsertAlertOperator`
: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.
Expand Down Expand Up @@ -330,6 +346,10 @@ class StackdriverDeleteAlertOperator(BaseOperator):
"""
Deletes an alerting policy.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverDeleteAlertOperator`
:param name: The alerting policy to delete. The format is:
``projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]``.
:type name: str
Expand Down Expand Up @@ -399,6 +419,10 @@ class StackdriverListNotificationChannelsOperator(BaseOperator):
which returns python dictionary, stringified JSON and protobuf
respectively.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverListNotificationChannelsOperator`
: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.
Expand Down Expand Up @@ -495,6 +519,10 @@ class StackdriverEnableNotificationChannelsOperator(BaseOperator):
Enables one or more disabled alerting policies identified by filter
parameter. Inoperative in case the policy is already enabled.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverEnableNotificationChannelsOperator`
: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.
Expand Down Expand Up @@ -564,6 +592,10 @@ class StackdriverDisableNotificationChannelsOperator(BaseOperator):
Disables one or more enabled notification channels identified by filter
parameter. Inoperative in case the policy is already disabled.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverDisableNotificationChannelsOperator`
: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.
Expand Down Expand Up @@ -633,6 +665,10 @@ class StackdriverUpsertNotificationChannelOperator(BaseOperator):
Creates a new notification or updates an existing notification channel
identified the name field in the alerts parameter.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverUpsertNotificationChannelOperator`
: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.
Expand Down Expand Up @@ -703,6 +739,10 @@ class StackdriverDeleteNotificationChannelOperator(BaseOperator):
"""
Deletes a notification channel.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:StackdriverDeleteNotificationChannelOperator`
:param name: The alerting policy to delete. The format is:
``projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]``.
:type name: str
Expand Down
22 changes: 11 additions & 11 deletions docs/howto/operator/gcp/stackdriver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Prerequisite Tasks
.. include:: _partials/prerequisite_tasks.rst


.. _howto/operator:StackdriverListAlertPoliciesOperator:

StackdriverListAlertPoliciesOperator
------------------------------------

Expand All @@ -48,7 +50,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_list_alert_policy]
:end-before: [END howto_operator_gcp_stackdriver_list_alert_policy]

.. _howto/operator:StackdriverListAlertPoliciesOperator:
.. _howto/operator:StackdriverEnableAlertPoliciesOperator:

StackdriverEnableAlertPoliciesOperator
--------------------------------------
Expand All @@ -68,7 +70,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_enable_alert_policy]
:end-before: [END howto_operator_gcp_stackdriver_enable_alert_policy]

.. _howto/operator:StackdriverEnableAlertPoliciesOperator:
.. _howto/operator:StackdriverDisableAlertPoliciesOperator:

StackdriverDisableAlertPoliciesOperator
---------------------------------------
Expand All @@ -88,7 +90,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_disable_alert_policy]
:end-before: [END howto_operator_gcp_stackdriver_disable_alert_policy]

.. _howto/operator:StackdriverDisableAlertPoliciesOperator:
.. _howto/operator:StackdriverUpsertAlertOperator:

StackdriverUpsertAlertOperator
------------------------------
Expand All @@ -109,7 +111,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_upsert_alert_policy]
:end-before: [END howto_operator_gcp_stackdriver_upsert_alert_policy]

.. _howto/operator:StackdriverUpsertAlertOperator:
.. _howto/operator:StackdriverDeleteAlertOperator:

StackdriverDeleteAlertOperator
------------------------------
Expand All @@ -128,7 +130,7 @@ The name of the alert to be deleted should be given in the format projects/<PROJ
:start-after: [START howto_operator_gcp_stackdriver_delete_alert_policy]
:end-before: [END howto_operator_gcp_stackdriver_delete_alert_policy]

.. _howto/operator:StackdriverDeleteAlertOperator:
.. _howto/operator:StackdriverListNotificationChannelsOperator:

StackdriverListNotificationChannelsOperator
-------------------------------------------
Expand All @@ -148,7 +150,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_list_notification_channel]
:end-before: [END howto_operator_gcp_stackdriver_list_notification_channel]

.. _howto/operator:StackdriverListNotificationChannelsOperator:
.. _howto/operator:StackdriverEnableNotificationChannelsOperator:

StackdriverEnableNotificationChannelsOperator
---------------------------------------------
Expand All @@ -168,7 +170,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_enable_notification_channel]
:end-before: [END howto_operator_gcp_stackdriver_enable_notification_channel]

.. _howto/operator:StackdriverEnableNotificationChannelsOperator:
.. _howto/operator:StackdriverDisableNotificationChannelsOperator:

StackdriverDisableNotificationChannelsOperator
----------------------------------------------
Expand All @@ -188,7 +190,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_disable_notification_channel]
:end-before: [END howto_operator_gcp_stackdriver_disable_notification_channel]

.. _howto/operator:StackdriverDisableNotificationChannelsOperator:
.. _howto/operator:StackdriverUpsertNotificationChannelOperator:

StackdriverUpsertNotificationChannelOperator
--------------------------------------------
Expand All @@ -209,7 +211,7 @@ If project is is missing it wil be retrieved from GCP connection used.
:start-after: [START howto_operator_gcp_stackdriver_disable_notification_channel]
:end-before: [END howto_operator_gcp_stackdriver_disable_notification_channel]

.. _howto/operator:StackdriverUpsertNotificationChannelOperator:
.. _howto/operator:StackdriverDeleteNotificationChannelOperator:

StackdriverDeleteNotificationChannelOperator
--------------------------------------------
Expand All @@ -227,5 +229,3 @@ If project is is missing it wil be retrieved from GCP connection used.
:dedent: 4
:start-after: [START howto_operator_gcp_stackdriver_delete_notification_channel]
:end-before: [END howto_operator_gcp_stackdriver_delete_notification_channel]

.. _howto/operator:StackdriverDeleteNotificationChannelOperator:

0 comments on commit ce022a3

Please sign in to comment.