You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/10/28 17:28:50 UTC

git commit: AMBARI-7984. Alerts UI: Create models for alert-definitions. Second patch. (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk bb72045c1 -> a165c5080


AMBARI-7984. Alerts UI: Create models for alert-definitions. Second patch. (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a165c508
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a165c508
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a165c508

Branch: refs/heads/trunk
Commit: a165c508010a317f5ed017c8e3bdd310fa45ffe9
Parents: bb72045
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Tue Oct 28 18:05:53 2014 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Tue Oct 28 18:21:47 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/models/alertDefinition.js | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a165c508/ambari-web/app/models/alertDefinition.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/alertDefinition.js b/ambari-web/app/models/alertDefinition.js
index 8ac8878..0b75e9e 100644
--- a/ambari-web/app/models/alertDefinition.js
+++ b/ambari-web/app/models/alertDefinition.js
@@ -27,7 +27,8 @@ App.AlertDefinition = DS.Model.extend({
   enabled: DS.attr('boolean'),
   scope: DS.attr('string'),
   interval: DS.attr('number'),
-  type: DS.attr('string')
+  type: DS.attr('string'),
+  reporting: DS.hasMany('App.AlertReportDefinition')
 });
 
 App.AlertReportDefinition = DS.Model.extend({
@@ -43,23 +44,30 @@ App.AlertMetricsSourceDefinition = DS.Model.extend({
 
 App.PortAlertDefinition = App.AlertDefinition.extend({
   defaultPort: DS.attr('number'),
-  uri: DS.attr('string'),
-  reporting: DS.hasMany('App.AlertReportDefinition')
+  uri: DS.attr('string')
+});
+
+App.AlertMetricsUriDefinition = DS.Model.extend({
+  http: DS.attr('string'),
+  https: DS.attr('string'),
+  httpsProperty: DS.attr('string'),
+  httpsPropertyValue: DS.attr('string')
 });
 
 App.MetricsAlertDefinition = App.AlertDefinition.extend({
   jmx: DS.belongsTo('App.AlertMetricsSourceDefinition'),
   ganglia: DS.belongsTo('App.AlertMetricsSourceDefinition'),
-  uri: DS.attr('string'),
-  reporting: DS.hasMany('App.AlertReportDefinition')
+  uri: DS.belongsTo('App.AlertMetricsUriDefinition')
+});
+
+App.WebAlertDefinition = App.AlertDefinition.extend({
+  uri: DS.belongsTo('App.AlertMetricsUriDefinition')
 });
 
 App.AggregateAlertDefinition = App.AlertDefinition.extend({
-  alertName: DS.attr('string'),
-  reporting: DS.hasMany('App.AlertReportDefinition')
+  alertName: DS.attr('string')
 });
 
 App.ScriptAlertDefinition = App.AlertDefinition.extend({
-  location: DS.attr('string'),
-  reporting: DS.hasMany('App.AlertReportDefinition')
+  location: DS.attr('string')
 });