alertDefinition.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.AlertDefinition = DS.Model.extend({
  20. name: DS.attr('string'),
  21. label: DS.attr('string'),
  22. serviceName: DS.attr('string'),
  23. componentName: DS.attr('string'),
  24. enabled: DS.attr('boolean'),
  25. scope: DS.attr('string'),
  26. interval: DS.attr('number'),
  27. type: DS.attr('string')
  28. });
  29. App.AlertReportDefinition = DS.Model.extend({
  30. type: DS.attr('string'),
  31. text: DS.attr('string'),
  32. value: DS.attr('number')
  33. });
  34. App.AlertMetricsSourceDefinition = DS.Model.extend({
  35. propertyList: [],
  36. value: DS.attr('string')
  37. });
  38. App.PortAlertDefinition = App.AlertDefinition.extend({
  39. defaultPort: DS.attr('number'),
  40. uri: DS.attr('string'),
  41. reporting: DS.hasMany('App.AlertReportDefinition')
  42. });
  43. App.MetricsAlertDefinition = App.AlertDefinition.extend({
  44. jmx: DS.belongsTo('App.AlertMetricsSourceDefinition'),
  45. ganglia: DS.belongsTo('App.AlertMetricsSourceDefinition'),
  46. uri: DS.attr('string'),
  47. reporting: DS.hasMany('App.AlertReportDefinition')
  48. });
  49. App.AggregateAlertDefinition = App.AlertDefinition.extend({
  50. alertName: DS.attr('string'),
  51. reporting: DS.hasMany('App.AlertReportDefinition')
  52. });
  53. App.ScriptAlertDefinition = App.AlertDefinition.extend({
  54. location: DS.attr('string'),
  55. reporting: DS.hasMany('App.AlertReportDefinition')
  56. });