Receiver
You can use receivers to send notifications on demand as well as on certain matching conditions (API for this is in the roadmap). Subscriptions use receivers to define routing configuration in Siren. With Siren subscriptions, incoming alerts via webhook will be routed to the pre-registered receivers by matching the subscriptions label. More info about notification concept is here. The how-to sending notification can be found here.
Create a Receiver
Each receiver type might require different kind of configurations. A configurations
field is a dynamic field that has to be filled depend on the receiver type. Below is the example to add a PagerDuty receiver. A labels
field is a KV-string value to label each receiver.
- CLI
- HTTP
$ siren receiver create --file receiver.yaml
$ curl --request POST
--url http://localhost:8080/v1beta1/receivers
--header 'content-type: application/json'
--data-raw '{
"name": "doc-pagerduty-receiver",
"type": "pagerduty",
"labels": {
"team": "siren-devs"
},
"configurations": {
"service_key": "eq23r23rfewf3qwf3wf3w2f23wf32qwfw3fw3"
}
}'
Update a Receiver
Note: While updating a receiver, you will have to make sure all subscriptions that are using this receivers get refreshed(updated), since subscriptions use receivers to create routing configuration dynamically. Receiver type is immutable.
- CLI
- HTTP
$ siren receiver edit --id 61 --file receiver.yaml
$ curl --request PUT
--url http://localhost:8080/v1beta1/receivers/61
--header 'content-type: application/json'
--data-raw '{
"name": "doc-http-receiver",
"type": "http",
"labels": {
"team": "siren-devs"
},
"configurations": {
"url": "http://localhost:4001"
}
}'
Getting a receiver
- CLI
- HTTP
$ siren receiver view 61
$ curl --request GET --url http://localhost:8080/v1beta1/receivers/61
Getting all receivers
- CLI
- HTTP
$ siren receiver list
$ curl --request GET --url http://localhost:8080/v1beta1/receivers
Deleting a receiver
- CLI
- HTTP
$ siren receiver delete 61
$ curl --request DELETE --url http://localhost:8080/v1beta1/receivers/61
CLI Interface
Receivers are the medium to send notification for which we intend to mange configuration.
Usage
siren receiver [flags]
Core commands
create Create a new receiver
delete Delete a receiver details
edit Edit a receiver
list List receivers
send Send a receiver notification
view View a receiver details
Flags
-h, --host string Siren API service to connect to
Use "siren receiver [command] --help" for more information about a command.