You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/10/09 21:26:44 UTC

[1/8] stratos git commit: Changing time axis values based on time interval in member count gadget

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 2c8de71a3 -> 382efe5e3


Changing time axis values based on time interval in member count gadget


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

Branch: refs/heads/stratos-4.1.x
Commit: 382efe5e3c880e7c4f3eb982137eb7b1f7c9ff7c
Parents: cdc4d88
Author: Thanuja <th...@wso2.com>
Authored: Fri Oct 9 11:24:08 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../metering-service/capps/jaggery-files/member-count.jag    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/382efe5e/extensions/das/metering-service/capps/jaggery-files/member-count.jag
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/jaggery-files/member-count.jag b/extensions/das/metering-service/capps/jaggery-files/member-count.jag
index 53d4767..4d403a2 100644
--- a/extensions/das/metering-service/capps/jaggery-files/member-count.jag
+++ b/extensions/das/metering-service/capps/jaggery-files/member-count.jag
@@ -61,27 +61,33 @@
         var timeInterval = request.getParameter("time");
         var interval = 1800000;
         var x_axis_interval;
+        var time_format;
         if (timeInterval === TIME_INTERVAL_1) {
             interval = 1800000;
             x_axis_interval = 60;
+            time_format = '%h:%i';
         } else if (timeInterval === TIME_INTERVAL_2) {
             interval = 3600000;
             x_axis_interval = 120;
+            time_format = '%h:%i';
         } else if (timeInterval === TIME_INTERVAL_3) {
             interval = 86400000;
             x_axis_interval = 2880;
+            time_format = '%Y:%m:%d %h:%i';
         } else if (timeInterval === TIME_INTERVAL_4) {
             interval = 604800000;
             x_axis_interval = 20160;
+            time_format = '%Y:%m:%d %h:%i';
         } else if (timeInterval === TIME_INTERVAL_5) {
             interval = 2419200000;
             x_axis_interval = 80640;
+            time_format = '%Y:%m:%d';
         }
         var applicationId = request.getParameter("applicationId");
         var clusterId = request.getParameter("clusterId");
 
         if (clusterId == ALL_CLUSTERS) {
-            result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '%Y:%m:%d %h:%i') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i'), ApplicationId", applicationId);
+            result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '" + time_format + "') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i'), ApplicationId", applicationId);
         } else {
             result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '" + time_format + "') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND ClusterAlias=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i')",applicationId, clusterId);
         }


[2/8] stratos git commit: Changing metering dashboard url and encoding it

Posted by ra...@apache.org.
Changing metering dashboard url and encoding it


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

Branch: refs/heads/stratos-4.1.x
Commit: a5b0061f0d34333d7c64e07be36613f8f0a41081
Parents: daf30f4
Author: Thanuja <th...@wso2.com>
Authored: Fri Oct 9 00:06:26 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/js/custom/applications_topology.js     | 4 ++--
 .../distribution/src/main/conf/cartridge-config.properties       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a5b0061f/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
