diff --git a/.kokoro/python3.6/common.cfg b/.kokoro/python3.6/common.cfg index 66e6c7b32be3..b9d99848e091 100644 --- a/.kokoro/python3.6/common.cfg +++ b/.kokoro/python3.6/common.cfg @@ -48,5 +48,5 @@ env_vars: { # but we'll update the value once we have more Cloud projects. env_vars: { key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests" + value: "python-docs-samples-tests-py36" } diff --git a/.kokoro/python3.7/common.cfg b/.kokoro/python3.7/common.cfg index d7526612fac4..3ac2adcb09d6 100644 --- a/.kokoro/python3.7/common.cfg +++ b/.kokoro/python3.7/common.cfg @@ -48,5 +48,5 @@ env_vars: { # Temporary setting my own project for testing the behavior on the PR. env_vars: { key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests" + value: "python-docs-samples-tests-py37" } diff --git a/.kokoro/python3.8/common.cfg b/.kokoro/python3.8/common.cfg index 1cb2b8185f18..fd7dc9863cdf 100644 --- a/.kokoro/python3.8/common.cfg +++ b/.kokoro/python3.8/common.cfg @@ -48,5 +48,5 @@ env_vars: { # but we'll update the value once we have more Cloud projects. env_vars: { key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests" + value: "python-docs-samples-tests-py38" } diff --git a/monitoring/api/v3/alerts-client/README.rst b/monitoring/api/v3/alerts-client/README.rst index 68eba2344eb6..bb59aad5feeb 100644 --- a/monitoring/api/v3/alerts-client/README.rst +++ b/monitoring/api/v3/alerts-client/README.rst @@ -14,6 +14,13 @@ This directory contains samples for Google Stackdriver Alerting API. Stackdriver .. _Google Stackdriver Alerting API: https://cloud.google.com/monitoring/alerts/ +To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/monitoring.googleapis.com + +To run the sample, you need to have `Monitoring Admin` role. + +Please visit [the Cloud Console UI of this API](https://console.cloud.google.com/monitoring) and [create a new Workspace with the same name of your Cloud project](https://cloud.google.com/monitoring/workspaces/create). + + Setup ------------------------------------------------------------------------------- @@ -87,7 +94,21 @@ To run this sample: list-alert-policies list-notification-channels enable-alert-policies + Enable or disable alert policies in a project. + Arguments: project_name (str) enable (bool): Enable or + disable the policies. filter_ (str, optional): Only + enable/disable alert policies that match this filter_. + See + https://cloud.google.com/monitoring/api/v3/sorting- + and-filtering disable-alert-policies + Enable or disable alert policies in a project. + Arguments: project_name (str) enable (bool): Enable or + disable the policies. filter_ (str, optional): Only + enable/disable alert policies that match this filter_. + See + https://cloud.google.com/monitoring/api/v3/sorting- + and-filtering replace-notification-channels backup restore @@ -114,4 +135,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file +.. _Google Cloud SDK: https://cloud.google.com/sdk/ diff --git a/monitoring/api/v3/alerts-client/README.rst.in b/monitoring/api/v3/alerts-client/README.rst.in index ed7f6a3bcf1e..00b280124ea4 100644 --- a/monitoring/api/v3/alerts-client/README.rst.in +++ b/monitoring/api/v3/alerts-client/README.rst.in @@ -12,6 +12,13 @@ product: and many others. Stackdriver's Alerting API allows you to create, delete, and make back up copies of your alert policies. +required_api_url: https://console.cloud.google.com/apis/library/monitoring.googleapis.com +required_role: Monitoring Admin +other_required_steps: > + Please visit [the Cloud Console UI of this + API](https://console.cloud.google.com/monitoring) and create a new + Workspace with the same name of your Cloud project. + setup: - auth - install_deps @@ -23,4 +30,4 @@ samples: cloud_client_library: true -folder: monitoring/api/v3/alerts-client \ No newline at end of file +folder: monitoring/api/v3/alerts-client diff --git a/scripts/readme-gen/templates/README.tmpl.rst b/scripts/readme-gen/templates/README.tmpl.rst index 2314d7fc560b..30ad03d050d8 100644 --- a/scripts/readme-gen/templates/README.tmpl.rst +++ b/scripts/readme-gen/templates/README.tmpl.rst @@ -15,6 +15,16 @@ This directory contains samples for {{product.name}}. {{product.description}} .. _{{product.name}}: {{product.url}} +{% if required_api_url %} +To run the sample, you need to enable the API at: {{required_api_url}} +{% endif %} + +{% if required_role %} +To run the sample, you need to have `{{required_role}}` role. +{% endif %} + +{{other_required_steps}} + {% if setup %} Setup -------------------------------------------------------------------------------