ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hurley" <>
Subject Review Request 27372: Alerts: Creating WEB Alert Definitions via REST API Drops URI
Date Thu, 30 Oct 2014 03:31:28 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for Ambari and Nate Cole.

Bugs: AMBARI-8035

Repository: ambari


When creating an AlertDefinition via the REST APIs, the ResourceProvider takes the JSON payload
and converts it to a flattened list of properties (such as AlertDefinition/source/reporting/critical/text
= 'foo').

This causes a problem when attempting to convert and serialize the Source field since this
is a first-class object (such as MetricSource). Each of the flat properties has to be converted
into appropriate JSON to be serialized to the database. Although this was working for the
"reporting" structure, it was not working for the updated URI structure or the JMX property

I could have gone through and created keys for all of the missing flattened properties, but
then adding a new property in the future would have a similar problem.

Instead, I recursively builds JsonObject instances based on the flat set of properties.





Created several different types of AlertDefinitions (Metric, Web, etc) including exampels
of failing AlertDefinitions. Verified that they are created successfully and the returned
JSON from the GET is correct.

Updated test cases to reflect the changes and to further exercise the uri and reporting structures.


Jonathan Hurley

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message