Skip to content

Commit 3cc541f

Browse files
author
Takashi Matsuo
authored
[monitoring] testing: start using build specific projects (#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 0779b61 commit 3cc541f

File tree

6 files changed

+43
-5
lines changed

6 files changed

+43
-5
lines changed

.kokoro/python3.6/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ env_vars: {
4848
# but we'll update the value once we have more Cloud projects.
4949
env_vars: {
5050
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
51-
value: "python-docs-samples-tests"
51+
value: "python-docs-samples-tests-py36"
5252
}

.kokoro/python3.7/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ env_vars: {
4848
# Temporary setting my own project for testing the behavior on the PR.
4949
env_vars: {
5050
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
51-
value: "python-docs-samples-tests"
51+
value: "python-docs-samples-tests-py37"
5252
}

.kokoro/python3.8/common.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ env_vars: {
4848
# but we'll update the value once we have more Cloud projects.
4949
env_vars: {
5050
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
51-
value: "python-docs-samples-tests"
51+
value: "python-docs-samples-tests-py38"
5252
}

monitoring/api/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/

monitoring/api/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

scripts/readme-gen/templates/README.tmpl.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This directory contains samples for {{product.name}}. {{product.description}}
1515

1616
.. _{{product.name}}: {{product.url}}
1717

18+
{% if required_api_url %}
19+
To run the sample, you need to enable the API at: {{required_api_url}}
20+
{% endif %}
21+
22+
{% if required_role %}
23+
To run the sample, you need to have `{{required_role}}` role.
24+
{% endif %}
25+
26+
{{other_required_steps}}
27+
1828
{% if setup %}
1929
Setup
2030
-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)