ceilometer alarm server handler

I have created an alarm from the CLI that checks if the cpu_util is greater than a threshold for a VM, I have given a http url in my alarm action as "http://localhost:8080", in order to test the web hook i have created a simple python server using SimpleHTTPServer and CGIRequestHandler, but I am not getting any response in json or XML. Does the alarm uses POST or PUT ?
Simply put How to get the response json from alarm ? A simple code snippet would be a great help.

1 answer

simply put, this is not a question for ceilometer alarm, but a question on how web hook work.
the ceilometer alarm POST on the URL provided, in JSON, we can listen on the URL and get response. this is how we can do it.
as a simple example, use python-flask, a micro framework. here is a code snippet that listens on port 8080 and returns the JSON