index 40bdfae..afd7f92 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
@@ -611,12 +611,12 @@ $("a[href='#application']").on('shown.bs.tab', function (e) {
 
 
 function showApplicationUsage(id) {
-    window.location = meteringDashboardUrl + '?applicationId=' + applicationId;
+    window.location = encodeURI(meteringDashboardUrl + '?applicationId=' + applicationId);
 }
 
 function showClusterUsage(id, type) {
     var clusterId = id;
-    window.location = meteringDashboardUrl + '?applicationId=' + applicationId + '&clusterId=' + clusterId;
+    window.location = encodeURI(meteringDashboardUrl + '?applicationId=' + applicationId + '&clusterId=' + clusterId);
 }
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/a5b0061f/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties b/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
index c96edb5..a3fd8ee 100644
--- a/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
+++ b/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
@@ -22,7 +22,7 @@
 autoscaler.service.url=https://localhost:9443/services/AutoscalerService/
 cloud.controller.service.url=https://localhost:9443/services/CloudControllerService/
 stratos.manager.service.url=https://localhost:9443/services/StratosManagerService/
-das.metering.dashboard.url=https://localhost:9444/portal/dashboards/stratos-metering-dashboard/
+das.metering.dashboard.url=https://localhost:9444/portal/dashboards/stratos-metering-dashboard
 puppet.ip=127.0.0.1
 puppet.hostname=puppet.stratos.apache.org
 puppet.dns.available=false


[4/8] stratos git commit: Updating das extension README files

Posted by ra...@apache.org.
Updating das extension README files


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

Branch: refs/heads/stratos-4.1.x
Commit: 166f589a30babd77612b2a53614bc8bb68353aba
Parents: a43277e
Author: Thanuja <th...@wso2.com>
Authored: Tue Oct 6 11:48:08 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 extensions/das/metering-service/capps/README.md      | 9 ++++-----
 extensions/das/metering-service/spark-udfs/README.md | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/166f589a/extensions/das/metering-service/capps/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/README.md b/extensions/das/metering-service/capps/README.md
index ad5285b..e93fcd6 100644
--- a/extensions/das/metering-service/capps/README.md
+++ b/extensions/das/metering-service/capps/README.md
@@ -3,8 +3,7 @@
 This directory contains Composite Applications (CApps) required for Stratos Metering Service.
 It includes all Event Stream, Event receiver, Even Store, Gadgets and Dashboard artifacts bundle inside the car file.
 Follow the below steps to generate the metering dashboard:
-1. Run a external DAS server
-2. Enable thrift stats publisher for das in thrift-client-config.xml file and update DAS server IP and thrift port in the same file as follow:
+1. Enable thrift stats publisher for das in thrift-client-config.xml file and update DAS server IP and thrift port in the same file as follow:
     <config>
         <name>das</name>
         <statsPublisherEnabled>false</statsPublisherEnabled>
@@ -13,6 +12,6 @@ Follow the below steps to generate the metering dashboard:
         <ip>localhost</ip> <!-- DAS server IP -->
         <port>7612</port> <!-- DAS thrift port -->
     </config>
-2. Add the jaggery files which can be found inside directory 'jaggery-files' to inside server path '/jaggeryapps/portal/controllers/apis'
-3. Create MySQL data tables using queries in 'mysqlscript.sql'
-4. Add the car file to server to generate the metering dashboard.
\ No newline at end of file
+2. Add the jaggery files which can be found inside directory 'jaggery-files' to DAS server path '/jaggeryapps/portal/controllers/apis'
+3. Create MySQL database and tables using queries in 'mysqlscript.sql' manually.
+4. Add the car file to DAS server to gene rate the metering dashboard.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/166f589a/extensions/das/metering-service/spark-udfs/README.md
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/spark-udfs/README.md b/extensions/das/metering-service/spark-udfs/README.md
index 025d645..12eac18 100644
--- a/extensions/das/metering-service/spark-udfs/README.md
+++ b/extensions/das/metering-service/spark-udfs/README.md
@@ -3,6 +3,6 @@
 This directory contains Spark UDFs (user Defined Function) required for executing the spark queries with UDFs.
 Follow the below steps to use UDF in spark environment:
 1. Add the jar files of each spark-udfs to '<DAS-HOME>/repository/components/lib'.
-    Example: spark-time-udf-4.2.0-SNAPSHOT.jar
+    Example: spark-time-udf-4.1.4-SNAPSHOT.jar
 2. Add each UDF class path to 'spark-udf-config.xml' file in '<DAS-HOME>/repository/conf/spark/' folder.
     Example: <class-name>org.apache.stratos.das.extension.spark.udf.TimeUDF</class-name>
\ No newline at end of file


[8/8] stratos git commit: change list-data variable name to listData

Posted by ra...@apache.org.
change list-data variable name to listData


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

Branch: refs/heads/stratos-4.1.x
Commit: daf30f435857067bdf7931f1d1cdaaff873137de
Parents: e4284e2
Author: Thanuja <th...@wso2.com>
Authored: Thu Oct 8 22:19:40 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag               | 10 ++--
 .../console/configure_form.jag                  | 50 ++++++++++----------
 .../theme0/renderers/applications_form.js       |  4 +-
 .../themes/theme0/renderers/configure_form.js   |  2 +-
 .../themes/theme0/renderers/users_form.js       |  2 +-
 .../console/users_form.jag                      | 20 ++++----
 6 files changed, 44 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index a9f8021..a68f8fd 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -24,7 +24,7 @@ include('/controllers/menu/menu_generator.jag');
 
 var log = new Log("apachestratos.applications_form"),
         error = [],
-        list_data,
+        listData,
         caramel = require('caramel'),
         context = caramel.configs().context,
         menuJson = require('/controllers/menu/menu.json'),
@@ -102,9 +102,9 @@ switch (formtype) {
     case "applications":
         formTitle = "Application",
                 buttonText = "Application";
-        list_data = util.RESTCalls.getApplications();
-        if (list_data.status == 'error') {
-            list_data = null;
+        listData = util.RESTCalls.getApplications();
+        if (listData.status == 'error') {
+            listData = null;
         }
         break;
 
@@ -140,7 +140,7 @@ var caramelData = {
     //formDataRaw: JSON.stringify(partition_data.partition[0]),
     formDataEdit: JSON.stringify(formDataEdit),
     formData: JSON.stringify(formData),
-    list_data: list_data,
+    listData: listData,
     error: error,
     dasStatsPublisherEnabled: dasStatsPublisherEnabled,
     meteringDashboardUrl: meteringDashboardUrl

http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/configure_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/configure_form.jag b/components/org.apache.stratos.manager.console/console/configure_form.jag
index 18b0e48..3fea275 100644
--- a/components/org.apache.stratos.manager.console/console/configure_form.jag
+++ b/components/org.apache.stratos.manager.console/console/configure_form.jag
@@ -24,7 +24,7 @@ include('/controllers/menu/menu_generator.jag');
 
 var log = new Log("apachestratos.configure_form"),
         error = [],
-        list_data,
+        listData,
         caramel = require('caramel'),
         context = caramel.configs().context,
         menuJson = require('/controllers/menu/menu.json'),
@@ -97,63 +97,63 @@ if(isEdit == false && elements.action != 'new') {
         case "network-partitions":
             formTitle = "Network Partition",
                     buttonText = "Network Partition";
-            list_data = util.RESTCalls.getPartitions();
-            if (list_data.status == 'error') {
-                list_data = null;
+            listData = util.RESTCalls.getPartitions();
+            if (listData.status == 'error') {
+                listData = null;
             }
             break;
 
         case "autoscaling-policies":
             formTitle = "Auto-scaling Policie",
                     buttonText = "Auto-scaling Policy";
-            list_data = util.RESTCalls.getPolicyAutoScales();
-            if(list_data.status == 'error'){
-                list_data = null;
+            listData = util.RESTCalls.getPolicyAutoScales();
+            if(listData.status == 'error'){
+                listData = null;
             }
             break;
 
         case "deployment-policies":
             formTitle = "Deployment Policie",
                     buttonText = "Deployment Policy";
-            list_data = util.RESTCalls.getPolicyDeployments();
-            if (list_data.status == 'error') {
-                list_data = null;
+            listData = util.RESTCalls.getPolicyDeployments();
+            if (listData.status == 'error') {
+                listData = null;
             }
             break;
 
         case "cartridges":
             formTitle = "Cartridge",
                     buttonText = "Cartridge";
-            list_data = util.RESTCalls.getCartridges();
-            if (list_data.status == 'error') {
-                list_data = null;
+            listData = util.RESTCalls.getCartridges();
+            if (listData.status == 'error') {
+                listData = null;
             }
             break;
 
         case "cartridge-groups":
             formTitle = "Cartridge Group",
                     buttonText = "Cartridge Group";
-            list_data = util.RESTCalls.getGroups();
-            if (list_data.status == 'error') {
-                list_data = null;
+            listData = util.RESTCalls.getGroups();
+            if (listData.status == 'error') {
+                listData = null;
             }
             break;
 
         case "kubernetes-clusters":
             formTitle = "Kubernetes Cluster",
                     buttonText = "Kubernetes Cluster";
-            list_data = util.RESTCalls.getKubernetesClusters();
-            if (list_data.status == 'error') {
-                list_data = null; //TODO endpoint doesn't return correct info
+            listData = util.RESTCalls.getKubernetesClusters();
+            if (listData.status == 'error') {
+                listData = null; //TODO endpoint doesn't return correct info
             }
             break;
 
         case "application-policies":
             formTitle = "Application Policie",
                     buttonText = "Application Policy";
-            list_data = util.RESTCalls.getApplicationPolicies();
-            if (list_data.status == 'error') {
-                list_data = null;
+            listData = util.RESTCalls.getApplicationPolicies();
+            if (listData.status == 'error') {
+                listData = null;
             }
             break;
 
@@ -163,8 +163,8 @@ if(isEdit == false && elements.action != 'new') {
     }
 
 //check user has permission to access endpoints
-    if (list_data != null && list_data.hasOwnProperty('Error')) {
-        error.push(list_data.Error);
+    if (listData != null && listData.hasOwnProperty('Error')) {
+        error.push(listData.Error);
     }
 
 }
@@ -257,7 +257,7 @@ var caramelData = {
     formData: JSON.stringify(formData),
     formtype:elements.formtype,
     buttonText: buttonText,
-    list_data: list_data,
+    listData: listData,
     error: error
 }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index b87f893..e4ee172 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -141,7 +141,7 @@ var render = function (theme, data, meta, require) {
                                 dasStatsPublisherEnabled: data.dasStatsPublisherEnabled,
                                 meteringDashboardUrl: data.meteringDashboardUrl,
                                 content_body: {
-                                    sections: data.list_data
+                                    sections: data.listData
                                 }
                             }
                         }
@@ -396,7 +396,7 @@ var render = function (theme, data, meta, require) {
                                 isEdit: data.isEdit,
                                 formTitle: data.formTitle,
                                 content_body: {
-                                    sections: data.list_data
+                                    sections: data.listData
                                 }
                             }
                         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
index a61121d..b85e59b 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure_form.js
@@ -150,7 +150,7 @@ var render = function (theme, data, meta, require) {
                                 isUpdate: data.isUpdate,
                                 formDataUpdate: data.formDataUpdate,
                                 formDataEdit: data.formDataEdit,
-                                content_body: {sections: data.list_data
+                                content_body: {sections: data.listData
                                 }
                             }
                         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/users_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/users_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/users_form.js
index 434facd..5adf9da 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/users_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/users_form.js
@@ -75,7 +75,7 @@ var render = function (theme, data, meta, require) {
                         formtype:data.formtype,
                         isForm: data.isForm,
                         content_body: {sections:
-                            data.list_data
+                            data.listData
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/daf30f43/components/org.apache.stratos.manager.console/console/users_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/users_form.jag b/components/org.apache.stratos.manager.console/console/users_form.jag
index e9c8b6d..9ca4632 100644
--- a/components/org.apache.stratos.manager.console/console/users_form.jag
+++ b/components/org.apache.stratos.manager.console/console/users_form.jag
@@ -32,7 +32,7 @@ var caramel = require('caramel'),
         context = caramel.configs().context,
         menuJson = require('/controllers/menu/menu.json'),
         userPermissions = session.get('PERMISSIONS'),
-        list_data,
+        listData,
         isForm = false;
 
 if (!elements) {
@@ -57,22 +57,22 @@ var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
 
 if (elements.formtype == 'users') {
     formTitle = 'User';
-    list_data = util.RESTCalls.getUserList();
-    if (list_data.status == 'error') {
-        list_data = null;
+    listData = util.RESTCalls.getUserList();
+    if (listData.status == 'error') {
+        listData = null;
     }
 
 } else if (elements.formtype == 'tenants') {
     formTitle = 'Tenant'
-    list_data = util.RESTCalls.getTenants();
-    if (list_data.status == 'error') {
-        list_data = null;
+    listData = util.RESTCalls.getTenants();
+    if (listData.status == 'error') {
+        listData = null;
     }
 }
 
 //check user has permission to access endpoints
-if (list_data != null && list_data.hasOwnProperty('Error')) {
-    error.push(list_data.Error);
+if (listData != null && listData.hasOwnProperty('Error')) {
+    error.push(listData.Error);
 }
 
 caramel.render({
@@ -83,7 +83,7 @@ caramel.render({
     formDataRaw: JSON.stringify(formDataRaw),
     formData: JSON.stringify(formData),
     formtype:elements.formtype,
-    list_data: list_data,
+    listData: listData,
     left_menu: leftMenu,
     error: error
 });


[6/8] stratos git commit: Removing scaling decision events data from stratos-metering-service capp

Posted by ra...@apache.org.
Removing scaling decision events data from stratos-metering-service capp


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

Branch: refs/heads/stratos-4.1.x
Commit: e4284e28b12ab54bdd33c5f9ded0467c6eeb2b04
Parents: 166f589
Author: Thanuja <th...@wso2.com>
Authored: Wed Oct 7 14:20:57 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../das/metering-service/capps/mysqlscript.sql  |   1 -
 .../ScalingDecisionEventReceiver.xml            |  29 ----
 .../EventReceiver_ScalingDecision/artifact.xml  |  24 ---
 .../EventStore_ScalingDecision/artifact.xml     |  24 ---
 .../scaling_decision.xml                        | 155 -------------------
 .../EventStream_ScalingDecision/artifact.xml    |  24 ---
 .../scaling_decision_1.0.0.json                 |  80 ----------
 .../SaprkScript_ScalingDecision/artifact.xml    |  24 ---
 .../scaling_details.xml                         |  39 -----
 .../stratos-metering-service/artifacts.xml      |   8 -
 10 files changed, 408 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/mysqlscript.sql
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/mysqlscript.sql b/extensions/das/metering-service/capps/mysqlscript.sql
index 7e783a9..71e7dc9 100644
--- a/extensions/das/metering-service/capps/mysqlscript.sql
+++ b/extensions/das/metering-service/capps/mysqlscript.sql
@@ -1,5 +1,4 @@
 CREATE DATABASE ANALYTICS_PROCESSED_DATA_STORE;
 CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_STATUS(Time long, ApplicationId VARCHAR(150), ClusterAlias VARCHAR(150), MemberId VARCHAR(150), MemberStatus VARCHAR(50));
 CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_COUNT(Time long, ApplicationId VARCHAR(150), ClusterAlias VARCHAR(150), CreatedInstanceCount int, InitializedInstanceCount int, ActiveInstanceCount int, TerminatedInstanceCount int);
-CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.SCALING_DETAILS(Time VARCHAR(50), ScalingDecisionId VARCHAR(150), ClusterId VARCHAR(150), MinInstanceCount INT, MaxInstanceCount INT, RIFPredicted INT, RIFThreshold INT ,RIFRequiredInstances INT, MCPredicted INT, MCThreshold INT, MCRequiredInstances INT ,LAPredicted INT, LAThreshold INT,LARequiredInstances INT,RequiredInstanceCount INT ,ActiveInstanceCount INT, AdditionalInstanceCount INT, ScalingReason VARCHAR(150));
 CREATE TABLE ANALYTICS_PROCESSED_DATA_STORE.MEMBER_INFORMATION(MemberId VARCHAR(150), InstanceType VARCHAR(150), ImageId VARCHAR(150), HostName VARCHAR(150), PrivateIPAddresses VARCHAR(150), PublicIPAddresses VARCHAR(150), Hypervisor VARCHAR(150), CPU VARCHAR(10) , RAM VARCHAR(10), OSName VARCHAR(150), OSVersion VARCHAR(150));

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/ScalingDecisionEventReceiver.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/ScalingDecisionEventReceiver.xml b/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/ScalingDecisionEventReceiver.xml
deleted file mode 100644
index 0e0b8f8..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/ScalingDecisionEventReceiver.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<eventReceiver name="ScalingDecisionEventReceiver" statistics="disable"
-               trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
-    <from eventAdapterType="wso2event">
-        <property name="events.duplicated.in.cluster">false</property>
-    </from>
-    <mapping customMapping="disable" type="wso2event"/>
-    <to streamName="scaling_decision" version="1.0.0"/>
-</eventReceiver>

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/artifact.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/artifact.xml b/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/artifact.xml
deleted file mode 100644
index 09d92a2..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventReceiver_ScalingDecision/artifact.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<artifact name="EventReceiver_ScalingDecision" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
-    <file>ScalingDecisionEventReceiver.xml</file>
-</artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/artifact.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/artifact.xml b/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/artifact.xml
deleted file mode 100644
index 554a0a6..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/artifact.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<artifact name="EventStore_ScalingDecision" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer">
-    <file>scaling_decision.xml</file>
-</artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/scaling_decision.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/scaling_decision.xml b/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/scaling_decision.xml
deleted file mode 100644
index 49c07ac..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventStore_ScalingDecision/scaling_decision.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<EventStoreConfiguration>
-    <TableSchema>
-        <ColumnDefinition>
-            <Name>timestamp</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>LONG</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>scaling_decision_id</Name>
-            <EnableIndexing>true</EnableIndexing>
-            <IsPrimaryKey>true</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>STRING</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>cluster_id</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>STRING</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>min_instance_count</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>max_instance_count</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>rif_predicted</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>rif_threshold</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>rif_required_instances</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>mc_predicted</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>mc_threshold</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>mc_required_instances</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>la_predicted</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>la_threshold</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>la_required_instances</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>required_instance_count</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>active_instance_count</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>additional_instance_count</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>INTEGER</Type>
-        </ColumnDefinition>
-        <ColumnDefinition>
-            <Name>scaling_reason</Name>
-            <EnableIndexing>false</EnableIndexing>
-            <IsPrimaryKey>false</IsPrimaryKey>
-            <EnableScoreParam>false</EnableScoreParam>
-            <Type>STRING</Type>
-        </ColumnDefinition>
-    </TableSchema>
-    <Source>
-        <StreamId>scaling_decision:1.0.0</StreamId>
-    </Source>
-    <RecordStoreName>EVENT_STORE</RecordStoreName>
-</EventStoreConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/artifact.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/artifact.xml b/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/artifact.xml
deleted file mode 100644
index 6785af1..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/artifact.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<artifact name="EventStream_ScalingDecision" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
-    <file>scaling_decision_1.0.0.json</file>
-</artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/scaling_decision_1.0.0.json
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/scaling_decision_1.0.0.json b/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/scaling_decision_1.0.0.json
deleted file mode 100644
index fbda1ef..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/EventStream_ScalingDecision/scaling_decision_1.0.0.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
-  "name": "scaling_decision",
-  "version": "1.0.0",
-  "nickName": "Member Information",
-  "description": "Member Information",
-  "payloadData": [
-    {
-      "name": "timestamp",
-      "type": "LONG"
-    },
-    {
-      "name": "scaling_decision_id",
-      "type": "STRING"
-    },
-    {
-      "name": "cluster_id",
-      "type": "STRING"
-    },
-    {
-      "name": "min_instance_count",
-      "type": "INT"
-    },
-    {
-      "name": "max_instance_count",
-      "type": "INT"
-    },
-    {
-      "name": "rif_predicted",
-      "type": "INT"
-    },
-    {
-      "name": "rif_threshold",
-      "type": "INT"
-    },
-    {
-      "name": "rif_required_instances",
-      "type": "INT"
-    },
-    {
-      "name": "mc_predicted",
-      "type": "INT"
-    },
-    {
-      "name": "mc_threshold",
-      "type": "INT"
-    },
-    {
-      "name": "mc_required_instances",
-      "type": "INT"
-    },
-    {
-      "name": "la_predicted",
-      "type": "INT"
-    },
-    {
-      "name": "la_threshold",
-      "type": "INT"
-    },
-    {
-      "name": "la_required_instances",
-      "type": "INT"
-    },
-    {
-      "name": "required_instance_count",
-      "type": "INT"
-    },
-    {
-      "name": "active_instance_count",
-      "type": "INT"
-    },
-    {
-      "name": "additional_instance_count",
-      "type": "INT"
-    },
-    {
-      "name": "scaling_reason",
-      "type": "STRING"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/artifact.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/artifact.xml b/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/artifact.xml
deleted file mode 100644
index 85a5157..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/artifact.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<artifact name="SparkScript_ScalingDecision" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
-    <file>scaling_details.xml</file>
-</artifact>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/scaling_details.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/scaling_details.xml b/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/scaling_details.xml
deleted file mode 100644
index 13ef83e..0000000
--- a/extensions/das/metering-service/capps/stratos-metering-service/SaprkScript_ScalingDecision/scaling_details.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<Analytics>
-    <Name>scaling_details</Name>
-    <Script>
-        CREATE TEMPORARY TABLE scaling_decision
-        USING CarbonAnalytics
-        OPTIONS (tableName "SCALING_DECISION");
-
-        create temporary table scaling_details
-        using CarbonJDBC options (dataSource "WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB", tableName "SCALING_DETAILS");
-
-        INSERT OVERWRITE TABLE scaling_details select time(timestamp),scaling_decision_id, cluster_id,
-        min_instance_count, max_instance_count, rif_predicted, rif_threshold,rif_required_instances, mc_predicted,
-        mc_threshold, mc_required_instances,la_predicted, la_threshold ,la_required_instances,required_instance_count
-        ,active_instance_count, additional_instance_count, scaling_reason from scaling_decision;
-
-    </Script>
-    <CronExpression>29 * * * * ?</CronExpression>
-</Analytics>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e4284e28/extensions/das/metering-service/capps/stratos-metering-service/artifacts.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/artifacts.xml b/extensions/das/metering-service/capps/stratos-metering-service/artifacts.xml
index 94f46c8..6a097e8 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/artifacts.xml
+++ b/extensions/das/metering-service/capps/stratos-metering-service/artifacts.xml
@@ -24,24 +24,16 @@
         <dependency artifact="EventStream_MemberInfo" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
         <dependency artifact="EventStream_MemberLifecycle" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>
-        <dependency artifact="EventStream_ScalingDecision" version="1.0.0" include="true"
-                    serverRole="DataAnalyticsServer"/>
         <dependency artifact="EventStore_MemberInfo" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
         <dependency artifact="EventStore_MemberLifecycle" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>
-        <dependency artifact="EventStore_ScalingDecision" version="1.0.0" include="true"
-                    serverRole="DataAnalyticsServer"/>
         <dependency artifact="EventReceiver_MemberInfo" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>
         <dependency artifact="EventReceiver_MemberLifecycle" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>
-        <dependency artifact="EventReceiver_ScalingDecision" version="1.0.0" include="true"
-                    serverRole="DataAnalyticsServer"/>
         <dependency artifact="SparkScript_MemberInfo" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
         <dependency artifact="SparkScript_MemberLifecycle" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>
-        <dependency artifact="SparkScript_ScalingDecision" version="1.0.0" include="true"
-                    serverRole="DataAnalyticsServer"/>
         <dependency artifact="Gadget_Member_Count" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
         <dependency artifact="Gadget_Member_Information" version="1.0.0" include="true"
                     serverRole="DataAnalyticsServer"/>


[5/8] stratos git commit: Changing message if there is no data available for selected values

Posted by ra...@apache.org.
Changing message if there is no data available for selected values


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

Branch: refs/heads/stratos-4.1.x
Commit: 09e7abb288eed60662c0391f894b17128b50bdb4
Parents: 2c8de71
Author: Thanuja <th...@wso2.com>
Authored: Tue Sep 29 22:21:58 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../Gadget_Member_Count/Member_Count/index.xml  |  2 +-
 .../Gadget_Member_Count/Member_Count/js/main.js | 42 ++++++++++----------
 .../Member_Information/index.xml                |  2 +-
 .../Member_Information/js/main.js               | 39 +++++++++---------
 .../Member_Status/index.xml                     |  2 +-
 .../Member_Status/js/main.js                    | 42 ++++++++++----------
 6 files changed, 62 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/index.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/index.xml b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/index.xml
index 915ad9a..a743efe 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/index.xml
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/index.xml
@@ -73,7 +73,7 @@
                 <div id="placeholder" class="demo-placeholder" style="height:90%"></div>
                 <script language="javascript" type="text/javascript">
                   if(jQuery("#placeholder").html() == ""){
-                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/> Data is not available for plotting</p></b></td></tr><tr><td></td><td><p>The chart will be loaded once the dashboard receives events</p><td/></tr></table></div>');
+                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
                   }
                 </script>
             </body>

http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/js/main.js
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/js/main.js b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/js/main.js
index 0865932..86bf4db 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/js/main.js
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Count/Member_Count/js/main.js
@@ -69,28 +69,26 @@ function fetchData(callback) {
     var cluster = clusterId;
     var time = timeInterval;
 
-    console.log("ApplicationId:" + application);
-    console.log("ClusterId:" + cluster);
-    console.log("Time interval:" + timeInterval);
-
-    var request = {
-        tableName: datasource,
-        applicationId: application,
-        clusterId: cluster,
-        time: time
-    };
-    $.ajax({
-        url: "/portal/apis/member-count",
-        method: "GET",
-        data: request,
-        contentType: "application/json",
-        success: function (data) {
-            if (callback != null) {
-                callback(makeRows(JSON.parse(data)));
+    if (application != "") {
+        var request = {
+            tableName: datasource,
+            applicationId: application,
+            clusterId: cluster,
+            time: time
+        };
+        $.ajax({
+            url: "/portal/apis/member-count",
+            method: "GET",
+            data: request,
+            contentType: "application/json",
+            success: function (data) {
+                if (callback != null) {
+                    callback(makeRows(JSON.parse(data)));
+                }
             }
-        }
-    });
-    dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+        });
+        dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+    }
 }
 
 function makeDataTable(data) {
@@ -163,7 +161,7 @@ function drawChart(data) {
         }
     } else {
         jQuery("#placeholder").html("");
-        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
+        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Data is not available for selected application, cluster and time interval</p></b></td></tr></table></div>');
     }
     //releasing the latch so that we can request data again from the backend.
     dataLoaded = true;

http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/index.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/index.xml b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/index.xml
index 6fcb7d5..75ce04c 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/index.xml
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/index.xml
@@ -76,7 +76,7 @@
                 <div id="placeholder" class="demo-placeholder" style="height:90%"></div>
                 <script language="javascript" type="text/javascript">
                   if(jQuery("#placeholder").html() == ""){
-                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/> Data is not available for plotting with selected values</p></b></td></tr></table></div>');
+                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
                   }
                 </script>
             </body>

http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/js/main.js
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/js/main.js b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/js/main.js
index 0333f2b..54cfea1 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/js/main.js
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Information/Member_Information/js/main.js
@@ -68,26 +68,25 @@ function fetchData(callback) {
     var application = applicationId;
     var cluster = clusterId;
 
-    console.log("ApplicationId:" + application);
-    console.log("ClusterId:" + cluster);
-
-    var request = {
-        tableName: datasource,
-        applicationId: application,
-        clusterId: cluster
-    };
-    $.ajax({
-        url: "/portal/apis/member-info",
-        method: "GET",
-        data: request,
-        contentType: "application/json",
-        success: function (data) {
-            if (callback != null) {
-                callback(makeRows(JSON.parse(data)));
+    if (application != "") {
+        var request = {
+            tableName: datasource,
+            applicationId: application,
+            clusterId: cluster
+        };
+        $.ajax({
+            url: "/portal/apis/member-info",
+            method: "GET",
+            data: request,
+            contentType: "application/json",
+            success: function (data) {
+                if (callback != null) {
+                    callback(makeRows(JSON.parse(data)));
+                }
             }
-        }
-    });
-    dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+        });
+        dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+    }
 }
 
 function makeDataTable(data) {
@@ -161,7 +160,7 @@ function drawChart(data) {
     }
     else {
         jQuery("#placeholder").html("");
-        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
+        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Data is not available for selected application and cluster</p></b></td></tr></table></div>');
     }
     //releasing the latch so that we can request data again from the backend.
     dataLoaded = true;

http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/index.xml
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/index.xml b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/index.xml
index adcb2c4..137897c 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/index.xml
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/index.xml
@@ -75,7 +75,7 @@
                 <div id="placeholder" class="demo-placeholder" style="height:90%"></div>
                 <script language="javascript" type="text/javascript">
                   if(jQuery("#placeholder").html() == ""){
-                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/> Data is not available for plotting with selected values</p></b></td></tr></table></div>');
+                    jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
                   }
                 </script>
             </body>

http://git-wip-us.apache.org/repos/asf/stratos/blob/09e7abb2/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/js/main.js
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/js/main.js b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/js/main.js
index d3aaf6d..a103dd6 100644
--- a/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/js/main.js
+++ b/extensions/das/metering-service/capps/stratos-metering-service/Gadget_Member_Status/Member_Status/js/main.js
@@ -69,28 +69,26 @@ function fetchData(callback) {
     var cluster = clusterId;
     var time = timeInterval;
 
-    console.log("ApplicationId:" + application);
-    console.log("ClusterId:" + cluster);
-    console.log("Time interval:" + timeInterval);
-
-    var request = {
-        tableName: datasource,
-        applicationId: application,
-        clusterId: cluster,
-        time: time
-    };
-    $.ajax({
-        url: "/portal/apis/member-status",
-        method: "GET",
-        data: request,
-        contentType: "application/json",
-        success: function (data) {
-            if (callback != null) {
-                callback(makeRows(JSON.parse(data)));
+    if (application != "") {
+        var request = {
+            tableName: datasource,
+            applicationId: application,
+            clusterId: cluster,
+            time: time
+        };
+        $.ajax({
+            url: "/portal/apis/member-status",
+            method: "GET",
+            data: request,
+            contentType: "application/json",
+            success: function (data) {
+                if (callback != null) {
+                    callback(makeRows(JSON.parse(data)));
+                }
             }
-        }
-    });
-    dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+        });
+        dataLoaded = false;   //setting the latch to locked position so that we block data fetching until we receive the response from backend
+    }
 }
 
 function makeDataTable(data) {
@@ -165,7 +163,7 @@ function drawChart(data) {
         }
     } else {
         jQuery("#placeholder").html("");
-        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Please select an application and cluster to view data</p></b></td></tr></table></div>');
+        jQuery("#placeholder").append('<div id="noChart"><table><tr><td style="padding:30px 20px 0px 20px"><img src="../../portal/images/noEvents.png" align="left" style="width:24;height:24"/></td><td><br/><b><p><br/>Data is not available for selected application, cluster and time interval</p></b></td></tr></table></div>');
     }
     //releasing the latch so that we can request data again from the backend.
     dataLoaded = true;


[3/8] stratos git commit: Adding UI changes to integrate metering dashboard in applications' topology view

Posted by ra...@apache.org.
Adding UI changes to integrate metering dashboard in applications' topology view


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

Branch: refs/heads/stratos-4.1.x
Commit: a43277e7114b727af1d5b7c8202ad563c4efef39
Parents: 09e7abb
Author: Thanuja <th...@wso2.com>
Authored: Tue Oct 6 10:58:12 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../console/applications_form.jag               |  49 ++--
 .../console/controllers/login/login.jag         |  24 +-
 .../theme0/js/custom/applications_topology.js   |  20 +-
 .../theme0/partials/applications_topology.hbs   | 228 ++++++++++---------
 .../theme0/renderers/applications_form.js       | 164 ++++++-------
 .../src/main/conf/cartridge-config.properties   |   3 +
 6 files changed, 252 insertions(+), 236 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index 6f63501..a9f8021 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -32,10 +32,13 @@ var log = new Log("apachestratos.applications_form"),
         uriMatcher = new URIMatcher(request.getRequestURI()),
         elements = uriMatcher.match('/{context}/{formtype}/'),
         breadcrumbPathLevelOne = 'applications',
-        formDataEdit = topologyData = editorGroups = editorCartridges = editorAutoscalePolicies = applicationHbs ='',
-        editorDeploymentPolicies = applicationPolicyData = applicationJSON ='',
-        isEdit  = isForm = false,
-        userPermissions = session.get('PERMISSIONS');
+        formDataEdit = topologyData = editorGroups = editorCartridges = editorAutoscalePolicies = applicationHbs = '',
+        editorDeploymentPolicies = applicationPolicyData = applicationJSON = '',
+        isEdit = isForm = false,
+        userPermissions = session.get('PERMISSIONS'),
+        dasStatsPublisherEnabled = session.get('DAS_STATS_PUBLISHER_ENABLED'),
+        meteringDashboardUrl = '';
+
 
 //create left menu
 var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
@@ -44,7 +47,7 @@ var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
 if (!elements) {
     elements = uriMatcher.match('/{context}/{formtype}/{action}/');
 
-    if(!elements){
+    if (!elements) {
         elements = uriMatcher.match('/{context}/{formtype}/{applicationId}/{action}');
         var applicationName = elements.applicationId;
 
@@ -52,17 +55,16 @@ if (!elements) {
         applicationJSON = util.RESTCalls.getApplicationJSON(applicationName);
         var applicationAlias = applicationJSON.alias;
 
-        if(elements.action == 'view'){
+        if (elements.action == 'view') {
             applicationHbs = 'applicationView';
-        }else if(elements.action == 'deploy'){
+        } else if (elements.action == 'deploy') {
             applicationHbs = 'applicationDeploy';
             applicationPolicyData = util.RESTCalls.getApplicationPolicies();
-        }else if(elements.action == 'signup'){
+        } else if (elements.action == 'signup') {
             applicationHbs = 'applicationSignup';
         }
 
-    }else{
-
+    } else {
         try {
             var formData = require('controllers/forms/schema/applications/' + elements.formtype + '.json'),
                     formDataRaw = require('controllers/forms/default/applications/' + elements.formtype + '.json'),
@@ -80,9 +82,10 @@ if (!elements) {
             //get application json
             applicationJSON = util.RESTCalls.getApplicationJSON(elements.action);
 
-        }else if(elements.formtype == 'applications' && elements.action == 'new'){
+
+        } else if (elements.formtype == 'applications' && elements.action == 'new') {
             applicationHbs = 'applicationEditor';
-            editorGroups =  util.RESTCalls.getGroups();
+            editorGroups = util.RESTCalls.getGroups();
             editorCartridges = util.RESTCalls.getCartridges();
             editorAutoscalePolicies = util.RESTCalls.getPolicyAutoScales();
             editorDeploymentPolicies = util.RESTCalls.getPolicyDeployments();
@@ -106,7 +109,11 @@ switch (formtype) {
         break;
 
     default:
-        error.push({"errorMessage":"Incorrect resource path found"});
+        error.push({"errorMessage": "Incorrect resource path found"});
+}
+
+if (dasStatsPublisherEnabled) {
+    meteringDashboardUrl = session.get('METERING_DASHBOARD_URL');
 }
 var caramelData = {
     breadcrumbPathLevelOne: breadcrumbPathLevelOne,
@@ -119,22 +126,24 @@ var caramelData = {
     editorGroups: JSON.stringify(editorGroups),
     editorCartridges: JSON.stringify(editorCartridges),
     editorAutoscalePolicies: JSON.stringify(editorAutoscalePolicies),
-    editorDeploymentPolicies:JSON.stringify(editorDeploymentPolicies),
+    editorDeploymentPolicies: JSON.stringify(editorDeploymentPolicies),
     applicationHbs: applicationHbs,
-    applicationPolicyData:applicationPolicyData,
-    applicationAlias:applicationAlias,
-    applicationName:applicationName,
-    applicationJSON:JSON.stringify(applicationJSON),
+    applicationPolicyData: applicationPolicyData,
+    applicationAlias: applicationAlias,
+    applicationName: applicationName,
+    applicationJSON: JSON.stringify(applicationJSON),
     applicationStatus: applicationJSON.status,
     formTitle: formTitle,
     formDataRaw: JSON.stringify(formDataRaw),
-    formtype:elements.formtype,
+    formtype: elements.formtype,
     buttonText: buttonText,
     //formDataRaw: JSON.stringify(partition_data.partition[0]),
     formDataEdit: JSON.stringify(formDataEdit),
     formData: JSON.stringify(formData),
     list_data: list_data,
-    error: error
+    error: error,
+    dasStatsPublisherEnabled: dasStatsPublisherEnabled,
+    meteringDashboardUrl: meteringDashboardUrl
 }
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/components/org.apache.stratos.manager.console/console/controllers/login/login.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/login/login.jag b/components/org.apache.stratos.manager.console/console/controllers/login/login.jag
index 4843262..6a78ecf 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/login/login.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/login/login.jag
@@ -24,15 +24,21 @@ var log = new Log("controller.login"),
         util = require('/controllers/rest/rest_calls.jag'),
         server = new carbon.server.Server(),
         conf = carbon.server.loadConfig('carbon.xml'),
-        offset = conf.*::['Ports'].*::['Offset'].text(),
-        hostName = conf.*::['HostName'].text().toString();
+        offset = conf. *::['Ports']. *::['Offset'].text(),
+        hostName = conf. *::['HostName'].text().toString(),
+        conf = carbon.server.loadConfig('thrift-client-config.xml'),
+        dasConfig = conf. *::['config'].(name == "das"),
+        dasStatsPublisherEnabled = dasConfig.statsPublisherEnabled.text();
+
 
 if (hostName === null || hostName === '') {
     hostName = 'localhost';
 }
 
 var httpPort = 9763 + parseInt(offset, 10),
-    httpsPort = 9443 + parseInt(offset, 10);
+        httpsPort = 9443 + parseInt(offset, 10);
+
+var meteringDashboardUrl = process.getProperty("das.metering.dashboard.url");
 
 process.setProperty('server.host', hostName);
 process.setProperty('http.port', httpPort.toString());
@@ -40,7 +46,7 @@ process.setProperty('https.port', httpsPort.toString());
 
 
 var username = request.getParameter('username').trim(),
-    password = request.getParameter('password');
+        password = request.getParameter('password');
 
 if (username || password) {
     session.put("error", "Enter your username and password.");
@@ -49,7 +55,7 @@ if (username || password) {
 try {
     var auth = server.authenticate(username, password);
     if (!auth) {
-        print({ status: 0, "message" : "The username or password you entered is incorrect." });
+        print({status: 0, "message": "The username or password you entered is incorrect."});
     } else {
         var userObject = carbon.server.tenantUser(username);
         var um = new carbon.user.UserManager({}, userObject.tenantId);
@@ -60,6 +66,10 @@ try {
         session.put("TENANT_DOMAIN", userObject.domain);
         session.put("ROLE_ARRAY", roles);
         session.put("TENANT_ID", userObject.tenantId);
+        session.put("DAS_STATS_PUBLISHER_ENABLED", dasStatsPublisherEnabled);
+        if (dasStatsPublisherEnabled) {
+            session.put("METERING_DASHBOARD_URL", meteringDashboardUrl);
+        }
 
         try {
             //get all user permission
@@ -67,8 +77,8 @@ try {
             session.put("PERMISSIONS", userPermissions);
             //call the authentication rest-endpoint and get the JSESSION_ID
             var result = util.RESTCalls.getSession(username, password);
-            if((result == null) || (result.data == null) || (result.data.Success == null)) {
-                print({ "status": 0, "message" : "Login permission is not granted for user." });
+            if ((result == null) || (result.data == null) || (result.data.Success == null)) {
+                print({"status": 0, "message": "Login permission is not granted for user."});
             } else {
                 //save the JSESSION_ID in current console.session.
                 var jSessionId = result.data.Success.sessionId;

http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
index 2bba203..40bdfae 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_topology.js
@@ -20,6 +20,7 @@
  */
 
 var applicationId = '';
+
 //create JSON from topology
 function genTree(data) {
     var rawout = [];
@@ -141,6 +142,7 @@ function genTree(data) {
     return treeData[0];
 }
 
+
 function update(source) {
 
     // ************** Generate the tree diagram	 *****************
@@ -215,8 +217,10 @@ function update(source) {
                     accessURLHTML +
                     "<strong>HostNames: </strong>" + d.hostNames + "<br/>" +
                     "<strong>Service Name: </strong>" + d.serviceName + "<br/>" +
-                    "<strong>Status: </strong>" + d.status + "<br/>" +
-                    "<button class='btn btn-info show-usage' id=" + d.alias + " name='clusterUsage' onClick='showClusterUsage(this.id)'>Show Usage</button>";
+                    "<strong>Status: </strong>" + d.status + "<br/>";
+                if (dasStatsPublisherEnabled) {
+                    div_html += "<button class='btn btn-info show-usage' id=" + d.alias + " name='clusterUsage' onClick='showClusterUsage(this.id)'>Show Usage</button>";
+                }
             } else if (d.type == 'members') {
                 if ((typeof d.ports != 'undefined') && (d.ports.length > 0)) {
                     var portsHTML = "<strong>Ports: </strong></br>";
@@ -249,9 +253,10 @@ function update(source) {
 
             } else {
                 div_html = "<strong>Alias: </strong>" + d.name + "<br/>" +
-                    "<strong>Status: </strong>" + d.status + "<br/>" +
-                    "<button class='btn btn-info show-usage' id=" + d.name + " name='appUsage' onClick='showApplicationUsage(this.id)'>Show Usage</button>";
-
+                    "<strong>Status: </strong>" + d.status + "<br/>";
+                if (dasStatsPublisherEnabled) {
+                    div_html += "<button class='btn btn-info show-usage' id=" + d.name + " name='appUsage' onClick='showApplicationUsage(this.id)'>Show Usage</button>";
+                }
             }
             return div_html;
         });
@@ -604,13 +609,14 @@ $("a[href='#application']").on('shown.bs.tab', function (e) {
     }
 });
 
+
 function showApplicationUsage(id) {
-    window.location = 'https://localhost:9444/portal/dashboards/stratos-metering-dashboard?applicationId=' + applicationId;
+    window.location = meteringDashboardUrl + '?applicationId=' + applicationId;
 }
 
 function showClusterUsage(id, type) {
     var clusterId = id;
-    window.location = 'https://localhost:9444/portal/dashboards/stratos-metering-dashboard?applicationId=' + applicationId + '&clusterId=' + clusterId;
+    window.location = meteringDashboardUrl + '?applicationId=' + applicationId + '&clusterId=' + clusterId;
 }
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
index 72300bc..41eed06 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_topology.hbs
@@ -31,14 +31,16 @@
             <div class='container text-center form-toolbar'>
                 <div class='col-md-1'>
                     <button class='btn btn-default btn-lg' type='button' style="margin-left: -15px; "
-                            onclick='window.location.replace(document.referrer)'> Back</button>
-                    </div>
-        {{#ifCond applicationStatus "==" "Undeploying"}}
-                <div class='col-md-1'>
-                    <button class="btn btn-danger btn-lg" type="button" style="..."
-                            value="{{appName}}" id="force_undeploy">Force Undeploy</button>
+                            onclick='window.location.replace(document.referrer)'> Back
+                    </button>
                 </div>
-        {{/ifCond}}
+                {{#ifCond applicationStatus "==" "Undeploying"}}
+                    <div class='col-md-1'>
+                        <button class="btn btn-danger btn-lg" type="button" style="..."
+                                value="{{appName}}" id="force_undeploy">Force Undeploy
+                        </button>
+                    </div>
+                {{/ifCond}}
             </div>
         </div>
         <!-- Nav tabs -->
@@ -51,8 +53,10 @@
         <div class="tab-content">
             <div class="tab-pane active" id="topology">
                 <div class="topology-buttons">
-                    <a id='export' ><i class="fa fa-save" data-toggle="tooltip" data-placement="top" title="Export as PNG"></i></a>
-                    <i class="fa fa-refresh" id='refresh' data-toggle="tooltip" data-placement="top" title="Refresh Topology"></i>
+                    <a id='export'><i class="fa fa-save" data-toggle="tooltip" data-placement="top"
+                                      title="Export as PNG"></i></a>
+                    <i class="fa fa-refresh" id='refresh' data-toggle="tooltip" data-placement="top"
+                       title="Refresh Topology"></i>
                 </div>
                 <div class="left-side">
                     <div class="panel panel-default">
@@ -61,11 +65,11 @@
                         </div>
                         <div class="panel-body">
                             <div class="keys">
-                                <div><i class="fa fa-square st-active"></i> Active </div>
-                                <div><i class="fa fa-square st-created"></i> Created </div>
-                                <div><i class="fa fa-square st-inactive"></i> Inactive </div>
-                                <div><i class="fa fa-square st-terminated"></i> Terminated </div>
-                                <div><i class="fa fa-square st-other"></i> Other </div>
+                                <div><i class="fa fa-square st-active"></i> Active</div>
+                                <div><i class="fa fa-square st-created"></i> Created</div>
+                                <div><i class="fa fa-square st-inactive"></i> Inactive</div>
+                                <div><i class="fa fa-square st-terminated"></i> Terminated</div>
+                                <div><i class="fa fa-square st-other"></i> Other</div>
                             </div>
                         </div>
                     </div>
@@ -86,114 +90,116 @@
     </div>
 
 </div>
+
 <script type="text/javascript">
     var topologydata = {{{topologyData}}};
     var applicationJSON = {{{applicationJSON}}};
-$(window).load(function() {
+    var dasStatsPublisherEnabled = {{dasStatsPublisherEnabled}};
+    var meteringDashboardUrl = '{{meteringDashboardUrl}}';
+    $(window).load(function () {
 
-    //handled Ajax base session expire issue
-    $(document).ajaxError(function (e, xhr, settings) {
-        window.location.href = '../';
-    });
+        //handled Ajax base session expire issue
+        $(document).ajaxError(function (e, xhr, settings) {
+            window.location.href = '../';
+        });
 
-    //initial generation with deafult call
-    update(genTree(topologydata));
-
-    $('#refresh').click(function(){
-        //get ajax call
-        $(".application-topology").html('<i class="fa fa-spinner fa-pulse fa-4x"></i>');
-        var formtype = 'applicationtopology';
-        var applicationId = "{{appName}}";
-
-        $.ajax({
-            type: "GET",
-            url: caramel.context + "/controllers/applications/application_getrequests.jag",
-            dataType: 'json',
-            data: { "formtype": formtype, "appId":applicationId },
-            success: function (data) {
-                if (data.status == 'error') {
-                    var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
-                    $(".application-topology").html('');
-                } else {
-                    $(".application-topology").html('');
-                    update(genTree(data));
-                    //call canvas update event
-                    canvg('canvasOriginal', new XMLSerializer().serializeToString(svg));
+        //initial generation with deafult call
+        update(genTree(topologydata));
+
+        $('#refresh').click(function () {
+            //get ajax call
+            $(".application-topology").html('<i class="fa fa-spinner fa-pulse fa-4x"></i>');
+            var formtype = 'applicationtopology';
+            var applicationId = "{{appName}}";
+
+            $.ajax({
+                type: "GET",
+                url: caramel.context + "/controllers/applications/application_getrequests.jag",
+                dataType: 'json',
+                data: {"formtype": formtype, "appId": applicationId},
+                success: function (data) {
+                    if (data.status == 'error') {
+                        var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
+                        $(".application-topology").html('');
+                    } else {
+                        $(".application-topology").html('');
+                        update(genTree(data));
+                        //call canvas update event
+                        canvg('canvasOriginal', new XMLSerializer().serializeToString(svg));
+                    }
                 }
-            }
-        })
-    });
+            })
+        });
 
-    //make svg to canvas
-    var svg = $('svg')[0];
-    var canvasOriginal = $('#canvasOriginal')[0];
-    var ctxOriginal = canvasOriginal.getContext('2d');
-    // this saves the inline svg to canvas without external css
-    canvg('canvasOriginal', new XMLSerializer().serializeToString(svg));
-    /**
-     * This is the function that will take care of image extracting and
-     * setting proper filename for the download.
-     * IMPORTANT: Call it from within a onclick event.
-     */
-    function downloadCanvas(link, canvasId, filename) {
-        link.href = document.getElementById(canvasId).toDataURL();
-        link.download = filename;
-    }
-
-    /**
-     * The event handler for the link's onclick event. We give THIS as a
-     * parameter (=the link element), ID of the canvas and a filename.
-     */
-    $('#export').click(function() {
-        downloadCanvas(this, 'canvasOriginal', '{{{appName}}}.png');
-    });
+        //make svg to canvas
+        var svg = $('svg')[0];
+        var canvasOriginal = $('#canvasOriginal')[0];
+        var ctxOriginal = canvasOriginal.getContext('2d');
+        // this saves the inline svg to canvas without external css
+        canvg('canvasOriginal', new XMLSerializer().serializeToString(svg));
+        /**
+         * This is the function that will take care of image extracting and
+         * setting proper filename for the download.
+         * IMPORTANT: Call it from within a onclick event.
+         */
+        function downloadCanvas(link, canvasId, filename) {
+            link.href = document.getElementById(canvasId).toDataURL();
+            link.download = filename;
+        }
+
+        /**
+         * The event handler for the link's onclick event. We give THIS as a
+         * parameter (=the link element), ID of the canvas and a filename.
+         */
+        $('#export').click(function () {
+            downloadCanvas(this, 'canvasOriginal', '{{{appName}}}.png');
+        });
 
-$( "#force_undeploy" ).click(function() {
-var payload =$(this).attr("value");
-  noty({
-            layout: 'bottomRight',
-            type: 'warning',
-            text: 'Are you sure you want to <strong>forcefully undeploy</strong> application: <strong>'
-            +$(this).attr("value") + "</strong> ?",
-            buttons: [
-                {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
-                    var formtype = 'forceundeployapplication';
-                    $noty.close();
-
-                    $.ajax({
-                        type: "POST",
-                        url: caramel.context + "/controllers/applications/application_requests.jag",
-                        dataType: 'json',
-                        data: { "applicationId": payload, "formtype": formtype },
-                        success: function (data) {
-                            if (data.status == 'error') {
-                                var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
-                            } else if (data.status == 'warning') {
-                                var n = noty({text: data.message, layout: 'bottomRight', type: 'warning'});
-                            } else {
-                                var n = noty({text: data.message, layout: 'bottomRight', type: 'success'});
+        $("#force_undeploy").click(function () {
+            var payload = $(this).attr("value");
+            noty({
+                layout: 'bottomRight',
+                type: 'warning',
+                text: 'Are you sure you want to <strong>forcefully undeploy</strong> application: <strong>'
+                + $(this).attr("value") + "</strong> ?",
+                buttons: [
+                    {
+                        addClass: 'btn btn-primary', text: 'Yes', onClick: function ($noty) {
+                        var formtype = 'forceundeployapplication';
+                        $noty.close();
+
+                        $.ajax({
+                            type: "POST",
+                            url: caramel.context + "/controllers/applications/application_requests.jag",
+                            dataType: 'json',
+                            data: {"applicationId": payload, "formtype": formtype},
+                            success: function (data) {
+                                if (data.status == 'error') {
+                                    var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});
+                                } else if (data.status == 'warning') {
+                                    var n = noty({text: data.message, layout: 'bottomRight', type: 'warning'});
+                                } else {
+                                    var n = noty({text: data.message, layout: 'bottomRight', type: 'success'});
+                                }
+                                window.setTimeout(function () {
+                                    window.location.href = '../';
+                                }, 1500);
                             }
-                            window.setTimeout(function(){
-                                window.location.href = '../';
-                            }, 1500);
-                        }
-                    }).always(function () {
-
-                    });
-
-                }
-                },
-                {addClass: 'btn btn-danger', text: 'No', onClick: function($noty) {
-                    $noty.close();
-                }
-                }
-            ]
+                        }).always(function () {
+
+                        });
+
+                    }
+                    },
+                    {
+                        addClass: 'btn btn-danger', text: 'No', onClick: function ($noty) {
+                        $noty.close();
+                    }
+                    }
+                ]
+            });
         });
     });
-});
-
-
-
 
 
 </script>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index e5efbce..b87f893 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -20,7 +20,7 @@
  */
 var render = function (theme, data, meta, require) {
 
-    if(data.error.length === 0 ){
+    if (data.error.length === 0) {
 
         switch (data.applicationHbs) {
             case "applicationView":
@@ -29,16 +29,15 @@ var render = function (theme, data, meta, require) {
                         {
                             partial: 'index_title',
                             context: {
-                                page_title: 'Apache Stratos - Application Managment',
-                                page_description: 'Apache Stratos - Application Managment'
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
                             }
                         }
                     ],
                     header: [
                         {
                             partial: 'index_header',
-                            context: {
-                            }
+                            context: {}
                         }
                     ],
                     sub_header: [
@@ -61,9 +60,7 @@ var render = function (theme, data, meta, require) {
                     right_menu_help: [
                         {
                             partial: 'index_right_menu_help',
-                            context: {
-
-                            }
+                            context: {}
                         }
                     ],
                     content: [
@@ -81,25 +78,24 @@ var render = function (theme, data, meta, require) {
 
                     ]
                 });
-            break;
+                break;
 
             case "applicationTopology":
 
-            theme('index', {
-                page_meta: [
-                    {
-                        partial: 'index_title',
-                        context: {
-                            page_title: 'Apache Stratos - Application Managment',
-                            page_description: 'Apache Stratos - Application Managment'
+                theme('index', {
+                    page_meta: [
+                        {
+                            partial: 'index_title',
+                            context: {
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
+                            }
                         }
-                    }
                     ],
                     header: [
                         {
                             partial: 'index_header',
-                            context: {
-                            }
+                            context: {}
                         }
                     ],
                     sub_header: [
@@ -122,9 +118,7 @@ var render = function (theme, data, meta, require) {
                     right_menu_help: [
                         {
                             partial: 'index_right_menu_help',
-                            context: {
-
-                            }
+                            context: {}
                         }
                     ],
                     content: [
@@ -134,7 +128,7 @@ var render = function (theme, data, meta, require) {
                                 formContext: data.breadcrumbPathLevelTwo,
                                 appName: data.appName,
                                 topologyData: data.topologyData,
-                                applicationJSON:data.applicationJSON,
+                                applicationJSON: data.applicationJSON,
                                 applicationStatus: data.applicationStatus,
                                 form_action: data.form_action,
                                 formHtml: data.formHtml,
@@ -144,14 +138,17 @@ var render = function (theme, data, meta, require) {
                                 isForm: data.isForm,
                                 isEdit: data.isEdit,
                                 formTitle: data.formTitle,
-                                content_body: {sections: data.list_data
+                                dasStatsPublisherEnabled: data.dasStatsPublisherEnabled,
+                                meteringDashboardUrl: data.meteringDashboardUrl,
+                                content_body: {
+                                    sections: data.list_data
                                 }
                             }
                         }
 
                     ]
                 });
-            break;
+                break;
 
             case "applicationDeploy":
                 theme('index', {
@@ -159,16 +156,15 @@ var render = function (theme, data, meta, require) {
                         {
                             partial: 'index_title',
                             context: {
-                                page_title: 'Apache Stratos - Application Managment',
-                                page_description: 'Apache Stratos - Application Managment'
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
                             }
                         }
                     ],
                     header: [
                         {
                             partial: 'index_header',
-                            context: {
-                            }
+                            context: {}
                         }
                     ],
                     sub_header: [
@@ -191,9 +187,7 @@ var render = function (theme, data, meta, require) {
                     right_menu_help: [
                         {
                             partial: 'index_right_menu_help',
-                            context: {
-
-                            }
+                            context: {}
                         }
                     ],
                     content: [
@@ -205,9 +199,9 @@ var render = function (theme, data, meta, require) {
                                 applicationAlias: data.applicationAlias,
                                 applicationJSON: data.applicationJSON,
                                 editorCartridges: data.editorCartridges,
-                                editorGroups:data.editorGroups,
+                                editorGroups: data.editorGroups,
                                 form_action: data.form_action,
-                                applicationPolicyData:data.applicationPolicyData,
+                                applicationPolicyData: data.applicationPolicyData,
                                 formHtml: data.formHtml,
                                 formData: data.formData,
                                 formDataRaw: data.formDataRaw,
@@ -221,7 +215,7 @@ var render = function (theme, data, meta, require) {
 
                     ]
                 });
-            break;
+                break;
 
             case "applicationEditor":
                 theme('index', {
@@ -229,16 +223,15 @@ var render = function (theme, data, meta, require) {
                         {
                             partial: 'index_title',
                             context: {
-                                page_title: 'Apache Stratos - Application Managment',
-                                page_description: 'Apache Stratos - Application Managment'
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
                             }
                         }
                     ],
                     header: [
                         {
                             partial: 'index_header',
-                            context: {
-                            }
+                            context: {}
                         }
                     ],
                     sub_header: [
@@ -261,9 +254,7 @@ var render = function (theme, data, meta, require) {
                     right_menu_help: [
                         {
                             partial: 'index_right_menu_help',
-                            context: {
-
-                            }
+                            context: {}
                         }
                     ],
                     content: [
@@ -273,7 +264,7 @@ var render = function (theme, data, meta, require) {
                                 formContext: data.breadcrumbPathLevelTwo,
                                 appName: data.appName,
                                 editorCartridges: data.editorCartridges,
-                                editorGroups:data.editorGroups,
+                                editorGroups: data.editorGroups,
                                 editorAutoscalePolicies: data.editorAutoscalePolicies,
                                 editorDeploymentPolicies: data.editorDeploymentPolicies,
                                 form_action: data.form_action,
@@ -290,7 +281,7 @@ var render = function (theme, data, meta, require) {
 
                     ]
                 });
-            break;
+                break;
 
             case "applicationSignup":
                 theme('index', {
@@ -298,16 +289,15 @@ var render = function (theme, data, meta, require) {
                         {
                             partial: 'index_title',
                             context: {
-                                page_title: 'Apache Stratos - Application Managment',
-                                page_description: 'Apache Stratos - Application Managment'
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
                             }
                         }
                     ],
                     header: [
                         {
                             partial: 'index_header',
-                            context: {
-                            }
+                            context: {}
                         }
                     ],
                     sub_header: [
@@ -330,9 +320,7 @@ var render = function (theme, data, meta, require) {
                     right_menu_help: [
                         {
                             partial: 'index_right_menu_help',
-                            context: {
-
-                            }
+                            context: {}
                         }
                     ],
                     content: [
@@ -358,99 +346,93 @@ var render = function (theme, data, meta, require) {
                         {
                             partial: 'index_title',
                             context: {
-                                page_title: 'Apache Stratos - Application Managment',
-                                page_description: 'Apache Stratos - Application Managment'
+                                page_title: 'Apache Stratos - Application Management',
+                                page_description: 'Apache Stratos - Application Management'
                             }
                         }
                     ],
-                    header:[
+                    header: [
                         {
                             partial: 'index_header',
-                            context:{
-                            }
+                            context: {}
                         }
                     ],
-                    sub_header:[
+                    sub_header: [
                         {
-                            partial:'index_sub_header',
-                            context:{
-                                breadcrumbPathLevelOne:data.breadcrumbPathLevelOne,
-                                breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo
+                            partial: 'index_sub_header',
+                            context: {
+                                breadcrumbPathLevelOne: data.breadcrumbPathLevelOne,
+                                breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo
                             }
                         }
                     ],
-                    left_menu:[
+                    left_menu: [
                         {
-                            partial:'index_left_menu',
-                            context:{
-                                left_menu:data.left_menu
+                            partial: 'index_left_menu',
+                            context: {
+                                left_menu: data.left_menu
                             }
                         }
                     ],
-                    right_menu_help:[
+                    right_menu_help: [
                         {
-                            partial:'index_right_menu_help',
-                            context:{
-
-                            }
+                            partial: 'index_right_menu_help',
+                            context: {}
                         }
                     ],
                     content: [
                         {
-                            partial:'applications_form',
-                            context:{
+                            partial: 'applications_form',
+                            context: {
                                 formContext: data.breadcrumbPathLevelTwo,
                                 form_action: data.form_action,
                                 formHtml: data.formHtml,
                                 formData: data.formData,
                                 formDataRaw: data.formDataRaw,
                                 formDataEdit: data.formDataEdit,
-                                formtype:data.formtype,
+                                formtype: data.formtype,
                                 buttonText: data.buttonText,
                                 isForm: data.isForm,
-                                isEdit:data.isEdit,
+                                isEdit: data.isEdit,
                                 formTitle: data.formTitle,
-                                content_body: {sections:
-                                    data.list_data
+                                content_body: {
+                                    sections: data.list_data
                                 }
                             }
                         }
 
                     ]
                 });
-            break;
+                break;
 
         }
 
-    }else{
+    } else {
 
         theme('index', {
             page_meta: [
                 {
-                    partial:'index_title',
-                    context:{
-                        page_title:'Apache Stratos Home - Error',
-                        page_description:'Apache Stratos Home - Error'
+                    partial: 'index_title',
+                    context: {
+                        page_title: 'Apache Stratos Home - Error',
+                        page_description: 'Apache Stratos Home - Error'
                     }
                 }
             ],
-            header:[
+            header: [
                 {
                     partial: 'index_header',
-                    context:{
-                    }
+                    context: {}
                 }
             ],
             content: [
 
                 {
                     partial: 'error_page',
-                    context:{
-                        error:data.error,
-                        content_title:'Sorry Something went Wrong...! ',
-                        content_body:{
-
-                        }
+                    context: {
+                        error: data.error,
+                        content_title: 'Sorry Something went Wrong...! ',
+                        content_body: {}
 
                     }
                 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/a43277e7/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties b/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
index 461a54c..c96edb5 100644
--- a/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
+++ b/products/stratos/modules/distribution/src/main/conf/cartridge-config.properties
@@ -22,8 +22,11 @@
 autoscaler.service.url=https://localhost:9443/services/AutoscalerService/
 cloud.controller.service.url=https://localhost:9443/services/CloudControllerService/
 stratos.manager.service.url=https://localhost:9443/services/StratosManagerService/
+das.metering.dashboard.url=https://localhost:9444/portal/dashboards/stratos-metering-dashboard/
 puppet.ip=127.0.0.1
 puppet.hostname=puppet.stratos.apache.org
 puppet.dns.available=false
 puppet.environment=stratos
 
+
+


[7/8] stratos git commit: Adding table name request param validation

Posted by ra...@apache.org.
Adding table name request param validation


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

Branch: refs/heads/stratos-4.1.x
Commit: cdc4d8856d49fdad2f2a09552cc6c04a6b7923dc
Parents: a5b0061
Author: Thanuja <th...@wso2.com>
Authored: Fri Oct 9 11:22:52 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Oct 10 00:51:09 2015 +0530

----------------------------------------------------------------------
 .../das/metering-service/capps/jaggery-files/member-count.jag    | 4 ++--
 .../das/metering-service/capps/jaggery-files/member-info.jag     | 2 +-
 .../das/metering-service/capps/jaggery-files/member-status.jag   | 2 +-
 extensions/das/metering-service/capps/jaggery-files/schema.jag   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cdc4d885/extensions/das/metering-service/capps/jaggery-files/member-count.jag
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/jaggery-files/member-count.jag b/extensions/das/metering-service/capps/jaggery-files/member-count.jag
index 031b3bf..53d4767 100644
--- a/extensions/das/metering-service/capps/jaggery-files/member-count.jag
+++ b/extensions/das/metering-service/capps/jaggery-files/member-count.jag
@@ -27,7 +27,7 @@
     var carbon = require('carbon');
     var configs = require('/configs/designer.json');
 
-    var tableName = request.getParameter(TABLE_NAME);
+    var tableName = encodeURIComponent(request.getParameter(TABLE_NAME));
     if (tableName == null) {
         log.error("Table name param is not provided!");
         response.status = HTTP_INTERNAL_ERROR;
@@ -83,7 +83,7 @@
         if (clusterId == ALL_CLUSTERS) {
             result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '%Y:%m:%d %h:%i') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i'), ApplicationId", applicationId);
         } else {
-            result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '%Y:%m:%d %h:%i') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND ClusterAlias=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i')",applicationId, clusterId);
+            result = db.query("SELECT FROM_UNIXTIME(CEILING( Time/('" + x_axis_interval + "'*1000)) *'" + x_axis_interval + "', '" + time_format + "') AS Time, SUM(CreatedInstanceCount) AS CreatedInstanceCount , SUM(InitializedInstanceCount) AS InitializedInstanceCount , SUM(ActiveInstanceCount) AS ActiveInstanceCount, SUM(TerminatedInstanceCount) AS TerminatedInstanceCount FROM " + tableName + " WHERE ApplicationId=? AND ClusterAlias=? AND Time > ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000-'" + interval + "' ) AND Time <= ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000) GROUP BY FROM_UNIXTIME( CEILING( Time/('" + x_axis_interval + "'*1000)) *'"+x_axis_interval+"', '%Y:%m:%d %h:%i')",applicationId, clusterId);
         }
         print(result);
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/cdc4d885/extensions/das/metering-service/capps/jaggery-files/member-info.jag
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/jaggery-files/member-info.jag b/extensions/das/metering-service/capps/jaggery-files/member-info.jag
index 32b9823..ed7f8e6 100644
--- a/extensions/das/metering-service/capps/jaggery-files/member-info.jag
+++ b/extensions/das/metering-service/capps/jaggery-files/member-info.jag
@@ -27,7 +27,7 @@
     var carbon = require('carbon');
     var configs = require('/configs/designer.json');
 
-    var tableName = request.getParameter(TABLE_NAME);
+    var tableName = encodeURIComponent(request.getParameter(TABLE_NAME));
     if (tableName == null) {
         log.error("Table name param is not provided!");
         response.status = HTTP_INTERNAL_ERROR;

http://git-wip-us.apache.org/repos/asf/stratos/blob/cdc4d885/extensions/das/metering-service/capps/jaggery-files/member-status.jag
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/jaggery-files/member-status.jag b/extensions/das/metering-service/capps/jaggery-files/member-status.jag
index f3db328..be40e78 100644
--- a/extensions/das/metering-service/capps/jaggery-files/member-status.jag
+++ b/extensions/das/metering-service/capps/jaggery-files/member-status.jag
@@ -35,7 +35,7 @@
     var carbon = require('carbon');
     var configs = require('/configs/designer.json');
 
-    var tableName = request.getParameter(TABLE_NAME);
+    var tableName = encodeURIComponent(request.getParameter(TABLE_NAME));
     if (tableName == null) {
         log.error("Table name param is not provided!");
         response.status = HTTP_INTERNAL_ERROR;

http://git-wip-us.apache.org/repos/asf/stratos/blob/cdc4d885/extensions/das/metering-service/capps/jaggery-files/schema.jag
----------------------------------------------------------------------
diff --git a/extensions/das/metering-service/capps/jaggery-files/schema.jag b/extensions/das/metering-service/capps/jaggery-files/schema.jag
index ef5050f..2d076d5 100644
--- a/extensions/das/metering-service/capps/jaggery-files/schema.jag
+++ b/extensions/das/metering-service/capps/jaggery-files/schema.jag
@@ -28,7 +28,7 @@
     var carbon = require('carbon');
     var configs = require('/configs/designer.json');
 
-    var tableName = request.getParameter(TABLE_NAME);
+    var tableName = encodeURIComponent(request.getParameter(TABLE_NAME));
     if (tableName == null) {
         log.error("Table name param is not provided!");
         response.status = HTTP_INTERNAL_ERROR;