I was trying to add custom alert in ambari but was getting 500 response code but when I check ambari the alerts are there and running. Now when I try to delete those alerts using
curl -u admin:admin -i -H 'X-Requested-By:ambari' -X DELETE http://test-cluster:8080/api/v1/clusters/Analytics_CP1_Dev_Test/alert_definitions/1233
Response I get is the following:
HTTP/1.1 301 Moved Permanently Location: https://test-cluster:8080/api/v1/clusters/Analytics_CP1_Dev_Test/alert_definitions/1233 Content-Length: 0 Content-Type: text/html; charset=UTF-8
But when I check ambari the alerts are still running. I tried restarting ambari-server but the alerts are still there.
Can you look at the /var/log/ambari-server/ambari-server.log?
You can search for this in the log:
Deleting alert definition
You can also disable alerts from the UI which is not the same as delete but will achieve the same purpose.
You're making a requests against a plaintext (http) endpoint and Ambari (or whatever is sitting in front of Ambari) is redirecting you to an SSL endpoint (https). You need to make the request against the correct endpoint, namely: