-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to pause webhooks #7223
Comments
Tested on staging1 as follows: Prerequisites:
Steps:
go run ./cmd/ttn-lw-cli --config .env/configs/staging1.yml app webhooks get vv-play wh1
WARN No fields selected, will select everything
{
"ids": {
"application_ids": {
"application_id": "vv-play"
},
"webhook_id": "wh1"
},
"created_at": "2024-09-12T08:09:47.311512669Z",
"updated_at": "2024-09-12T08:11:35.323370856Z",
"base_url": "https://webhook-test.com/87adc5fb8ac89205940ec603dbb218b9",
"format": "json",
"uplink_message": {},
"health_status": {
"healthy": {}
},
"field_mask": {
"paths": []
}
}
go run ./cmd/ttn-lw-cli --config .env/configs/staging1.yml app webhooks set vv-play wh1 --paused
{
"ids": {
"application_ids": {
"application_id": "vv-play"
},
"webhook_id": "wh1"
},
"created_at": "2024-09-12T08:09:47.311512669Z",
"updated_at": "2024-09-12T08:12:17.238958811Z",
"base_url": "https://webhook-test.com/87adc5fb8ac89205940ec603dbb218b9",
"format": "json",
"paused": true
}
go run ./cmd/ttn-lw-cli --config .env/configs/staging1.yml app webhooks set vv-play wh1 --paused=false
{
"ids": {
"application_ids": {
"application_id": "vv-play"
},
"webhook_id": "wh1"
},
"created_at": "2024-09-12T08:09:47.311512669Z",
"updated_at": "2024-09-12T09:42:22.976790526Z",
"base_url": "https://webhook-test.com/87adc5fb8ac89205940ec603dbb218b9",
"format": "json"
}
I also checked the same steps, but with API calls instead of the CLI tool: curl -X PUT "https://tti.staging1.cloud.thethings.industries/api/v3/as/webhooks/$APP/$WEBHOOK" \
-H "Authorization: $TTN_STAGING_AUTH_TOKEN" \
-d '{
"webhook": {
"ids":{ "webhook_id": "'"$WEBHOOK"'" },
"paused": '"$PAUSED"',
"field_mask":{"paths":[]},
"format":"json"
},
"field_mask": {
"paths": [
"ids.webhook_id",
"paused",
"field_mask",
"format"
]
}
}' Response: {"ids":{"application_ids":{"application_id":"vv-play"},"webhook_id":"wh1"},"created_at":"2024-09-12T08:09:47.311512669Z","updated_at":"2024-09-12T08:16:03.259567478Z","base_url":"https://webhook-test.com/87adc5fb8ac89205940ec603dbb218b9","format":"json","field_mask":{"paths":[]}} EDIT: setting the paused flag from the CLI works too, I was just passing it wrong (I was doing |
Ok thanks. This is great. I'll add a note here for UX and console support. |
This looks good. Only one small comment. The text for the |
@mjamescompton for the implementation. |
Summary
Add an option to pause webhooks.
Current Situation
Currently, the only way to stop a webhook is to delete it (or if it's unhealthy and we set a threshold to stop it).
Why do we need this? Who uses it, and when?
This can be very useful for testing where users can pause webhooks while the external server is being updated without needing to delete them.
Proposed Implementation
I'll get back here when we get this into a milestone.
Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: