You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/12/22 07:29:07 UTC

[01/14] stratos git commit: fix endpoint issue undeploy

Repository: stratos
Updated Branches:
  refs/heads/master c78cac54b -> 7af19f54b


fix endpoint issue undeploy


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

Branch: refs/heads/master
Commit: 2eec2e13d9e6ee04eda0e3e183f7e313b1721fbe
Parents: 62881a8
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:00:27 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/rest/rest_calls.jag                        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2eec2e13/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index 420563e..1df8280 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -76,7 +76,7 @@ RESTCalls = new function(){
     };
 
     this.undeployApplication = function(applicationId){
-        return this.send("DELETE","applications/"+applicationId+"/undeploy",{});
+        return this.send("POST","/applications/"+applicationId+"/undeploy",{});
     };
 
     this.subscribeToCartridge = function(cartridgeBeanInfo){


[10/14] stratos git commit: fix threshold Auto Scaling Policy Definition

Posted by im...@apache.org.
fix threshold Auto Scaling Policy Definition


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

Branch: refs/heads/master
Commit: 7af19f54b9f7f394a0c2b019e1aa37b40f6549d4
Parents: da1a610
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:28:09 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:58 2014 +0530

----------------------------------------------------------------------
 .../default/configure/autoscalingpolicies.json  |  6 ++---
 .../schema/configure/autoscalingpolicies.json   | 24 ++++++++++----------
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/7af19f54/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/autoscalingpolicies.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/autoscalingpolicies.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/autoscalingpolicies.json
index 4fed272..f570efd 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/autoscalingpolicies.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/autoscalingpolicies.json
@@ -5,13 +5,13 @@
     "instanceRoundingFactor": 0.2,
     "loadThresholds": {
         "requestsInFlight": {
-            "upperLimit": 30
+            "threshold": 30
         },
         "memoryConsumption": {
-            "upperLimit": 80
+            "threshold": 80
         },
         "loadAverage": {
-            "upperLimit": 100
+            "threshold": 100
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/7af19f54/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/autoscalingpolicies.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/autoscalingpolicies.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/autoscalingpolicies.json
index 32e79da..f65e758 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/autoscalingpolicies.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/autoscalingpolicies.json
@@ -61,11 +61,11 @@
                         "collapsed": false
                     },
                     "properties":{
-                        "upperLimit": {
+                        "threshold": {
                             "type":"number",
-                            "id": "root/loadThresholds/requestsInFlight/upperLimit",
-                            "title": "Upper Limit",
-                            "name": "Upper Limit",
+                            "id": "root/loadThresholds/requestsInFlight/threshold",
+                            "title": "Threshold",
+                            "name": "Threshold",
                             "default":30,
                             "format": "number",
                             "required":false
@@ -83,11 +83,11 @@
                         "collapsed": false
                     },
                     "properties":{
-                        "upperLimit": {
+                        "threshold": {
                             "type":"number",
-                            "id": "root/loadThresholds/memoryConsumption/upperLimit",
-                            "title": "Upper Limit",
-                            "name": "Upper Limit",
+                            "id": "root/loadThresholds/memoryConsumption/threshold",
+                            "title": "Threshold",
+                            "name": "Threshold",
                             "default":80,
                             "format": "number",
                             "required":false
@@ -105,11 +105,11 @@
                         "collapsed": false
                     },
                     "properties":{
-                        "upperLimit": {
+                        "threshold": {
                             "type":"number",
-                            "id": "root/loadThresholds/loadAverage/upperLimit",
-                            "title": "Upper Limit",
-                            "name": "Upper Limit",
+                            "id": "root/loadThresholds/loadAverage/threshold",
+                            "title": "Threshold",
+                            "name": "Threshold",
                             "default":100,
                             "format": "number",
                             "required":false


[14/14] stratos git commit: Add application undeploy logic to listing

Posted by im...@apache.org.
Add application undeploy logic to listing


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

Branch: refs/heads/master
Commit: ddb0b10685a81b552f7cee7c78c9ff4d5b93b1f3
Parents: 5dfe0f5
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:10:48 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:58 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_form.hbs       | 45 +++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ddb0b106/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
index 43465c2..b2548e3 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_form.hbs
@@ -354,7 +354,7 @@
         noty({
             layout: 'bottomRight',
             type: 'warning',
-            text: 'Are you sure you want to delete application: '+$(this).attr("id"),
+            text: 'Are you sure you want to delete application: <strong>'+$(this).attr("id") + "</strong> ?",
             buttons: [
                 {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
                     var formtype = 'deleteapplication';
@@ -390,4 +390,47 @@
             ]
         });
     });
+
+    $('.general-table').on('click', '.hover-undeploy', function (event) {
+
+        var payload =$(this).attr("id");
+        noty({
+            layout: 'bottomRight',
+            type: 'warning',
+            text: 'Are you sure you want to undeploy application: <strong>'+$(this).attr("id") + "</strong> ?",
+            buttons: [
+                {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
+                    var formtype = 'undeployapplication';
+                    $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(){
+                                location.reload();
+                            }, 1000);
+                        }
+                    }).always(function () {
+
+                    });
+
+                }
+                },
+                {addClass: 'btn btn-danger', text: 'No', onClick: function($noty) {
+                    $noty.close();
+                }
+                }
+            ]
+        });
+    });
 </script>


[05/14] stratos git commit: application topology status and colors added

Posted by im...@apache.org.
application topology status and colors added


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

Branch: refs/heads/master
Commit: 62e333787c16318214c33a600506236c0ab2e6cc
Parents: 237f41c
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Dec 21 22:22:42 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_topology.hbs   | 72 +++++++++++++-------
 1 file changed, 47 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/62e33378/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 1ef99bf..f8e3f6f 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
@@ -24,10 +24,8 @@
 </div>
 <script type="text/javascript">
 $(document).ready(function () {
-    //var topologydata = {{{topology_data}}};
-
-    var topologydata = {"applicationInstances":[{"applicationId":"app_group_v1","groupInstances":[{"clusterInstances":[{"alias":"tom2group6","clusterId":"tom2group6.tomcat2.domain","hostNames":["tom2group6.isuruh.lk"],"instanceId":"mygroup6-1","member":[{"clusterId":"tom2group6.tomcat2.domain","memberId":"tom2group6.tomcat2.domainbdf9cc84-7a2a-4e35-b899-19b7ef4c49be","memberIp":"10.0.0.1","memberPublicIp":"20.0.0.1","networkPartitionId":"openstack_R1","partitionId":"P1","property":[{"name":"PRIMARY","value":false},{"name":"MIN_COUNT","value":1}],"serviceName":"tomcat2","status":"Activated"}],"parentInstanceId":"mygroup6-1","serviceName":"tomcat2","status":"Active","tenantRange":"*"}],"groupId":"mygroup6","instanceId":"mygroup6-1","parentInstanceId":"app_group_v1-1","status":"Active"},{"clusterInstances":[{"alias":"tom2group6","clusterId":"tom2group6.tomcat2.domain","hostNames":["tom2group6.isuruh.lk"],"instanceId":"mygroup6-2","member":[{"clusterId":"tom2group6.tomcat2.domain","memb
 erId":"tom2group6.tomcat2.domain6ddee85f-ce49-4409-b1f1-05adaef55c68","memberIp":"10.0.0.2","memberPublicIp":"20.0.0.2","networkPartitionId":"openstack_R1","partitionId":"P1","property":[{"name":"PRIMARY","value":false},{"name":"MIN_COUNT","value":1}],"serviceName":"tomcat2","status":"Activated"}],"parentInstanceId":"mygroup6-2","serviceName":"tomcat2","status":"Active","tenantRange":"*"}],"groupId":"mygroup6","instanceId":"mygroup6-2","parentInstanceId":"app_group_v1-1","status":"Active"}],"instanceId":"app_group_v1-1","status":"Active"}],"id":"app_group_v1","tenantAdminUsername":"admin","tenantDomain":"carbon.super"};
-//create JSON from topology
+    var topologydata = {{{topology_data}}};
+    //create JSON from topology
     function genTree(data){
         var rawout = [];
 
@@ -55,9 +53,14 @@ $(document).ready(function () {
             for(var prop in items){
                 if (items.hasOwnProperty(prop)) {
                     var cur_name = items[prop].clusterId,
+                            alias = items[prop].alias,
+                            hostNames = items[prop].hostNames.toString(),
+                            serviceName = items[prop].serviceName,
                             status = items[prop].status;
-                    var type = 'cluster';
-                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status});
+                    var type = 'clusters';
+                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status,
+                        "alias":alias, "hostNames": hostNames, "serviceName": serviceName
+                    });
                     clustermembers(items[prop].member, collector, cur_name)
                 }
             }
@@ -84,9 +87,16 @@ $(document).ready(function () {
             for(var prop in items){
                 if (items.hasOwnProperty(prop)) {
                     var cur_name = items[prop].memberId,
+                            defaultPrivateIP = items[prop].defaultPrivateIP,
+                            defaultPublicIP = items[prop].defaultPublicIP,
+                            networkPartitionId = items[prop].networkPartitionId,
+                            partitionId = items[prop].partitionId,
                             status = items[prop].status;
-                    var type = 'member';
-                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status});
+                    var type = 'members';
+                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status,
+                        "defaultPrivateIP":defaultPrivateIP, "defaultPublicIP":defaultPublicIP,
+                        "networkPartitionId":networkPartitionId, "partitionId":partitionId
+                    });
                 }
             }
         }
@@ -183,18 +193,28 @@ $(document).ready(function () {
                             .duration(200)
                             .style("opacity", .9);
 
-                    if (d.type == 'cluster') {
+                    if (d.type == 'clusters') {
                         div.html(
-                                        "<strong>Cluster ID: </strong>" + d.clusterId + "<br/>" +
-                                        "<strong>Is Lb Cluster: </strong>" + d.isLbCluster
+                                        "<strong>Cluster Alias: </strong>" + d.alias + "<br/>" +
+                                        "<strong>HostNames: </strong>" + d.hostNames + "<br/>" +
+                                        "<strong>Service Name: </strong>" + d.serviceName + "<br/>" +
+                                        "<strong>Status: </strong>" + d.status
                         ).style("left", (d3.event.pageX) + "px")
                                 .style("top", (d3.event.pageY - 28) + "px");
-                    } else if (d.type == 'member') {
+                    } else if (d.type == 'members') {
                         div.html(
-                                        "<strong>Cluster Id: </strong>" + d.clusterId + "<br/>" +
+                                        "<strong>Member Id: </strong>" + d.name + "<br/>" +
+                                        "<strong>Default Private IP: </strong>" + d.defaultPrivateIP + "<br/>" +
+                                        "<strong>Default Public IP: </strong>" + d.defaultPublicIP + "<br/>" +
+                                        "<strong>Network Partition Id: </strong>" + d.networkPartitionId + "<br/>" +
                                         "<strong>Partition Id: </strong>" + d.partitionId + "<br/>" +
-                                        "<strong>Member Id: </strong>" + d.memberId + "<br/>" +
-                                        "<strong>Member Public Ip: </strong>" + d.memberPublicIp
+                                        "<strong>Status: </strong>" + d.status
+                        ).style("left", (d3.event.pageX) + "px")
+                                .style("top", (d3.event.pageY - 28) + "px");
+                    } else if (d.type == 'groups') {
+                        div.html(
+                                        "<strong>Group Id: </strong>" + d.name + "<br/>" +
+                                        "<strong>Status: </strong>" + d.status
                         ).style("left", (d3.event.pageX) + "px")
                                 .style("top", (d3.event.pageY - 28) + "px");
                     } else {
@@ -217,13 +237,15 @@ $(document).ready(function () {
                 .attr("width", 30)
                 .attr("height", 30)
                 .style("fill", function (d) {
-                    if (d.type == 'cluster') {
-                        return "#e74c3c";
-                    } else if (d.type == 'groups') {
-                        return "#2ecc71";
-                    } else if (d.type == 'member') {
-                        return "#9b59b6";
-                    } else {
+                    if (d.status == 'Active' || d.status == 'Activated') {
+                        return "#1abc9c";
+                    } else if (d.status == 'Created') {
+                        return "#e67e22";
+                    } else if (d.status == 'Inactive') {
+                        return "#7f8c8d";
+                    } else if (d.status == 'Terminated') {
+                        return "#c0392b";
+                    }else{
                         return "#1abc9c";
                     }
                 });
@@ -231,11 +253,11 @@ $(document).ready(function () {
         nodeEnter.append("image")
                 .attr("xlink:href",
                 function (d) {
-                    if (d.type == 'cluster') {
+                    if (d.type == 'clusters') {
                         return "../../../themes/theme0/images/topology/cluster.png";
                     } else if (d.type == 'groups') {
                         return "../../../themes/theme0/images/topology/group.png";
-                    } else if (d.type == 'member') {
+                    } else if (d.type == 'members') {
                         return "../../../themes/theme0/images/topology/member.png";
                     } else {
                         return "../../../themes/theme0/images/topology/application.png";
@@ -255,7 +277,7 @@ $(document).ready(function () {
                 .attr("dy", ".35em")
                 .attr("text-anchor", "middle")
                 .text(function (d) {
-                    if(d.type == 'member'){
+                    if(d.type == 'members'){
                        return '';
                     }else{
                         return d.name;


[06/14] stratos git commit: application_getrequest for topology ajax update

Posted by im...@apache.org.
application_getrequest for topology ajax update


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

Branch: refs/heads/master
Commit: 1279dc7ae436ea1e4f62466e05742ef1e8a1d4eb
Parents: 22cdfc6
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 10:01:23 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../applications/application_getrequests.jag    | 47 ++++++++++++++++++++
 1 file changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1279dc7a/components/org.apache.stratos.manager.console/console/controllers/applications/application_getrequests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_getrequests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_getrequests.jag
new file mode 100644
index 0000000..41a769e
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_getrequests.jag
@@ -0,0 +1,47 @@
+<%
+/*
+ *
+ * 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.
+ *
+ */
+var log = new Log("apachestratos.configure_request"),
+        util = require('/controllers/rest/rest_calls.jag'),
+        formtype = request.getParameter('formtype'),
+        applicationId = request.getParameter('appId'),
+        formSubmit;
+
+//add login validator for pages
+include('/controllers/login/validator.jag');
+
+try {
+    switch (formtype) {
+        case "applicationtopology":
+            formSubmit = util.RESTCalls.getApplicationTopology(applicationId);
+            break;
+        default:
+            session.put("deploy-status", { "message": "Sorry Endpoint Error", "status": "error" });
+
+    }
+    print(formSubmit);
+} catch (e) {
+    log.warn(e);
+    print({"status": 'error', "message": e.toString()});
+}
+
+
+%>
\ No newline at end of file


[12/14] stratos git commit: fix endpoint issue undeploy on application requests

Posted by im...@apache.org.
fix endpoint issue undeploy on  application requests


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

Branch: refs/heads/master
Commit: 5dfe0f5c1c9005d720771e64254686a18419e46e
Parents: 2eec2e1
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:09:47 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:58 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/applications/application_requests.jag   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5dfe0f5c/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
index 27735fa..5d1534b 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
@@ -23,7 +23,7 @@ var log = new Log("apachestratos.configure_request"),
         util = require('/controllers/rest/rest_calls.jag'),
         formPayload = request.getParameter('formPayload'),
         formtype = request.getParameter('formtype'),
-        applicationId = request.getParameter('appId'),
+        applicationId = request.getParameter('applicationId'),
         formSubmit;
 
 //add login validator for pages
@@ -43,6 +43,9 @@ try {
         case "deleteapplication":
             formSubmit = util.RESTCalls.deleteApplication(formPayload);
             break;
+        case "undeployapplication":
+            formSubmit = util.RESTCalls.undeployApplication(applicationId);
+            break;
         default:
             session.put("deploy-status", { "message": "Sorry Endpoint Error", "status": "error" });
 


[08/14] stratos git commit: topology view with live refresh

Posted by im...@apache.org.
topology view with live refresh


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

Branch: refs/heads/master
Commit: 92e00d2241f7d19e95dc81f1efae2e7a2882b206
Parents: 1279dc7
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 10:02:11 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_topology.hbs   | 139 +++++++++++--------
 1 file changed, 82 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/92e00d22/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 f8e3f6f..8e33914 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
@@ -12,7 +12,7 @@
                     <button class='btn btn-default btn-lg' type='button' onclick='window.location.replace(document.referrer)'> Back</button>
                 </div>
                 <div class='col-md-10'>
-                    <button class='btn btn-info btn-lg pull-right' type='button' id='deploy' data-form=''>Refresh </button>
+                    <button class='btn btn-info btn-lg pull-right' type='button' id='refresh' data-form=''>Refresh </button>
                 </div>
             </div>
         </div>
@@ -104,70 +104,65 @@ $(document).ready(function () {
         //getting execution logic
         applicationInstances(data.applicationInstances, rawout, data.id);
 
-        return rawout;
-    }
+        //generate tree from raw data
+        var data = rawout;
+        //data mapping with d3js tree
+        var dataMap = data.reduce(function (map, node) {
+            map[node.name] = node;
+            return map;
+        }, {});
+        var treeData = [];
+        data.forEach(function (node) {
+            // add to parent
+            var parent = dataMap[node.parent];
+            if (parent) {
+                // create child array if it doesn't exist
+                (parent.children || (parent.children = []))
+                    // add node to child array
+                        .push(node);
+            } else {
+                // parent is null or missing
+                treeData.push(node);
+            }
+        });
 
+        return treeData[0];
+    }
 
-//generate tree from raw data
-    var data = genTree(topologydata);
-    //data mapping with d3js tree
-    var dataMap = data.reduce(function (map, node) {
-        map[node.name] = node;
-        return map;
-    }, {});
-    var treeData = [];
-    data.forEach(function (node) {
-        // add to parent
-        var parent = dataMap[node.parent];
-        if (parent) {
-            // create child array if it doesn't exist
-            (parent.children || (parent.children = []))
-                // add node to child array
-                    .push(node);
-        } else {
-            // parent is null or missing
-            treeData.push(node);
-        }
-    });
+    function update(source) {
 
-// ************** Generate the tree diagram	 *****************
-    var margin = {top: 40, right: 120, bottom: 20, left: 120},
-            width = 960 - margin.right - margin.left,
-            height = 900 - margin.top - margin.bottom;
-
-    var i = 0;
-
-    var tree = d3.layout.tree()
-            .separation(function(a, b) { return ((a.parent == root) && (b.parent == root)) ? 5 : 4; })
-            .size([height+100, width]);
-
-    var diagonal = d3.svg.diagonal()
-            .projection(function (d) {
-                return [d.x, d.y];
-            });
-    function redraw() {
-        svg.attr("transform",
-                        "translate(" + d3.event.translate + ")"
-                        + " scale(" + d3.event.scale + ")");
-    }
+        // ************** Generate the tree diagram	 *****************
+        var margin = {top: 40, right: 120, bottom: 20, left: 120},
+                width = 960 - margin.right - margin.left,
+                height = 900 - margin.top - margin.bottom;
 
-    var svg = d3.select(".application-topology").append("svg")
-            .attr("width", width + margin.right + margin.left)
-            .attr("height", height + margin.top + margin.bottom)
-            .call(d3.behavior.zoom().on("zoom", redraw))
-            .append("g");
+        var i = 0;
 
-    var i = 0;
-    duration = 750;
+        var tree = d3.layout.tree()
+                .separation(function(a, b) { return ((a.parent == source) && (b.parent == source)) ? 5 : 4; })
+                .size([height+100, width]);
 
-    root = treeData[0];
+        var diagonal = d3.svg.diagonal()
+                .projection(function (d) {
+                    return [d.x, d.y];
+                });
+        function redraw() {
+            svg.attr("transform",
+                            "translate(" + d3.event.translate + ")"
+                            + " scale(" + d3.event.scale + ")");
+        }
 
-    update(root);
+        var svg = d3.select(".application-topology").append("svg")
+                .attr("width", width + margin.right + margin.left)
+                .attr("height", height + margin.top + margin.bottom)
+                .call(d3.behavior.zoom().on("zoom", redraw))
+                .append("g");
 
-    function update(source) {
+        var i = 0;
+        duration = 750;
 
         // Compute the new tree layout.
-        var nodes = tree.nodes(root).reverse(),
+        var nodes = tree.nodes(source).reverse(),
                 links = tree.links(nodes);
 
         // Normalize for fixed-depth.
@@ -195,6 +190,7 @@ $(document).ready(function () {
 
                     if (d.type == 'clusters') {
                         div.html(
+                                        "<strong>Cluster Id: </strong>" + d.name + "<br/>" +
                                         "<strong>Cluster Alias: </strong>" + d.alias + "<br/>" +
                                         "<strong>HostNames: </strong>" + d.hostNames + "<br/>" +
                                         "<strong>Service Name: </strong>" + d.serviceName + "<br/>" +
@@ -277,8 +273,10 @@ $(document).ready(function () {
                 .attr("dy", ".35em")
                 .attr("text-anchor", "middle")
                 .text(function (d) {
-                    if(d.type == 'members'){
-                       return '';
+                    if(d.type == 'members') {
+                        return '';
+                    }else if(d.type == 'clusters'){
+                        return d.alias;
                     }else{
                         return d.name;
                     }
@@ -304,5 +302,32 @@ $(document).ready(function () {
 
     }
 
+    //initial generation with deafult call
+    update(genTree(topologydata));
+
+    $('#refresh').click(function(){
+        //get ajax call
+        $(".application-topology").html('<i class="fa fa-spinner fa-spin 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));
+                }
+            }
+        })
+    });
+
+
 });
 </script>
\ No newline at end of file


[02/14] stratos git commit: fix endpoint issue undeploy

Posted by im...@apache.org.
fix endpoint issue undeploy


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

Branch: refs/heads/master
Commit: 62881a87e7b93ddb5ccaa4bb9b9c7ad6f45feef7
Parents: 77a57ff
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 10:40:12 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/rest/rest_calls.jag                        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/62881a87/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index ffc9831..420563e 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -76,7 +76,7 @@ RESTCalls = new function(){
     };
 
     this.undeployApplication = function(applicationId){
-        return this.send("DELETE","applications/"+applicationId+"/runtime",{});
+        return this.send("DELETE","applications/"+applicationId+"/undeploy",{});
     };
 
     this.subscribeToCartridge = function(cartridgeBeanInfo){


[11/14] stratos git commit: remove unwanted JSON Schemas and deafults

Posted by im...@apache.org.
remove unwanted JSON Schemas and deafults


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

Branch: refs/heads/master
Commit: 760109a6eaf7100e104a4e348c9f65ea43aa2645
Parents: ddb0b10
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:25:15 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:58 2014 +0530

----------------------------------------------------------------------
 .../forms/default/configure/application.json    |   1 -
 .../forms/default/configure/loadbalancer.json   |  46 ----
 .../forms/default/configure/multitenant.json    |  10 -
 .../forms/default/configure/partitions.json     |  16 --
 .../forms/schema/configure/application.json     |   1 -
 .../forms/schema/configure/loadbalancer.json    | 263 -------------------
 .../forms/schema/configure/multitenant.json     |  71 -----
 .../forms/schema/configure/partitions.json      |  89 -------
 8 files changed, 497 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/application.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/application.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/application.json
deleted file mode 100644
index 9e26dfe..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/application.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/loadbalancer.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/loadbalancer.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/loadbalancer.json
deleted file mode 100644
index 5379db2..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/loadbalancer.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
-    "type":"lb",
-    "isPublic":false,
-    "provider":"lb",
-    "host":"stratos.org",
-    "displayName":"load balancer",
-    "description":"LB Cartridge",
-    "version":"4",
-    "defaultAutoscalingPolicy":"economyPolicy",
-    "portMapping":[
-        {
-            "protocol":"http",
-            "port":"8280",
-            "proxyPort":"8280"
-        },
-        {
-            "protocol":"https",
-            "port":"8243",
-            "proxyPort":"8243"
-        }
-    ],
-    "iaasProvider":[
-        {
-            "type":"ec2",
-            "imageId":"ap-southeast-1/amiĀ­-70326522",
-            "maxInstanceLimit":"5",
-            "property":[
-                {
-                    "name":"instanceType",
-                    "value":"m1.medium"
-                },
-                {
-                    "name":"keyPair",
-                    "value":"xxxxxx"
-                }
-            ]
-        }
-    ],
-
-    "property":[
-        {
-            "name":"load.balancer",
-            "value":"true"
-        }
-    ]
-} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/multitenant.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/multitenant.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/multitenant.json
deleted file mode 100644
index 4d5d423..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/multitenant.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "serviceName": "appserver",
-    "isPublic":"true",
-    "cartridgeType": "appserver",
-    "deploymentPolicyName": "D1",
-    "autoscalingPolicyName": "AS1",
-    "clusterDomain": "appserverdev.dev.domain",
-    "clusterSubDomain": "subdomain2",
-    "tenantRange": "*"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/partitions.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/partitions.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/partitions.json
deleted file mode 100644
index a970f29..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/partitions.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-    "id": "P1",
-    "description":"partition description",
-    "isPublic":false,
-    "provider": "ec2",
-    "property": [
-        {
-            "name": "region",
-            "value": "ap-southeast-1"
-        },
-        {
-            "name": "zone",
-            "value": "ap-southeast-1a"
-        }
-    ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/application.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/application.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/application.json
deleted file mode 100644
index 9e26dfe..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/application.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/loadbalancer.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/loadbalancer.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/loadbalancer.json
deleted file mode 100644
index 42ba217..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/loadbalancer.json
+++ /dev/null
@@ -1,263 +0,0 @@
-{
-    "type": "object",
-    "$schema": "http://json-schema.org/draft-04/schema",
-    "id": "root",
-    "title": "Load Balancer Definition",
-    "name": "Load Balancer",
-    "options": {
-        "disable_properties": true,
-        "disable_collapse": true
-    },
-    "required": ["type", "provider", "host", "displayName", "description", "version", "portMapping"],
-    "properties": {
-        "type": {
-            "type": "string",
-            "id": "root/type",
-            "title": "Type",
-            "name": "Type",
-            "default": "lb",
-            "propertyOrder": 1,
-            "maxItems": 1
-        },
-        "isPublic": {
-            "type": "boolean",
-            "id": "root/isPublic",
-            "title": "Is Public",
-            "name": "Is Public",
-            "default": false,
-            "propertyOrder": 2,
-            "maxItems": 1
-        },
-        "provider": {
-            "type": "string",
-            "id": "root/provider",
-            "title": "Provider",
-            "name": "Provider",
-            "default": "lb",
-            "propertyOrder": 3,
-            "maxItems": 1
-        },
-        "host": {
-            "type": "string",
-            "id": "root/host",
-            "title": "Host",
-            "name": "Host",
-            "default": "stratos.org",
-            "propertyOrder": 4,
-            "maxItems": 1
-        },
-        "displayName": {
-            "type": "string",
-            "id": "root/displayName",
-            "title": "Display Name",
-            "name": "Display Name",
-            "default": "load balancer",
-            "propertyOrder": 5,
-            "maxItems": 1
-        },
-        "description": {
-            "type": "string",
-            "id": "root/description",
-            "title": "Description",
-            "name": "Description",
-            "default": "LB Cartridge",
-            "propertyOrder": 6,
-            "maxItems": 1
-        },
-        "version": {
-            "type": "string",
-            "id": "root/version",
-            "title": "Version",
-            "name": "Version",
-            "default": "4",
-            "propertyOrder": 7,
-            "maxItems": 1
-        },
-        "defaultAutoscalingPolicy": {
-            "type": "string",
-            "id": "root/defaultAutoscalingPolicy",
-            "title": "Default Autoscaling Policy",
-            "name": "Default Autoscaling Policy",
-            "default": "economyPolicy",
-            "required": false
-        },
-        "portMapping": {
-            "type": "array",
-            "id": "root/portMapping",
-            "title": "Port Mapping",
-            "name": "Port Mapping",
-            "items": [
-                {
-                    "type": "object",
-                    "id": "root/portMapping/0",
-                    "required": ["port", "protocol", "proxyPort"],
-                    "format": "grid",
-                    "properties": {
-                        "protocol": {
-                            "type": "string",
-                            "id": "root/portMapping/0/protocol",
-                            "title": "Protocol",
-                            "name": "Protocol",
-                            "default": "http"
-                        },
-                        "port": {
-                            "type": "number",
-                            "id": "root/portMapping/0/port",
-                            "title": "Port",
-                            "name": "Port",
-                            "default": "8280",
-                            "format": "number"
-                        },
-                        "proxyPort": {
-                            "type": "number",
-                            "id": "root/portMapping/0/proxyPort",
-                            "title": "Proxy Port",
-                            "name": "Proxy Port",
-                            "default": "8280",
-                            "format": "number"
-                        }
-                    }
-                },
-                {
-                    "type": "object",
-                    "id": "root/portMapping/1",
-                    "required": false,
-                    "format": "grid",
-                    "properties": {
-                        "protocol": {
-                            "type": "string",
-                            "id": "root/portMapping/1/protocol",
-                            "title": "Protocol",
-                            "name": "Protocol",
-                            "default": "https"
-                        },
-                        "port": {
-                            "type": "number",
-                            "id": "root/portMapping/1/port",
-                            "title": "Port",
-                            "name": "Port",
-                            "default": "8243",
-                            "format": "number"
-                        },
-                        "proxyPort": {
-                            "type": "number",
-                            "id": "root/portMapping/1/proxyPort",
-                            "title": "Proxy Port",
-                            "name": "Proxy Port",
-                            "default": "8243",
-                            "format": "number"
-                        }
-                    }
-                }
-            ]
-        },
-        "iaasProvider": {
-            "type": "array",
-            "id": "root/iaasProvider",
-            "title": "iaas Provider",
-            "name": "iaas Provider",
-            "required": false,
-            "items": {
-                "type": "object",
-                "id": "root/iaasProvider/0",
-                "format": "grid",
-                "required": ["type", "imageId", "maxInstanceLimit"],
-                "properties": {
-                    "type": {
-                        "type": "string",
-                        "id": "root/iaasProvider/0/type",
-                        "title": "Type",
-                        "name": "Type",
-                        "default": "ec2"
-                    },
-                    "imageId": {
-                        "type": "string",
-                        "id": "root/iaasProvider/0/imageId",
-                        "title": "Image ID",
-                        "name": "Image ID",
-                        "default": "ap-southeast-1/amiĀ­-70326522"
-                    },
-                    "maxInstanceLimit": {
-                        "type": "number",
-                        "id": "root/iaasProvider/0/maxInstanceLimit",
-                        "title": "Max Instance Limit",
-                        "name": "Max Instance Limit",
-                        "default": "5",
-                        "format": "number"
-                    },
-                    "property": {
-                        "type": "array",
-                        "id": "root/iaasProvider/0/property",
-                        "required": false,
-                        "items": [
-                            {
-                                "type": "object",
-                                "id": "root/iaasProvider/0/property/0",
-                                "format": "grid",
-                                "required": ["name", "value"],
-                                "properties": {
-                                    "name": {
-                                        "type": "string",
-                                        "id": "root/iaasProvider/0/property/0/name",
-                                        "default": "instanceType"
-                                    },
-                                    "value": {
-                                        "type": "string",
-                                        "id": "root/iaasProvider/0/property/0/value",
-                                        "default": "m1.medium"
-                                    }
-                                }
-                            },
-                            {
-                                "type": "object",
-                                "id": "root/iaasProvider/0/property/1",
-                                "required": false,
-                                "format": "grid",
-                                "properties": {
-                                    "name": {
-                                        "type": "string",
-                                        "id": "root/iaasProvider/0/property/1/name",
-                                        "default": "keyPair",
-                                        "required": false
-                                    },
-                                    "value": {
-                                        "type": "string",
-                                        "id": "root/iaasProvider/0/property/1/value",
-                                        "default": "xxxxxx",
-                                        "required": false
-                                    }
-                                }
-                            }
-                        ]
-                    }
-                }
-            }
-
-
-        },
-        "property": {
-            "type": "array",
-            "id": "root/property",
-            "required": false,
-            "items": {
-                "type": "object",
-                "id": "root/property/0",
-                "required": false,
-                "properties": {
-                    "name": {
-                        "type": "string",
-                        "id": "root/property/0/name",
-                        "default": "load.balancer",
-                        "required": false
-                    },
-                    "value": {
-                        "type": "string",
-                        "id": "root/property/0/value",
-                        "default": "true",
-                        "required": false
-                    }
-                }
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/multitenant.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/multitenant.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/multitenant.json
deleted file mode 100644
index 31616e5..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/multitenant.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
-    "type":"object",
-    "$schema": "http://json-schema.org/draft-04/schema",
-    "id": "root",
-    "title": "Multi-Tenant Service Definition",
-    "name": "Service Definition",
-    "options": {
-        "disable_properties": true,
-        "disable_collapse": true
-    },
-    "required":["serviceName","cartridgeType","deploymentPolicyName","autoscalingPolicyName","clusterDomain",
-        "clusterSubDomain","tenantRange"],
-    "properties":{
-        "serviceName": {
-            "type":"string",
-            "id": "root/serviceName",
-            "title": "Service Name",
-            "name": "Service Name",
-            "default": "appserver"
-        },
-        "isPublic": {
-            "type":"string",
-            "id": "root/isPublic",
-            "title": "Is Public",
-            "name": "Is Public",
-            "default": "true"
-        },
-        "cartridgeType": {
-            "type":"string",
-            "id": "root/cartridgeType",
-            "title": "Cartridge Type",
-            "name": "Cartridge Type",
-            "default": "appserver"
-        },
-        "deploymentPolicyName": {
-            "type":"string",
-            "id": "root/deploymentPolicyName",
-            "title": "Deployment Policy Name",
-            "name": "Deployment Policy Name",
-            "default": "D1"
-        },
-        "autoscalingPolicyName": {
-            "type":"string",
-            "id": "root/autoscalingPolicyName",
-            "title": "Autoscaling Policy Name",
-            "name": "Autoscaling Policy Name",
-            "default": "AS1"
-        },
-        "clusterDomain": {
-            "type":"string",
-            "id": "root/clusterDomain",
-            "title": "Cluster Domain",
-            "name": "Cluster Domain",
-            "default": "appserverdev.dev.domain"
-        },
-        "clusterSubDomain": {
-            "type":"string",
-            "id": "root/clusterSubDomain",
-            "title": "Cluster Sub Domain",
-            "name": "Cluster Sub Domain",
-            "default": "subdomain2"
-        },
-        "tenantRange": {
-            "type":"string",
-            "title": "Tenant Range",
-            "name": "Tenant Range",
-            "id": "root/tenantRange",
-            "default": "*"
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/760109a6/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
deleted file mode 100644
index 1209c93..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/partitions.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
-    "type":"object",
-    "$schema": "http://json-schema.org/draft-04/schema",
-    "id": "root",
-    "title": "Partition Definition",
-    "name": "Partition",
-    "options": {
-        "disable_properties": true,
-        "disable_collapse": true
-    },
-    "required" : ["id","provider","property"],
-    "properties":{
-        "id": {
-            "type":"string",
-            "title": "Partition ID",
-            "name": "Partition ID",
-            "id": "root/id",
-            "default": "P1",
-            "maxItems":1
-        },
-        "description": {
-            "type":"string",
-            "id": "root/description",
-            "title": "Description",
-            "name": "Description",
-            "maxItems":1
-        },
-        "isPublic": {
-            "type":"boolean",
-            "id": "root/isPublic",
-            "title": "Is Public",
-            "name": "Is Public",
-            "default": false,
-            "maxItems":1
-        },
-        "provider": {
-            "type":"string",
-            "id": "root/provider",
-            "title": "Provider",
-            "name": "Provider",
-            "default": "ec2",
-            "enum": ["ec2", "openstack", "vcloud"],
-        },
-        "property": {
-            "readonly":true,
-            "type":"array",
-            "id": "root/property",
-            "items":[
-                {
-                    "type":"object",
-                    "id": "root/property/0",
-                    "format": "grid",
-                    "required":["name", "value"],
-                        "properties":{
-                        "name": {
-                            "type":"string",
-                            "id": "root/property/0/name",
-                            "default": "region"
-                        },
-                        "value": {
-                            "type":"string",
-                            "id": "root/property/0/value",
-                            "default": "ap-southeast-1"
-                        }
-                    }
-                },
-                {
-                    "type":"object",
-                    "id": "root/property/1",
-                    "format": "grid",
-                    "properties":{
-                        "name": {
-                            "type":"string",
-                            "id": "root/property/1/name",
-                            "default": "zone"
-                        },
-                        "value": {
-                            "type":"string",
-                            "id": "root/property/1/value",
-                            "default": "ap-southeast-1a"
-
-                        }
-                    }
-                }
-            ]
-
-        }
-    }
-}
\ No newline at end of file


[04/14] stratos git commit: cleanup extra info logs

Posted by im...@apache.org.
cleanup extra info logs


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

Branch: refs/heads/master
Commit: 22cdfc6c5693ac7d9893dd17e07d8ac7316b6d18
Parents: 62e3337
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 07:20:01 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/applications/application_requests.jag      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/22cdfc6c/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
index 0f555cd..27735fa 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/applications/application_requests.jag
@@ -25,7 +25,7 @@ var log = new Log("apachestratos.configure_request"),
         formtype = request.getParameter('formtype'),
         applicationId = request.getParameter('appId'),
         formSubmit;
-log.info(formPayload)
+
 //add login validator for pages
 include('/controllers/login/validator.jag');
 


[03/14] stratos git commit: add topology view with instances

Posted by im...@apache.org.
add topology view with instances


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

Branch: refs/heads/master
Commit: 237f41c7bc77b3ecc20472ecb7b0e8841880d00f
Parents: c78cac5
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sun Dec 21 21:12:38 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../theme0/partials/applications_topology.hbs   | 120 ++++++++++---------
 1 file changed, 64 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/237f41c7/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 e2a3bee..1ef99bf 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
@@ -5,93 +5,96 @@
         </div>
     </div>
 
-        <div class='container' id='content'>
-            <div class='row'>
-                <div class='container text-center form-toolbar'>
-                    <div class='col-md-2'>
-                       <button class='btn btn-default btn-lg' type='button' onclick='window.location.replace(document.referrer)'> Back</button>
-                    </div>
-                    <div class='col-md-10'>
-                        <button class='btn btn-info btn-lg pull-right' type='button' id='deploy' data-form=''>Refresh </button>
-                    </div>
+    <div class='container' id='content'>
+        <div class='row'>
+            <div class='container text-center form-toolbar'>
+                <div class='col-md-2'>
+                    <button class='btn btn-default btn-lg' type='button' onclick='window.location.replace(document.referrer)'> Back</button>
+                </div>
+                <div class='col-md-10'>
+                    <button class='btn btn-info btn-lg pull-right' type='button' id='deploy' data-form=''>Refresh </button>
                 </div>
             </div>
-            <div class="application-topology">
+        </div>
+        <div class="application-topology">
 
-            </div>
         </div>
+    </div>
 
 </div>
 <script type="text/javascript">
 $(document).ready(function () {
-    var topologydata = {{{topology_data}}};
-//create JSON from topology
-    function genTree(data) {
+    //var topologydata = {{{topology_data}}};
 
+    var topologydata = {"applicationInstances":[{"applicationId":"app_group_v1","groupInstances":[{"clusterInstances":[{"alias":"tom2group6","clusterId":"tom2group6.tomcat2.domain","hostNames":["tom2group6.isuruh.lk"],"instanceId":"mygroup6-1","member":[{"clusterId":"tom2group6.tomcat2.domain","memberId":"tom2group6.tomcat2.domainbdf9cc84-7a2a-4e35-b899-19b7ef4c49be","memberIp":"10.0.0.1","memberPublicIp":"20.0.0.1","networkPartitionId":"openstack_R1","partitionId":"P1","property":[{"name":"PRIMARY","value":false},{"name":"MIN_COUNT","value":1}],"serviceName":"tomcat2","status":"Activated"}],"parentInstanceId":"mygroup6-1","serviceName":"tomcat2","status":"Active","tenantRange":"*"}],"groupId":"mygroup6","instanceId":"mygroup6-1","parentInstanceId":"app_group_v1-1","status":"Active"},{"clusterInstances":[{"alias":"tom2group6","clusterId":"tom2group6.tomcat2.domain","hostNames":["tom2group6.isuruh.lk"],"instanceId":"mygroup6-2","member":[{"clusterId":"tom2group6.tomcat2.domain","memb
 erId":"tom2group6.tomcat2.domain6ddee85f-ce49-4409-b1f1-05adaef55c68","memberIp":"10.0.0.2","memberPublicIp":"20.0.0.2","networkPartitionId":"openstack_R1","partitionId":"P1","property":[{"name":"PRIMARY","value":false},{"name":"MIN_COUNT","value":1}],"serviceName":"tomcat2","status":"Activated"}],"parentInstanceId":"mygroup6-2","serviceName":"tomcat2","status":"Active","tenantRange":"*"}],"groupId":"mygroup6","instanceId":"mygroup6-2","parentInstanceId":"app_group_v1-1","status":"Active"}],"instanceId":"app_group_v1-1","status":"Active"}],"id":"app_group_v1","tenantAdminUsername":"admin","tenantDomain":"carbon.super"};
+//create JSON from topology
+    function genTree(data){
         var rawout = [];
 
-        var rootnode = {};
+        var rootnode ={};
         rootnode.name = data.id;
         rootnode.parent = null;
         //create initial root node
         rawout.push(rootnode);
 
-        //use to get cluster nodes
-        function secondorylevelclusters(item, collector, parent) {
-            for (var prop in item) {
-                if (item.hasOwnProperty(prop)) {
-                    var cur_name = item[prop].serviceName,
-                            clusterId = item[prop].clusterId,
-                            type = 'cluster',
-                            isLbCluster = item[prop].isLbCluster;
-                    rawout.push({"name": clusterId, "parent": parent, "clusterId": clusterId, "type": type,
-                        "isLbCluster": isLbCluster
-                    });
-                    clustermembers(item[prop].member, rawout, clusterId)
+        //application instances
+        function applicationInstances(items, collector, parent){
+            for(var prop in items){
+                if (items.hasOwnProperty(prop)) {
+                    var cur_name = items[prop].instanceId,
+                            status = items[prop].status;
+                    rawout.push({"name": cur_name, "parent": parent, "status": status});
+
+                    clusterInstances(items[prop].clusterInstances, collector, cur_name);
+                    groupInstances(items[prop].groupInstances, collector, cur_name)
                 }
             }
         }
 
-        //use to get member nodes on cluster
-        function clustermembers(item, collector, parent) {
-            for (var prop in item) {
-                if (item.hasOwnProperty(prop)) {
-                    var cur_name = item[prop].memberIp,
-                            clusterId = item[prop].clusterId,
-                            type = 'member',
-                            memberId = item[prop].memberId,
-                            status = item[prop].status,
-                            memberPublicIp = item[prop].memberPublicIp,
-                            partitionId = item[prop].partitionId;
-                    rawout.push({"name": cur_name, "parent": parent, "clusterId": clusterId, "type": type,
-                        "memberId": memberId, "status": status, "memberPublicIp": memberPublicIp,
-                        "partitionId": partitionId
-                    });
+        function clusterInstances(items, collector, parent){
+            for(var prop in items){
+                if (items.hasOwnProperty(prop)) {
+                    var cur_name = items[prop].clusterId,
+                            status = items[prop].status;
+                    var type = 'cluster';
+                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status});
+                    clustermembers(items[prop].member, collector, cur_name)
                 }
-
             }
-
         }
 
-        function secondarylevelgroups(item, collector, parent) {
-            for (var prop in item) {
-                if (item.hasOwnProperty(prop)) {
-                    var cur_name = item[prop].alias;
+        function groupInstances(items, collector, parent){
+            for(var prop in items){
+                if (items.hasOwnProperty(prop)) {
+                    var cur_name = items[prop].groupId,
+                            status = items[prop].status;
                     var type = 'groups';
-                    rawout.push({"name": cur_name, "parent": parent, "type": type});
-                    if (item[prop].hasOwnProperty('subGroups')) {
-                        secondarylevelgroups(item[prop].subGroups, rawout, cur_name);
+                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status});
+
+                    clusterInstances(items[prop].clusterInstances, collector, cur_name);
+                    if(items[prop].hasOwnProperty('groupInstances')){
+                        groupInstances(items[prop].groupInstances, collector, cur_name)
                     }
-                    secondorylevelclusters(item[prop].clusters, rawout, cur_name);
 
                 }
             }
         }
 
-        secondorylevelclusters(data.clusters, rawout, data.id);
-        secondarylevelgroups(data.groups, rawout, data.id);
-        return rawout;
+        function clustermembers(items, collector, parent){
+            for(var prop in items){
+                if (items.hasOwnProperty(prop)) {
+                    var cur_name = items[prop].memberId,
+                            status = items[prop].status;
+                    var type = 'member';
+                    rawout.push({"name": cur_name, "parent": parent, "type": type, "status": status});
+                }
+            }
+        }
 
+        //getting execution logic
+        applicationInstances(data.applicationInstances, rawout, data.id);
+
+        return rawout;
     }
 
 
@@ -252,7 +255,12 @@ $(document).ready(function () {
                 .attr("dy", ".35em")
                 .attr("text-anchor", "middle")
                 .text(function (d) {
-                    return d.name;
+                    if(d.type == 'member'){
+                       return '';
+                    }else{
+                        return d.name;
+                    }
+
                 })
                 .style("fill-opacity", 1);
 


[13/14] stratos git commit: remove loadbalancer from cartridge definition

Posted by im...@apache.org.
remove loadbalancer from cartridge definition


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

Branch: refs/heads/master
Commit: da1a610a72a0210276abd1b61cd8d8c383194178
Parents: 760109a
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 11:25:57 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:58 2014 +0530

----------------------------------------------------------------------
 .../forms/default/configure/cartridges.json     |  7 ----
 .../forms/schema/configure/cartridges.json      | 36 --------------------
 2 files changed, 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/da1a610a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/cartridges.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/cartridges.json b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/cartridges.json
index 780264d..82c9d35 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/cartridges.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/default/configure/cartridges.json
@@ -46,13 +46,6 @@
             ]
         }
     ],
-    "loadBalancer":{
-        "type":"lb",
-        "property":{
-            "name":"default.load.balancer",
-            "value":"true"
-        }
-    },
     "persistence": {
         "isRequired": "true",
         "volume" : [

http://git-wip-us.apache.org/repos/asf/stratos/blob/da1a610a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/cartridges.json
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/cartridges.json b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/cartridges.json
index 33c916e..f48590c 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/cartridges.json
+++ b/components/org.apache.stratos.manager.console/console/controllers/forms/schema/configure/cartridges.json
@@ -294,42 +294,6 @@
 
 
         },
-        "loadBalancer": {
-            "type": "object",
-            "id": "root/loadBalancer",
-            "title": "Load Balancer",
-            "name": "Load Balancer",
-            "required": ["type", "property"],
-            "properties": {
-                "type": {
-                    "type": "string",
-                    "id": "root/loadBalancer/type",
-                    "title": "Type",
-                    "name": "Type",
-                    "default": "lb"
-                },
-                "property": {
-                    "type": "object",
-                    "id": "root/loadBalancer/property",
-                    "title": "Property",
-                    "name": "Property",
-                    "required": ["name", "value"],
-                    "properties": {
-                        "name": {
-                            "type": "string",
-                            "id": "root/loadBalancer/property/name",
-                            "default": "default.load.balancer"
-                        },
-                        "value": {
-                            "type": "string",
-                            "id": "root/loadBalancer/property/value",
-                            "default": "true"
-                        }
-                    }
-                }
-
-            }
-        },
         "persistence": {
             "type": "object",
             "id": "root/persistence",


[09/14] stratos git commit: undeploy application added

Posted by im...@apache.org.
undeploy application added


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

Branch: refs/heads/master
Commit: 4d366afbd2e869793d8021c1db9503456b6da627
Parents: 92e00d2
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 10:28:01 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../console/controllers/rest/rest_calls.jag                      | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4d366afb/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
index e301f75..ffc9831 100644
--- a/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
+++ b/components/org.apache.stratos.manager.console/console/controllers/rest/rest_calls.jag
@@ -75,6 +75,10 @@ RESTCalls = new function(){
         return this.send("DELETE","/applications/" + applicationId,{});
     };
 
+    this.undeployApplication = function(applicationId){
+        return this.send("DELETE","applications/"+applicationId+"/runtime",{});
+    };
+
     this.subscribeToCartridge = function(cartridgeBeanInfo){
         return this.sendReceive("POST","/cartridge/subscribe", cartridgeBeanInfo);
     };


[07/14] stratos git commit: updated with applicationId

Posted by im...@apache.org.
updated with applicationId


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

Branch: refs/heads/master
Commit: 77a57ff7ab9142407a5c820108a790d9b6af92da
Parents: 4d366af
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon Dec 22 10:30:37 2014 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Mon Dec 22 11:58:57 2014 +0530

----------------------------------------------------------------------
 .../console/themes/theme0/js/custom/applications-deploy.js         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/77a57ff7/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
index d3c96e7..2d435f9 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-deploy.js
@@ -217,7 +217,7 @@ $(document).ready(function(){
             type: "POST",
             url: caramel.context + "/controllers/applications/application_requests.jag",
             dataType: 'json',
-            data: { "formPayload": deployjson, "formtype": formtype, "appId":applicationId },
+            data: { "formPayload": deployjson, "formtype": formtype, "applicationId":applicationId },
             success: function (data) {
                 if (data.status == 'error') {
                     var n = noty({text: data.message, layout: 'bottomRight', type: 'error'});