Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit aaba7cb

Browse files
author
Takashi Matsuo
authored
[monitoring] testing: start using build specific projects [(#3771)](GoogleCloudPlatform/python-docs-samples#3771)
Also added `required_api_url` and `required_role` field in `README.rst.in`. A part of #3310 Note: Now the service account has permission only on the project for py36 build, so py37 build should fail.
1 parent 8a50461 commit aaba7cb

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

samples/snippets/v3/alerts-client/README.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ This directory contains samples for Google Stackdriver Alerting API. Stackdriver
1414

1515
.. _Google Stackdriver Alerting API: https://cloud.google.com/monitoring/alerts/
1616

17+
To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/monitoring.googleapis.com
18+
19+
To run the sample, you need to have `Monitoring Admin` role.
20+
21+
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).
22+
23+
1724
Setup
1825
-------------------------------------------------------------------------------
1926

@@ -87,7 +94,21 @@ To run this sample:
8794
list-alert-policies
8895
list-notification-channels
8996
enable-alert-policies
97+
Enable or disable alert policies in a project.
98+
Arguments: project_name (str) enable (bool): Enable or
99+
disable the policies. filter_ (str, optional): Only
100+
enable/disable alert policies that match this filter_.
101+
See
102+
https://cloud.google.com/monitoring/api/v3/sorting-
103+
and-filtering
90104
disable-alert-policies
105+
Enable or disable alert policies in a project.
106+
Arguments: project_name (str) enable (bool): Enable or
107+
disable the policies. filter_ (str, optional): Only
108+
enable/disable alert policies that match this filter_.
109+
See
110+
https://cloud.google.com/monitoring/api/v3/sorting-
111+
and-filtering
91112
replace-notification-channels
92113
backup
93114
restore
@@ -114,4 +135,4 @@ to `browse the source`_ and `report issues`_.
114135
https://github.com/GoogleCloudPlatform/google-cloud-python/issues
115136

116137

117-
.. _Google Cloud SDK: https://cloud.google.com/sdk/
138+
.. _Google Cloud SDK: https://cloud.google.com/sdk/

samples/snippets/v3/alerts-client/README.rst.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ product:
1212
and many others. Stackdriver's Alerting API allows you to create,
1313
delete, and make back up copies of your alert policies.
1414

15+
required_api_url: https://console.cloud.google.com/apis/library/monitoring.googleapis.com
16+
required_role: Monitoring Admin
17+
other_required_steps: >
18+
Please visit [the Cloud Console UI of this
19+
API](https://console.cloud.google.com/monitoring) and create a new
20+
Workspace with the same name of your Cloud project.
21+
1522
setup:
1623
- auth
1724
- install_deps
@@ -23,4 +30,4 @@ samples:
2330

2431
cloud_client_library: true
2532

26-
folder: monitoring/api/v3/alerts-client
33+
folder: monitoring/api/v3/alerts-client

0 commit comments

Comments
 (0)