Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Okay, no more than 79 characters
  • Loading branch information
engelke committed Dec 10, 2018
commit 7bec38e1f82bc53e4cdfda401091fcf8a1c4242b
6 changes: 4 additions & 2 deletions monitoring/api/v3/alerts-client/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ def replace_notification_channels(project_name, alert_policy_id, channel_ids):
def delete_notification_channels(project_name, channel_ids, force=None):
channel_client = monitoring_v3.NotificationChannelServiceClient()
for channel_id in channel_ids:
channel_name = '{}/notificationChannels/{}'.format(project_name, channel_id)
channel_name = '{}/notificationChannels/{}'.format(
project_name, channel_id)
try:
channel_client.delete_notification_channel(channel_name, force=force)
channel_client.delete_notification_channel(
channel_name, force=force)
print('Channel {} deleted'.format(channel_name))
except ValueError:
print('The parameters are invalid')
Expand Down