Skip to content

Commit 2e8a380

Browse files
Add more doc tags to alerts sample. (GoogleCloudPlatform#1483)
* Add more doc tags to alerts sample. * lint
1 parent 5e958b5 commit 2e8a380

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

monitoring/api/v3/alerts-client/snippets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
import tabulate
2424

2525

26+
# [START monitoring_alert_list_policies]
2627
def list_alert_policies(project_name):
2728
client = monitoring_v3.AlertPolicyServiceClient()
2829
policies = client.list_alert_policies(project_name)
2930
print(tabulate.tabulate(
3031
[(policy.name, policy.display_name) for policy in policies],
3132
('name', 'display_name')))
33+
# [END monitoring_alert_list_policies]
3234

3335

3436
# [START monitoring_alert_list_channels]
@@ -113,6 +115,9 @@ def default(self, obj):
113115

114116

115117
# [START monitoring_alert_restore_policies]
118+
# [START monitoring_alert_create_policy]
119+
# [START monitoring_alert_create_channel]
120+
# [START monitoring_alert_update_channel]
116121
def restore(project_name):
117122
print('Loading alert policies and notification channels from backup.json.')
118123
record = json.load(open('backup.json', 'rt'))
@@ -193,6 +198,9 @@ def restore(project_name):
193198
policy = alert_client.create_alert_policy(project_name, policy)
194199
print('Updated', policy.name)
195200
# [END monitoring_alert_restore_policies]
201+
# [END monitoring_alert_create_policy]
202+
# [END monitoring_alert_create_channel]
203+
# [END monitoring_alert_update_channel]
196204

197205

198206
class MissingProjectIdError(Exception):

0 commit comments

Comments
 (0)