You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor alerts.replaceChannels.js snippet to align with code sample snippet guidelines #3114
The current version of alerts.replaceChannels.js contains four different region tags that demonstrate 3 (or, arguably 4) different actions. The sample flow does three different actions:
runs through hardcoded list of notification channel names
calls API to enable each channel using its name
on (any) creates a new email notification channel with that name
modifies hardcoded alert policy to send notifications to the hardcoded list of channels
The code should be split into 3 snippets (a snippet per file) to demonstrate the following three actions:
Update notification channel. The snippet can be conditioned that the channel should exist.
Create a new notification channel.
Update an alert policy with a notification channel.
All snippets should provide a reasonable error handling. Inputs should be clearly commented to explain expectations. Error handling should, at least, handle errors when inputs are invalid.
Activity