Alert channels


The CLI allows the management of the Alert channels. The commands for these actions are shown in the table below.

CommandsDescription
createCreate a new alert channel.
deleteDelete an alert channel.
updateUpdate and existing alert channel

List alert channels 

lenses-cli alertchannels

View details of all alert channels 

lenses-cli alertchannels --details

List alert channels with possible flags 

lenses-cli alertchannels \
--page=1 \
--pageSize=10 \
--sortField="name" \
--sortOrder="asc" \
--templateName="Slack" \
--channelName="slack"

Create new alert channel 

lenses-cli alertchannels create \
--name "my-slack-channel" \
--connectionName="my-slack-connection" \
--templateName="Slack" \
--properties="[{\"key\":\"username\",\"value\":\"@johndoe\"},{\"key\":\"channel\",\"value\":\"company-slack-channel\"}]"

Create a new alert channel using a YAML file:

name: "My alert channel"
templateName: "Slack"
connectionName: "slackconn"
   properties:
   - key: "username"
     value: "George"
   - key: "channel"
     value: "#dev-ops"

lenses-cli alertchannels create alert_chann.yml

Update an alert channel 

lenses-cli alert setting set \
    --id 1000 \
    --enable=false \
    --channels="143315dd-80bf-4833-a13a-394be06dda87" \
    --channels="f9d6140c-4823-4157-a93c-5147aa0e2f29"

Update the settings of an alert channel from a file:

id: 1000
enable: false
channels:
- "f9d6140c-4823-4157-a93c-5147aa0e2f29"
- "143315dd-80bf-4833-a13a-394be06dda87"

lenses-cli alert setting set alert_sett.yaml

Delete an alert channel 

lenses-cli alertchannels \
    delete channelID="f9d6140c-4823-4157-a93c-5147aa0e2f29"
--
Last modified: November 5, 2024