----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29547/#review67285 -----------------------------------------------------------
Ship it! Looks good; I think we just have to make sure we only validate when the property exists and is true. ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java <https://reviews.apache.org/r/29547/#comment111283> I think that absence of the validation property would mean we don't validate. Only if it was present and true would validation occur. - Jonathan Hurley On Jan. 8, 2015, 1:23 p.m., Yurii Shylov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/29547/ > ----------------------------------------------------------- > > (Updated Jan. 8, 2015, 1:23 p.m.) > > > Review request for Ambari, Jonathan Hurley, Nate Cole, and Tom Beerbower. > > > Bugs: AMBARI-8978 > https://issues.apache.org/jira/browse/AMBARI-8978 > > > Repository: ambari > > > Description > ------- > > During the cluster installation, the web client would like to be able to have > the administrator configure an alert target for use with that cluster. > However, because there are many properties that are used to successfully > create an AlertTarget, it's likely that the settings originally provided may > not work. > > For example, when creating an AlertTarget for SMTP, if the security or port > are not valid (or the SMTP server is restricting access to certain IP > addresses) then the target won't be able to properly use it. > > We need to be able to allow an AlertTarget to be "tested" before actually > creating it in the system. > > I propose a new endpoint off of targets that can be used to POST to. The POST > can contain all of the alert properties that would normally be found on an > AlertTarget. The difference is that no target is created; instead a status is > returned about whether the target works (and why it doesn't if it failed). > > I would suggest also altering the dispatcher interface to support a new > method; something like {{Dispatcher.testAlertTarget(...)}} which will simply > exercise the properties of the target to ensure a good connection. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertTargetResourceDefinition.java > bc0d81d > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java > 197e3ec > > ambari-server/src/main/java/org/apache/ambari/server/notifications/NotificationDispatcher.java > d8c1fda > > ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcher.java > 289e594 > > ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java > 6a14f1b > > ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java > 626799a > > ambari-server/src/test/java/org/apache/ambari/server/notifications/EmailDispatcherTest.java > c88427d > > ambari-server/src/test/java/org/apache/ambari/server/notifications/MockDispatcher.java > 1dc7e2d > > ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcherTest.java > PRE-CREATION > > ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcherTest.java > db4af1c > > ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java > 1feb102 > > Diff: https://reviews.apache.org/r/29547/diff/ > > > Testing > ------- > > Results : > > Tests run: 2486, Failures: 0, Errors: 0, Skipped: 13 > > > Thanks, > > Yurii Shylov > >
