influxdata / kapacitor

Open source framework for processing, monitoring, and alerting on time series data
MIT License
2.32k stars 493 forks source link

Unable to delete smtp config override using API #1706

Open precurse opened 6 years ago

precurse commented 6 years ago

Hello,

I'm having an issue trying to delete the smtp override in the Kapacitor database. According to the API documentation the following method is supposed to remove an smtp override. Despite getting a successful HTTP 204 returned, the override still shows up in the config returned by the API. As a workaround, I've been able to set skip-config-overrides = true in the kapacitor.conf and that works around the issue for me.

data.json:

{
    "delete":[
        "enabled"
    ]
}

curl -X POST -d "@data.json" http://localhost:9092/kapacitor/v1/config/smtp/

in the kapacitor.log: [httpd] 127.0.0.1 - - [04/Dec/2017:11:12:14 -0700] "POST /kapacitor/v1/config/smtp/ HTTP/1.1" 204 0 "-" "curl/7.47.0"

The override still appears to exist:

curl http://localhost:9092/kapacitor/v1/config/smtp
{"link":{"rel":"self","href":"/kapacitor/v1/config/smtp"},"elements":[{"link":{"rel":"self","href":"/kapacitor/v1/config/smtp/"},"options":{"enabled":true,"from":"kapacitor@localhost","global":true,"host":"smtp.example.com","idle-timeout":"30s","no-verify":true,"password":false,"port":25,"state-changes-only":true,"to":["user@example.com"],"username":""},"redacted":["password"]}]}

Any help would be appreciated. Thanks!

OS: Ubuntu 16.04 64-bit Kapacitor deb pkg Version: 1.3.3-1 InfluxDB deb pkg Version: 1.4.2-1

zlq4863947 commented 6 years ago

The same problem I have encountered in the set httppost such problems issues:1694