Repository: ambari Updated Branches: refs/heads/trunk 94e505fc8 -> c39fcb30f
AMBARI-5395. Flume client model should be created. (srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c39fcb30 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c39fcb30 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c39fcb30 Branch: refs/heads/trunk Commit: c39fcb30fb4646e43283fb6993f6923e3766827d Parents: 94e505f Author: Srimanth Gunturi <[email protected]> Authored: Tue Apr 8 11:05:30 2014 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Tue Apr 8 11:05:30 2014 -0700 ---------------------------------------------------------------------- .../app/assets/data/services/HDP2/services.json | 15 +++++ ambari-web/app/models/service/flume.js | 64 ++++++++++---------- 2 files changed, 46 insertions(+), 33 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c39fcb30/ambari-web/app/assets/data/services/HDP2/services.json ---------------------------------------------------------------------- diff --git a/ambari-web/app/assets/data/services/HDP2/services.json b/ambari-web/app/assets/data/services/HDP2/services.json index 934b764..dc470a8 100644 --- a/ambari-web/app/assets/data/services/HDP2/services.json +++ b/ambari-web/app/assets/data/services/HDP2/services.json @@ -223,6 +223,21 @@ "WARNING" : 0 } } + }, + { + "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/services/FLUME", + "ServiceInfo" : { + "maintenance_state" : "OFF", + "state": "STARTED", + "service_name" : "FLUME" + }, + "alerts" : { + "summary" : { + "CRITICAL" : 0, + "OK" : 0, + "WARNING" : 0 + } + } } ] } http://git-wip-us.apache.org/repos/asf/ambari/blob/c39fcb30/ambari-web/app/models/service/flume.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service/flume.js b/ambari-web/app/models/service/flume.js index 9fafe72..bd05f04 100644 --- a/ambari-web/app/models/service/flume.js +++ b/ambari-web/app/models/service/flume.js @@ -19,36 +19,15 @@ var App = require('app'); App.FlumeService = App.Service.extend({ version: DS.attr('string'), - nodes: DS.hasMany('App.FlumeNode'), - channelsCount: function () { - var nodes = this.get('nodes'); - var count = 0; - nodes.forEach(function (node) { - count += node.get('channelsCount'); - }); - return count; - }.property('[email protected]'), - - sourcesCount: function () { - var nodes = this.get('nodes'); - var count = 0; - nodes.forEach(function (node) { - count += node.get('sourcesCount'); - }); - return count; - }.property('[email protected]'), - - sinksCount: function () { - var nodes = this.get('nodes'); - var count = 0; - nodes.forEach(function (node) { - count += node.get('sinksCount'); - }); - return count; - }.property('[email protected]') + agents: DS.hasMany('App.FlumeAgent') }); -App.FlumeNode = DS.Model.extend({ +App.FlumeAgent = DS.Model.extend({ + name: DS.attr('string'), + /** + * Status of agent. One of 'STARTED', 'INSTALLED', 'UNKNOWN'. + */ + status: DS.attr('string'), host: DS.belongsTo('App.Host'), /** @@ -66,7 +45,7 @@ App.FlumeNode = DS.Model.extend({ */ sinks: DS.attr('string'), - channelsCount: function () { + channelsCount: function() { var channels = this.get('channels'); if (!channels) { return 0; @@ -75,7 +54,7 @@ App.FlumeNode = DS.Model.extend({ } }.property('channels'), - sourcesCount: function () { + sourcesCount: function() { var sources = this.get('sources'); if (!sources) { return 0; @@ -84,7 +63,7 @@ App.FlumeNode = DS.Model.extend({ } }.property('sources'), - sinksCount: function () { + sinksCount: function() { var sinks = this.get('sinks'); if (!sinks) { return 0; @@ -94,5 +73,24 @@ App.FlumeNode = DS.Model.extend({ }.property('sinks') }); -App.FlumeService.FIXTURES = []; -App.FlumeNode.FIXTURES = []; +App.FlumeService.FIXTURES = [ { + version: '1.4.0', + agents: [ 0, 1 ] +} ]; +App.FlumeAgent.FIXTURES = [ { + id: 0, + name: 'a1_dev01', + status: 'INSTALLED', + host: 'dev01', + channels: 'c1,c2', + sources: 'so1,so2,so3,so4', + sinks: 'si1,si2' +}, { + id: 1, + name: 'a2_dev01', + status: 'STARTED', + host: 'dev01', + channels: 'c2', + sources: 'so1,so2,so3,so4', + sinks: 'si1,si2,si3,si4' +} ];
