This reproduction is for registering an event sink and testing that it has been configured correctly.
- Nomad
- Go (to run the included
webhook_server.go
)
$ nomad agent -dev
$ cat all-jobs-sink.json
{
"ID": "all-jobs",
"Address": "http://127.0.0.1:8080",
"Topics": {
"Job": [
"*"
]
},
"Type": "webhook"
}
$ nomad event sink register all-jobs-sink.json
# in a separate terminal
$ go run webhook_server.go 8080 # this port comes from the Address in all-jobs-sink.json
$ nomad job run example.nomad
$ go run webhook_server.go 8080
{"Index":15,"Events":[{"Topic":"Job","Type":"JobRegistered","Key":"example"...