You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/05/31 06:35:51 UTC

[01/25] git commit: updated refs/heads/master to 2f29185

Updated Branches:
  refs/heads/master 7934b1631 -> 2f2918594


Dedicate POD -UI and API integration code


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

Branch: refs/heads/master
Commit: aab0bb4d31a7ee602ea7d2b30f58ffb5a569f534
Parents: 2564345
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 14 16:46:02 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:09 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aab0bb4d/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index fc0c70f..1b1f61d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8600,7 +8600,7 @@
                          dataType:"json",
                          success:function(json){
                              var dedicatedObj = json.dedicatepodresponse.host;
-                             args.response.success({data:item});
+                             args.response.success({ data: $.extend(item, dedicatedObj)});
 
                          },
 


[05/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Cluster  UI/API Integration code


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

Branch: refs/heads/master
Commit: c5493f0778d71d8c8335712b0e383a074f91fbef
Parents: 60ff005
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 11:19:18 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c5493f07/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8133509..f76b534 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9430,21 +9430,47 @@
                   clusterName = hostname + "/" + dcName + "/" + clusterName; //override clusterName
                 }
                 array1.push("&clustername=" + todb(clusterName));
-
+                var clusterId = null;
                 $.ajax({
                   url: createURL("addCluster" + array1.join("")),
                   dataType: "json",
                   async: true,
                   success: function(json) {
                     var item = json.addclusterresponse.cluster[0];
-                    args.response.success({
+                    clusterId= json.addclusterresponse.cluster[0].id;
+                /*    args.response.success({
 										  data: $.extend(item, { state: 'Enabled' })
 										});
                   },
                   error: function(XMLHttpResponse) {
                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                     args.response.error(errorMsg);
-                  }
+                  }*/
+                  
+                  //EXPLICIT DEDICATION
+                if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+                    }
+
+                    if(hostId != null){
+                      $.ajax({
+                         url:createURL("dedicateCluster&clusterId=" +clusterId +"&domainId=" +args.data.domainId + array2.join("")),
+                         dataType:"json",
+                         success:function(json){
+                             var dedicatedObj = json.dedicateclusterresponse.cluster;
+                             args.response.success({  data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
+
+                         },
+
+                         error:function(json){
+                           args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                         }
+                       });
+                   }
+                 }
+
                 });
               },
 


[13/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Cluster detail View  UI-API Integration code


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

Branch: refs/heads/master
Commit: e95ddb656231cd6825a241a85aca3eca6e614c21
Parents: 6aa2268
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon May 27 16:15:49 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:13 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e95ddb65/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index e39171a..1ee2ab2 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9769,7 +9769,13 @@
                     //allocationstate: { label: 'label.allocation.state' },
                     //managedstate: { label: 'Managed State' },
 										state: { label: 'label.state' }
-                  }
+                  },
+
+                   {
+                    isdedicated:{label:'Dedicated'},
+                    domainid:{label:'Domain ID'}
+                   }
+
                 ],
                 dataProvider: function(args) {
 									$.ajax({


[24/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication : Zone


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

Branch: refs/heads/master
Commit: e94c8176d2401f3bd59770a7c77ada3021b02c70
Parents: 5fe0d02
Author: Pranav Saxena <pr...@citrix.com>
Authored: Thu May 30 18:08:04 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:17 2013 +0530

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c8176/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 809b83a..04ed495 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -348,11 +348,18 @@
           
 	  }													
 										
-          setTimeout(function() {
+      /*    setTimeout(function() {
             if ($form.find('input[name=ispublic]').is(':checked')) {
-              $form.find('[rel=domain]').hide();
+              $form.find('[rel=domain]').show();
+              $form.find('[rel=accountId]').show();
             }
-          });
+ 
+            else{
+
+              $form.find('[rel=domain]').hide();
+              $form.find('[rel=accountId]').hide();
+             }             
+          });*/
         },
         fields: {
           name: {
@@ -541,7 +548,7 @@
             validation: { required: false }
           },
           ispublic: {
-            isReverse: true,
+            //isReverse: true,
             isBoolean: true,
             label: 'Dedicate',
             isChecked: false //checked by default (public zone)
@@ -1597,8 +1604,10 @@
             array1.push("&internaldns2=" + todb(internaldns2));
 
 					if(args.data.pluginFrom == null) { //from zone wizard, not from quick instsaller(args.data.pluginFrom != null && args.data.pluginFrom.name == 'installWizard') who doesn't have public checkbox
-					//	if(args.data.zone.ispublic != null) //public checkbox in zone wizard is unchecked 
+					//	if(args.data.zone.ispublic != null){ //public checkbox in zone wizard is unchecked 
 					//		array1.push("&domainid=" + args.data.zone.domain);
+                                                       
+                                              // }
           }
 					
           if(args.data.zone.networkdomain != null && args.data.zone.networkdomain.length > 0)
@@ -1622,13 +1631,13 @@
                 if(args.data.pluginFrom == null && args.data.zone.ispublic != null){
                       var array2 = [];
                       if(args.data.zone.domain != null)
-                         array2.push("&domainid=" + args.data.zone.domain);
+                        array2.push("&domainid=" + args.data.zone.domain);
                       if(args.data.zone.accountId != "")
                         array2.push("&accountId=" +todb(args.data.zone.accountId));
 
                       if(dedicatedZoneId != null){
                       $.ajax({
-                         url:createURL("dedicateZone&ZoneId=" +dedicatedZoneId +"&domain=" +args.data.zone.domain + array2.join("")),
+                         url:createURL("dedicateZone&ZoneId=" +dedicatedZoneId + array2.join("")),
                          dataType:"json",
                          success:function(json){
                              var dedicatedObj = json.dedicatezoneresponse.jobid;


[22/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication through zone wizard


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

Branch: refs/heads/master
Commit: 5fe0d028a2ae0b62d84169c78ecd72c1d499437b
Parents: 8c79aa8
Author: Pranav Saxena <pr...@citrix.com>
Authored: Thu May 30 16:28:25 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:16 2013 +0530

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5fe0d028/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 5a8bcfd..809b83a 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -543,8 +543,8 @@
           ispublic: {
             isReverse: true,
             isBoolean: true,
-            label: 'label.public',
-            isChecked: true //checked by default (public zone)
+            label: 'Dedicate',
+            isChecked: false //checked by default (public zone)
           },
           domain: {
             label: 'label.domain',
@@ -1597,8 +1597,8 @@
             array1.push("&internaldns2=" + todb(internaldns2));
 
 					if(args.data.pluginFrom == null) { //from zone wizard, not from quick instsaller(args.data.pluginFrom != null && args.data.pluginFrom.name == 'installWizard') who doesn't have public checkbox
-						if(args.data.zone.ispublic == null) //public checkbox in zone wizard is unchecked 
-							array1.push("&domainid=" + args.data.zone.domain);
+					//	if(args.data.zone.ispublic != null) //public checkbox in zone wizard is unchecked 
+					//		array1.push("&domainid=" + args.data.zone.domain);
           }
 					
           if(args.data.zone.networkdomain != null && args.data.zone.networkdomain.length > 0)
@@ -1619,8 +1619,10 @@
 
                dedicatedZoneId = json.createzoneresponse.zone.id;
                 //EXPLICIT ZONE DEDICATION
-                if(args.data.pluginFrom == null && args.data.zone.ispublic == null){
+                if(args.data.pluginFrom == null && args.data.zone.ispublic != null){
                       var array2 = [];
+                      if(args.data.zone.domain != null)
+                         array2.push("&domainid=" + args.data.zone.domain);
                       if(args.data.zone.accountId != "")
                         array2.push("&accountId=" +todb(args.data.zone.accountId));
 


[09/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Host  UI-API Integration code


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

Branch: refs/heads/master
Commit: 6aa2268efb9bc1f45a932c2a8a11b65f3e3215f7
Parents: 9f76c05
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon May 27 16:05:03 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:12 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   38 ++++++++++++++++++++++++++------------
 1 files changed, 26 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6aa2268e/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 45b0f43..e39171a 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9520,7 +9520,12 @@
                          }
                        });
                    }
-                 }
+                 },
+                 error: function(XMLHttpResponse) {
+                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+                    args.response.error(errorMsg);
+                  }
+
 
                 });
               },
@@ -10441,14 +10446,6 @@
                     var item = json.addhostresponse.host[0];
                     hostId = json.addhostresponse.host[0].id;
 
-               /*     args.response.success({
-                      data: item
-                    });
-                  },
-                  error: function(XMLHttpResponse) {
-                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                    args.response.error(errorMsg);
-                  }*/
 
                        //EXPLICIT DEDICATION
                 if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
@@ -10462,8 +10459,19 @@
                          url:createURL("dedicateHost&hostId=" +hostId +"&domainId=" +args.data.domainId + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicatehostresponse.host;
-                             args.response.success({  data: $.extend(item, dedicatedObj) });
+                             var jid = json.dedicatehostresponse.host.jobid;
+                             //args.response.success({  data: $.extend(item, dedicatedObj) });
+                              args.response.success({
+                                 _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+
+                             data:item
+
+                            });
 
                          },
 
@@ -10472,7 +10480,13 @@
                          }
                        });
                    }
-                 }
+                 },
+
+                   error: function(XMLHttpResponse) {
+                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+                    args.response.error(errorMsg);
+                  }
+
                 });
               },
 


[18/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
host and cluster action item API integration calls


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

Branch: refs/heads/master
Commit: 1545b3f3ed7ba21a4d5c475418b130f521c7d1f0
Parents: e03e2aa
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 20:21:02 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:15 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |  220 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 201 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1545b3f3/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 3b0cf86..02e13bd 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9953,14 +9953,40 @@
 										success: function(json) {
 											var item = json.listclustersresponse.cluster[0];
 											addExtraPropertiesToClusterObject(item);
-											args.response.success({
-												actionFilter: clusterActionfilter,
-												data: item
-											});
-										}
-									});
-                }
-              },
+								             $.ajax({
+                                                                                url:createURL("listDedicatedClusters&clusterid=" +args.context.clusters[0].id),
+                                                                                dataType:"json",
+                                                                                async:false,
+                                                                                success:function(json){
+                                                                                  if(json.listdedicatedclustersresponse.dedicatedcluster != undefined){
+                                                                                  var clusterItem = json.listdedicatedclustersresponse.dedicatedcluster[0];
+                                                                                  if (clusterItem.domainid != null) {
+                                                                                       $.extend(item, clusterItem , { isdedicated: 'Yes' });
+                                                                                     }
+                                                                                   }
+                                                                                  else
+                                                                                     $.extend(item ,{ isdedicated: 'No' })
+
+                                                                                    },
+                                                                                  error:function(json){
+                                                                                     args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                                                                                      }
+                                                                                   });
+                                                                             args.response.success({
+                                                                                   actionFilter: clusterActionfilter,
+                                                                                   data: item
+                                                                                });
+
+                                                                           },
+
+                                                                            error:function(json){
+                                                                               args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+
+                                                                        }
+
+                 });
+              }
+          },
               nexusVswitch: {
                 title:'label.nexusVswitch',
                 listView: {
@@ -10709,6 +10735,127 @@
                 }
               },
 
+
+               dedicate:{
+                   label: 'Dedicate Host',
+                messages: {
+                  confirm: function(args) {
+                    return 'Do you really want to dedicate this host to a domain/account? ';
+                  },
+                  notification: function(args) {
+                    return 'Host Dedicated';
+                  }
+                },
+                createForm:{
+                   title:'Dedicate Host',
+                   fields:{
+                         domainId:{
+                      label:'Domain',
+                      validation:{required:true},
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                       }
+                   },
+                  accountId:{
+                     label:'Account',
+                    // docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  }
+
+
+                     }
+                },
+
+                action: function(args) {
+                     //EXPLICIT DEDICATION
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+
+                    $.ajax({
+                    url: createURL("dedicateHost&hostId=" + args.context.hosts[0].id + "&domainId=" +args.data.domainId + array2.join("") ),
+                    dataType: "json",
+                    success: function(json) {
+                       var jid = json.dedicatehostresponse.jobid;
+                            args.response.success({
+                               _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:hostActionfilter
+
+
+                          });
+
+                   /*   args.response.success({
+                        actionFilter: podActionfilter,
+                        data:item
+                      });*/
+                    }
+                  });
+                }
+
+              },
+
+              
+               release:{
+                label:'Release Dedicated Host',
+                messages:{
+                   confirm: function(args) {
+                    return 'Do you want to release this dedicated host ?';
+                  },
+                  notification: function(args) {
+                    return 'Host dedication released';
+                  }
+                },
+               action:function(args){
+                  $.ajax({
+                     url:createURL("releaseDedicatedHost&hostid=" + args.context.hosts[0].id),
+                     dataType:"json",
+                     async:true,
+                     success:function(json){
+                       var jid = json.releasededicatedhostresponse.jobid;
+                       args.response.success({
+                             _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:hostActionfilter
+
+                       });
+                     },
+                    error:function(args){
+                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    }
+                  });
+
+               }
+              },
+
+
               enableMaintenanceMode: {
                 label: 'label.action.enable.maintenance.mode',
                 action: function(args) {
@@ -10927,20 +11074,49 @@
                     ipaddress: { label: 'label.ip.address' },
                     version: { label: 'label.version' },
                     disconnected: { label: 'label.last.disconnected' }
-                  }
+                  },
+
+                   {
+
+                   isdedicated:{label:'Dedicated'},
+                   domainid:{label:'Domain ID'}
+
+                   }
+
+
                 ],
 
                 dataProvider: function(args) {								  
-									$.ajax({
-										url: createURL("listHosts&id=" + args.context.hosts[0].id),
-										dataType: "json",
-										async: true,
-										success: function(json) {										  
-											var item = json.listhostsresponse.host[0];
-											args.response.success({
-												actionFilter: hostActionfilter,
-												data: item
-											});
+					        $.ajax({
+							url: createURL("listHosts&id=" + args.context.hosts[0].id),
+							dataType: "json",
+							async: true,
+							success: function(json) {										  
+								var item = json.listhostsresponse.host[0];
+                                                                $.ajax({
+                                                                  url:createURL("listDedicatedHosts&hostid=" +args.context.hosts[0].id),
+                                                                  dataType:"json",
+                                                                  async:false,
+                                                                  success:function(json){
+                                                                      if(json.listdedicatedhostsresponse.dedicatedhost != undefined){
+                                                                      var hostItem = json.listdedicatedhostsresponse.dedicatedhost[0];
+                                                                      if (hostItem.domainid != null) {
+                                                                             $.extend(item, hostItem , { isdedicated: 'Yes' });
+                                                                            }
+                                                                         }
+                                                                           else
+                                                                             $.extend(item ,{ isdedicated: 'No' })
+
+                                                                          },
+                                                                            error:function(json){
+                                                                                  args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                                                                                 }
+                                                                             });
+                                                                                 args.response.success({
+                                                                                   actionFilter: hostActionfilter,
+                                                                                   data: item
+                                                                                 }); 
+
 										}
 									});											
                 }
@@ -12991,6 +13167,12 @@
     var jsonObj = args.context.item;
     var allowedActions = [];
 
+     if(jsonObj.domainid != null)
+      allowedActions.push("release");
+     else
+      allowedActions.push("dedicate");
+
+
     if (jsonObj.resourcestate == "Enabled") {
       allowedActions.push("edit");
       allowedActions.push("enableMaintenanceMode");


[04/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Zone Dedication UI-API Integration Code


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

Branch: refs/heads/master
Commit: 5c18ba648be20b5446c141a2de1e3c66bcf9eb77
Parents: c5493f0
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 18:19:05 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/zoneWizard.js |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c18ba64/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index a2998b4..917f9ca 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -570,6 +570,16 @@
               });
             }
           },
+
+           accountId:{
+                     label:'Account',
+                     isHidden:true,
+                     dependsOn:'ispublic',
+                     //docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  },
+
           localstorageenabled: {
             label: 'label.local.storage.enabled',
             isBoolean: true,
@@ -1593,6 +1603,8 @@
 					
           if(args.data.zone.networkdomain != null && args.data.zone.networkdomain.length > 0)
             array1.push("&domain=" + todb(args.data.zone.networkdomain));
+          
+          var dedicatedZoneid = null;
 
           $.ajax({
             url: createURL("createZone" + array1.join("")),
@@ -1604,6 +1616,33 @@
                   returnedZone: json.createzoneresponse.zone
                 })
               });
+
+               dedicatedZoneId = json.createzoneresponse.zone.id;
+                //EXPLICIT ZONE DEDICATION
+                if(args.data.pluginFrom == null && args.data.zone.ispublic == null){
+                      var array2 = [];
+                      if(args.data.zone.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.zone.accountId));
+
+                      if(dedicatedZoneId != null){
+                      $.ajax({
+                         url:createURL("dedicateZone&ZoneId=" +ZoneId +"&domain=" +args.data.zone.domain + array2.join("")),
+                         dataType:"json",
+                         success:function(json){
+                             var dedicatedObj = json.dedicatezoneresponse.zone;
+                             //args.response.success({ data: $.extend(item, dedicatedObj)});
+
+                         },
+
+                         error:function(json){
+
+                           args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                         }
+                       });
+
+                     }
+                    }
+
             },
             error: function(XMLHttpResponse) {
               var errorMsg = parseXMLHttpResponse(XMLHttpResponse);


[19/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit dedication dedicate icon


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

Branch: refs/heads/master
Commit: d847ef7470a28e3debd8830b9a959d593514a1d4
Parents: 1545b3f
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 20:55:33 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:15 2013 +0530

----------------------------------------------------------------------
 ui/css/cloudstack3.css |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d847ef74/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index df433d9..36f4ac6 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -11887,14 +11887,16 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
 .create .icon,
 .createTemplate .icon,
 .enableSwift .icon,
-.addVM .icon {
+.addVM .icon,
+.dedicate .icon {
   background-position: -69px -63px;
 }
 
 .create:hover .icon,
 .createTemplate:hover .icon,
 .enableSwift:hover .icon,
-.addVM:hover .icon {
+.addVM:hover .icon,
+.dedicate:hover .icon {
   background-position: -69px -645px;
 }
 


[21/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit Dedication - Cluster API integration action item for dedication/release


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

Branch: refs/heads/master
Commit: e03e2aab06a5e49b3f0446730e92ae6d4549c41b
Parents: 2489d85
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 19:51:29 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:15 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |  119 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 119 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e03e2aab/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 6958292..3b0cf86 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9716,6 +9716,120 @@
                 }
               },
 
+           dedicate:{
+                label: 'Dedicate Cluster',
+                messages: {
+                  confirm: function(args) {
+                    return 'Do you really want to dedicate this cluster to a domain/account? ';
+                  },
+                  notification: function(args) {
+                    return 'Cluster Dedicated';
+                  }
+                },
+                createForm:{
+                   title:'Dedicate Cluster',
+                   fields:{
+                         domainId:{
+                      label:'Domain',
+                      validation:{required:true},
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                       }
+                   },
+
+                   accountId:{
+                     label:'Account',
+                    // docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  }
+
+               }
+             },
+                action: function(args) {
+                     //EXPLICIT DEDICATION
+
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+
+                    $.ajax({
+                    url: createURL("dedicateCluster&clusterId=" + args.context.clusters[0].id + "&domainId=" +args.data.domainId + array2.join("") ),
+                    dataType: "json",
+                    success: function(json) {
+                       var jid = json.dedicateclusterresponse.jobid;
+                            args.response.success({
+                               _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:clusterActionfilter
+
+
+                          });
+                    }
+                  });
+                }
+
+              },
+
+               release:{
+                label:'Release Dedicated Cluster',
+                messages:{
+                   confirm: function(args) {
+                    return 'Do you want to release this dedicated cluster ?';
+                  },
+                  notification: function(args) {
+                    return 'Cluster dedication released';
+                  }
+                },
+               action:function(args){
+                  $.ajax({
+                     url:createURL("releaseDedicatedCluster&clusterid=" + args.context.clusters[0].id),
+                     dataType:"json",
+                     async:true,
+                     success:function(json){
+                       var jid = json.releasededicatedclusterresponse.jobid;
+                       args.response.success({
+                             _custom:
+                           {      jobId: jid
+                             },
+                           notification: {
+                              poll: pollAsyncJobResult
+                              },
+                            actionFilter:clusterActionfilter
+
+                       });
+                     },
+                    error:function(args){
+                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    }
+                  });
+
+               }
+              },
+  
+
               manage: {
                 label: 'label.action.manage.cluster',
                 messages: {
@@ -12846,6 +12960,11 @@
   var clusterActionfilter = function(args) {
     var jsonObj = args.context.item;
     var allowedActions = [];
+     
+     if(jsonObj.domainid != null)
+      allowedActions.push("release");
+     else
+      allowedActions.push("dedicate");
 
     if(jsonObj.state == "Enabled") {//managed, allocation enabled
 		  allowedActions.push("unmanage");


[14/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit dedication -  dedicatePod API call action item integration


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

Branch: refs/heads/master
Commit: fd72c129674375e911df018ee7e1e0ba99b73586
Parents: 55d3176
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 15:52:53 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:13 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd72c129/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 815ed99..c68def0 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8775,16 +8775,31 @@
                      }
                 },
                 action: function(args) {
+
+                    //EXPLICIT DEDICATION
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+
                     $.ajax({
-                    url: createURL("dedicatePod&podId=" + args.context.pods[0].id),
+                    url: createURL("dedicatePod&podId=" + args.context.pods[0].id + "&domainId=" +args.data.domainId + array2.join("")),
                     dataType: "json",
                     success: function(json) {
-                      var item = json.dedicatepodresponse.pod;
-                      args.response.success({
-                        actionFilter: podActionfilter,
-                        data:item
-                      });
-                    }
+                          var jid = json.dedicatepodresponse.jobid;
+                            args.response.success({
+                               _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:podActionfilter
+                          });
+                      },
+                   error:function(json){
+                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+
+                   }
                   });
                 }
 


[08/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit dedication API-UI integration


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

Branch: refs/heads/master
Commit: 1553ec65808656e261df1bfc382f52cf09c7a7b4
Parents: 5c18ba6
Author: Pranav Saxena <pr...@citrix.com>
Authored: Fri May 24 17:35:48 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:11 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js     |   21 ++++++++++++++++-----
 ui/scripts/zoneWizard.js |    6 +++---
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1553ec65/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index f76b534..f85e20f 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8571,13 +8571,15 @@
                 var endip = args.data.reservedSystemEndIp;      //optional
                 if (endip != null && endip.length > 0)
                   array1.push("&endIp=" + todb(endip));
-
+                var podId = null;
                 $.ajax({
                   url: createURL("createPod" + array1.join("")),
                   data: appendData,
                   dataType: "json",
                   success: function(json) {
                     var item = json.createpodresponse.pod;
+                    podId = json.createpodresponse.pod.id;
+
                    /* args.response.success({
 										  data:item
 										});
@@ -8599,8 +8601,17 @@
                          url:createURL("dedicatePod&podId=" +podId +"&domainId=" +args.data.domainId + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicatepodresponse.pod;
-                             args.response.success({ data: $.extend(item, dedicatedObj)});
+                            var jid = json.dedicatepodresponse.jobid;
+                            args.response.success({
+                               _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+
+                             data:item
+                          });
 
                          },
 
@@ -9454,12 +9465,12 @@
                         array2.push("&accountId=" +todb(args.data.accountId));
                     }
 
-                    if(hostId != null){
+                    if(clusterId != null){
                       $.ajax({
                          url:createURL("dedicateCluster&clusterId=" +clusterId +"&domainId=" +args.data.domainId + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicateclusterresponse.cluster;
+                             var jid = json.dedicateclusterresponse.jobid;
                              args.response.success({  data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
 
                          },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1553ec65/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 917f9ca..5a8bcfd 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -1604,7 +1604,7 @@
           if(args.data.zone.networkdomain != null && args.data.zone.networkdomain.length > 0)
             array1.push("&domain=" + todb(args.data.zone.networkdomain));
           
-          var dedicatedZoneid = null;
+          var dedicatedZoneId = null;
 
           $.ajax({
             url: createURL("createZone" + array1.join("")),
@@ -1626,10 +1626,10 @@
 
                       if(dedicatedZoneId != null){
                       $.ajax({
-                         url:createURL("dedicateZone&ZoneId=" +ZoneId +"&domain=" +args.data.zone.domain + array2.join("")),
+                         url:createURL("dedicateZone&ZoneId=" +dedicatedZoneId +"&domain=" +args.data.zone.domain + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicatezoneresponse.zone;
+                             var dedicatedObj = json.dedicatezoneresponse.jobid;
                              //args.response.success({ data: $.extend(item, dedicatedObj)});
 
                          },


[17/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit Dedication - Pod action filter for releasing dedicated pod (API Call)


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

Branch: refs/heads/master
Commit: cee82eca5581676539ff8e250159cb7ed06ff040
Parents: 1c9a34a
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 16:52:43 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:14 2013 +0530

----------------------------------------------------------------------
 ui/css/cloudstack3.css |    6 +++-
 ui/scripts/system.js   |   51 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cee82eca/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index da64787..df433d9 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -11725,11 +11725,13 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
   background-position: 0px -613px;
 }
 
-.restart .icon {
+.restart .icon,
+.release .icon {
   background-position: 0px -63px;
 }
 
-.restart:hover .icon {
+.restart:hover .icon,
+.release:hover .icon {
   background-position: 0px -645px;
 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cee82eca/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 933f271..7508e94 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8805,6 +8805,43 @@
 
               },
 
+               release:{
+                label:'Release Dedicated Pod',
+                messages:{
+                   confirm: function(args) {
+                    return 'Do you want to release this dedicated pod ?';
+                  },
+                  notification: function(args) {
+                    return 'Pod dedication released';
+                  }
+                },
+               action:function(args){
+                  $.ajax({
+                     url:createURL("releaseDedicatedPod&podid=" + args.context.pods[0].id),
+                     dataType:"json",
+                     async:true,
+                     success:function(json){
+                       var jid = json.releasededicatedpodresponse.jobid;
+                       args.response.success({
+                             _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:podActionfilter
+
+                       });
+                     },
+                    error:function(args){
+                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    }
+                  });
+
+               }
+              },
+
+
               disable: {
                 label: 'label.action.disable.pod',
                 messages: {
@@ -12763,20 +12800,26 @@
   var podActionfilter = function(args) {
     var podObj = args.context.item;
     var allowedActions = [];
-
+    var flag = 0;
      $.ajax({
        url:createURL("listDedicatedPods&podId=" + args.context.pods[0].id),
        success:function(json){
          if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
          var dedicatedPodObj = json.listdedicatedpodsresponse.dedicatedpod[0];
            if(dedicatedPodObj.domainid != null)
-             allowedActions.push("release");
-          }
+              flag =1;
+           }
            else
-            allowedActions.push("dedicate");
+             flag =0;
        }
      });
 
+   // if(flag == 0)
+      allowedActions.push("dedicate");
+
+   // if(flag == 1)
+      allowedActions.push("release");
+
     allowedActions.push("edit");
     if(podObj.allocationstate == "Disabled")
       allowedActions.push("enable");


[06/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Host UI/API Integration code


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

Branch: refs/heads/master
Commit: 60ff005939fa81d9820ffaab0f58126a33af67e2
Parents: 97cb514
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 10:48:43 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/60ff0059/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index b0bc9a1..8133509 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8599,7 +8599,7 @@
                          url:createURL("dedicatePod&podId=" +podId +"&domainId=" +args.data.domainId + array2.join("")),
                          dataType:"json",
                          success:function(json){
-                             var dedicatedObj = json.dedicatepodresponse.host;
+                             var dedicatedObj = json.dedicatepodresponse.pod;
                              args.response.success({ data: $.extend(item, dedicatedObj)});
 
                          },
@@ -10354,21 +10354,48 @@
 										});									
                   }
                 }
-
+             
+                var hostId = null;
                 $.ajax({
                   url: createURL("addHost"),
                   type: "POST",
 									data: data,
                   success: function(json) {
                     var item = json.addhostresponse.host[0];
-                    args.response.success({
+                    hostId = json.addhostresponse.host[0].id;
+
+               /*     args.response.success({
                       data: item
                     });
                   },
                   error: function(XMLHttpResponse) {
                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                     args.response.error(errorMsg);
-                  }
+                  }*/
+
+                       //EXPLICIT DEDICATION
+                if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+                    }
+
+                    if(hostId != null){
+                      $.ajax({
+                         url:createURL("dedicateHost&hostId=" +hostId +"&domainId=" +args.data.domainId + array2.join("")),
+                         dataType:"json",
+                         success:function(json){
+                             var dedicatedObj = json.dedicatehostresponse.host;
+                             args.response.success({  data: $.extend(item, dedicatedObj) });
+
+                         },
+
+                         error:function(json){
+                           args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                         }
+                       });
+                   }
+                 }
                 });
               },
 


[07/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Pod dedication action button functionality


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

Branch: refs/heads/master
Commit: 97cb514f052ea8abf75e1073cb84238fa0e164be
Parents: aab0bb4
Author: Pranav Saxena <pr...@citrix.com>
Authored: Wed May 15 01:19:21 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   66 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97cb514f/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1b1f61d..b0bc9a1 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8714,6 +8714,71 @@
                 }
               },
 
+                dedicate:{
+                   label: 'Dedicate Pod',
+                messages: {
+                  confirm: function(args) {
+                    return 'Do you really want to dedicate this pod to a domain/account? ';
+                  },
+                  notification: function(args) {
+                    return 'Pod Dedicated';
+                  }
+                },
+                createForm:{
+                   title:'Dedicate Pod',
+                   fields:{
+                         domainId:{
+                      label:'Domain',
+                      validation:{required:true},
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                       }
+                   },
+
+                   accountId:{
+                     label:'Account',
+                    // docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  }
+
+
+                     }
+                },
+                action: function(args) {
+                    $.ajax({
+                    url: createURL("dedicatePod&podId=" + args.context.pods[0].id),
+                    dataType: "json",
+                    success: function(json) {
+                      var item = json.dedicatepodresponse.pod;
+                      args.response.success({
+                        actionFilter: podActionfilter,
+                        data:item
+                      });
+                    }
+                  });
+                }
+
+              },
+
               disable: {
                 label: 'label.action.disable.pod',
                 messages: {
@@ -12557,6 +12622,7 @@
     var podObj = args.context.item;
     var allowedActions = [];
     allowedActions.push("edit");
+     allowedActions.push("dedicate");
     if(podObj.allocationstate == "Disabled")
       allowedActions.push("enable");
     else if(podObj.allocationstate == "Enabled")


[12/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit dedication - POD UI-API detail view integration


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

Branch: refs/heads/master
Commit: 55d317633273a5a66e5d08e7f7ac0da7f3cb38f6
Parents: e95ddb6
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 15:39:48 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:13 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55d31763/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1ee2ab2..815ed99 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8892,14 +8892,17 @@
                                                     dataType:"json",
                                                     async:false,
                                                     success:function(json){
-                                                        var podItem = json.listdedicatedpodsresponse ? json.listdedicatedpodsresponse.dedicatedpod[0]:[];
+                                                         if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
+                                                            var podItem = json.listdedicatedpodsresponse.dedicatedpod[0];
                                                         if (podItem.domainid != null) {
                                                             $.extend(item, podItem , { isdedicated: 'Yes' });
-                                                   }
+                                                        }
+                                                    }
+                                                      else
+                                                         $.extend(item ,{ isdedicated: 'No' })
                                                  },
                                                  error:function(json){
-                                                        $.extend(item ,{ isdedicated: 'No' })
-
+                                                     args.response.error(parseXMLHttpResponse(XMLHttpResponse));
 
                                                  }
                                            });


[23/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
formatting the code for better readability


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

Branch: refs/heads/master
Commit: c42da47aa6694f987e6fda36f65efbbdb208f9f5
Parents: e94c817
Author: Pranav Saxena <pr...@citrix.com>
Authored: Thu May 30 21:36:27 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:17 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   39 ++++-----------------------------------
 1 files changed, 4 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c42da47a/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index c8c747d..3044c83 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -5477,12 +5477,10 @@
 
                    accountId:{
                      label:'Account',
-                    // docID:'helpAccountForDedication',
+                     docID:'helpAccountForDedication',
                      validation:{required:false}
 
                   }
-
-
                      }
                 },
             
@@ -5506,9 +5504,7 @@
                               },
                             actionFilter:zoneActionfilter
 
-
                           });
-
                     }
                   });
                 }
@@ -8723,16 +8719,6 @@
                     var item = json.createpodresponse.pod;
                     podId = json.createpodresponse.pod.id;
 
-                   /* args.response.success({
-										  data:item
-										});
-                  },
-                  error: function(XMLHttpResponse) {
-                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                    args.response.error(errorMsg);
-                  }
-                });*/
-
                   //EXPLICIT DEDICATION
                 if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
                       var array2 = [];
@@ -8909,7 +8895,7 @@
 
                    accountId:{
                      label:'Account',
-                    // docID:'helpAccountForDedication',
+                     docID:'helpAccountForDedication',
                      validation:{required:false}
 
                   }
@@ -9677,14 +9663,6 @@
                   success: function(json) {
                     var item = json.addclusterresponse.cluster[0];
                     clusterId= json.addclusterresponse.cluster[0].id;
-                /*    args.response.success({
-										  data: $.extend(item, { state: 'Enabled' })
-										});
-                  },
-                  error: function(XMLHttpResponse) {
-                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
-                    args.response.error(errorMsg);
-                  }*/
                   
                   //EXPLICIT DEDICATION
                 if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
@@ -9699,7 +9677,6 @@
                          dataType:"json",
                          success:function(json){
                              var jid = json.dedicateclusterresponse.jobid;
-                             //args.response.success({  data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
                               args.response.success({
                                  _custom:
                                    {      jobId: jid
@@ -9900,7 +9877,7 @@
 
                    accountId:{
                      label:'Account',
-                    // docID:'helpAccountForDedication',
+                     docID:'helpAccountForDedication',
                      validation:{required:false}
 
                   }
@@ -9927,8 +9904,6 @@
                                  poll: pollAsyncJobResult
                               },
                             actionFilter:clusterActionfilter
-
-
                           });
                     }
                   });
@@ -10804,7 +10779,6 @@
                          dataType:"json",
                          success:function(json){
                              var jid = json.dedicatehostresponse.host.jobid;
-                             //args.response.success({  data: $.extend(item, dedicatedObj) });
                               args.response.success({
                                  _custom:
                            {      jobId: jid
@@ -10919,7 +10893,7 @@
                    },
                   accountId:{
                      label:'Account',
-                    // docID:'helpAccountForDedication',
+                     docID:'helpAccountForDedication',
                      validation:{required:false}
 
                   }
@@ -10950,11 +10924,6 @@
 
 
                           });
-
-                   /*   args.response.success({
-                        actionFilter: podActionfilter,
-                        data:item
-                      });*/
                     }
                   });
                 }


[10/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Cluster UI-API Integration code


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

Branch: refs/heads/master
Commit: 9f76c0559c761e33bec98043cd573afc88473e1e
Parents: a52b313
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon May 27 15:44:02 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:12 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f76c055/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 70fb0e7..45b0f43 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -9501,7 +9501,17 @@
                          dataType:"json",
                          success:function(json){
                              var jid = json.dedicateclusterresponse.jobid;
-                             args.response.success({  data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
+                             //args.response.success({  data: $.extend(item, dedicatedObj , {state:'Enabled'}) });
+                              args.response.success({
+                                 _custom:
+                                   {      jobId: jid
+                                    },
+                                  notification: {
+                                    poll: pollAsyncJobResult
+                                    },
+
+                                  data:$.extend(item, {state:'Enabled'})
+                             });
 
                          },
 


[15/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit Dedication - Pod action filter for release/dedicate action items


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

Branch: refs/heads/master
Commit: 2489d858f953dd063fdbf19c2a67aaeed10316f8
Parents: cee82ec
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 18:04:22 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:14 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2489d858/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 7508e94..6958292 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -12799,26 +12799,14 @@
 
   var podActionfilter = function(args) {
     var podObj = args.context.item;
+    var dedicatedPodObj = args.context.podItem;
     var allowedActions = [];
-    var flag = 0;
-     $.ajax({
-       url:createURL("listDedicatedPods&podId=" + args.context.pods[0].id),
-       success:function(json){
-         if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
-         var dedicatedPodObj = json.listdedicatedpodsresponse.dedicatedpod[0];
-           if(dedicatedPodObj.domainid != null)
-              flag =1;
-           }
-           else
-             flag =0;
-       }
-     });
-
-   // if(flag == 0)
+   
+     if(podObj.domainid != null)
+      allowedActions.push("release");
+     else
       allowedActions.push("dedicate");
 
-   // if(flag == 1)
-      allowedActions.push("release");
 
     allowedActions.push("edit");
     if(podObj.allocationstate == "Disabled")


[25/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Merge branch 'UI-explicitDedication'


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

Branch: refs/heads/master
Commit: 2f29185943ac0412aa501b59493837b4055642e0
Parents: 7934b16 c42da47
Author: Pranav Saxena <pr...@citrix.com>
Authored: Fri May 31 10:04:05 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Fri May 31 10:04:05 2013 +0530

----------------------------------------------------------------------
 ui/css/cloudstack3.css   |   12 +-
 ui/scripts/docs.js       |   16 +
 ui/scripts/system.js     |  969 ++++++++++++++++++++++++++++++++++++++---
 ui/scripts/zoneWizard.js |   66 +++-
 4 files changed, 990 insertions(+), 73 deletions(-)
----------------------------------------------------------------------



[02/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Dedicate POD -UI and API integration code


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

Branch: refs/heads/master
Commit: 25643459af07e194ab3f6d136dfa05207007bbbf
Parents: 4d5033f
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 14 16:37:54 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:09 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25643459/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index b90a11d..fc0c70f 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8578,7 +8578,7 @@
                   dataType: "json",
                   success: function(json) {
                     var item = json.createpodresponse.pod;
-                    args.response.success({
+                   /* args.response.success({
 										  data:item
 										});
                   },
@@ -8586,7 +8586,41 @@
                     var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
                     args.response.error(errorMsg);
                   }
-                });
+                });*/
+
+                  //EXPLICIT DEDICATION
+                if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+
+                      if(podId != null){
+                      $.ajax({
+                         url:createURL("dedicatePod&podId=" +podId +"&domainId=" +args.data.domainId + array2.join("")),
+                         dataType:"json",
+                         success:function(json){
+                             var dedicatedObj = json.dedicatepodresponse.host;
+                             args.response.success({data:item});
+
+                         },
+
+                         error:function(json){
+
+                           args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                         }
+                       });
+
+                     }
+                    }
+                 },
+                 error: function(XMLHttpResponse) {
+                    var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+                    args.response.error(errorMsg);
+                  }
+
+                });                 
+
+                
               },
 
               notification: {


[16/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
explicit Dedication - Pod action filter for release/dedicate action items


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

Branch: refs/heads/master
Commit: 1c9a34abccdbd14d00b5fe6f4bb64f6fed1ef2d1
Parents: fd72c12
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 16:00:24 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:14 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c9a34ab/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index c68def0..933f271 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -12763,8 +12763,21 @@
   var podActionfilter = function(args) {
     var podObj = args.context.item;
     var allowedActions = [];
+
+     $.ajax({
+       url:createURL("listDedicatedPods&podId=" + args.context.pods[0].id),
+       success:function(json){
+         if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
+         var dedicatedPodObj = json.listdedicatedpodsresponse.dedicatedpod[0];
+           if(dedicatedPodObj.domainid != null)
+             allowedActions.push("release");
+          }
+           else
+            allowedActions.push("dedicate");
+       }
+     });
+
     allowedActions.push("edit");
-     allowedActions.push("dedicate");
     if(podObj.allocationstate == "Disabled")
       allowedActions.push("enable");
     else if(podObj.allocationstate == "Enabled")


[11/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Pod explicit dedication Detail View


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

Branch: refs/heads/master
Commit: a52b3139c525afd5d8c13cef4129e5dea03d2747
Parents: 1553ec6
Author: Pranav Saxena <pr...@citrix.com>
Authored: Sat May 25 02:15:44 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:12 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   58 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a52b3139/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index f85e20f..70fb0e7 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8866,23 +8866,53 @@
                       },
                       label: 'label.allocation.state'
                     }
-                  }
+                  },
+
+                   {
+
+                   isdedicated:{label:'Dedicated'},
+                   domainid:{label:'Domain ID'}
+
+                   }
+
                 ],
 
                 dataProvider: function(args) {								  
-									$.ajax({
-										url: createURL("listPods&id=" + args.context.pods[0].id),
-										dataType: "json",
-										async: true,
-										success: function(json) {										  
-											var item = json.listpodsresponse.pod[0];
-											args.response.success({
-												actionFilter: podActionfilter,
-												data:item
-											});
-										}
-									});									              
-                }
+                
+                                                                        $.ajax({
+                                                                                url: createURL("listPods&id=" + args.context.pods[0].id),
+                                                                                dataType: "json",
+                                                                                async: false,
+                                                                                success: function(json) {
+                                                                                     var  item = json.listpodsresponse.pod[0];
+
+
+                                                                                       $.ajax({
+                                                    url:createURL("listDedicatedPods&podid=" +args.context.pods[0].id),
+                                                    dataType:"json",
+                                                    async:false,
+                                                    success:function(json){
+                                                        var podItem = json.listdedicatedpodsresponse ? json.listdedicatedpodsresponse.dedicatedpod[0]:[];
+                                                        if (podItem.domainid != null) {
+                                                            $.extend(item, podItem , { isdedicated: 'Yes' });
+                                                   }
+                                                 },
+                                                 error:function(json){
+                                                        $.extend(item ,{ isdedicated: 'No' })
+
+
+                                                 }
+                                           });
+                                             args.response.success({
+                                                actionFilter: podActionfilter,
+                                                data: item
+                                            });
+
+                                         }
+                                                                        });
+
+
+                 }
               },
 
               ipAllocations: {


[03/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Cluster/Pod/Host Explicit Dedication front end UI


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

Branch: refs/heads/master
Commit: 4d5033f263c86694af4029b2a1401c035af490a6
Parents: dd9b750
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon May 6 10:31:13 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:09 2013 +0530

----------------------------------------------------------------------
 ui/scripts/docs.js   |   16 +++++
 ui/scripts/system.js |  144 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 159 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5033f2/ui/scripts/docs.js
----------------------------------------------------------------------
diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js
index 65233c1..48db443 100755
--- a/ui/scripts/docs.js
+++ b/ui/scripts/docs.js
@@ -16,6 +16,22 @@
 // under the License.
 cloudStack.docs = {
 
+  //Dedicate Resource
+
+   helpDedicateResource:{
+
+    desc:'Check this box to dedicate the resources to specific domain/account',
+    externalLink:''
+
+  },
+
+   helpAccountForDedication:{
+
+   desc:'Please enter an account name which belongs to the above selected domain in order to dedicate this resource to this account',
+   externalLink:''
+
+  },
+
 
  //Delete/archive events
   helpEventsDeleteType:{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5033f2/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8b9a81f..b90a11d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8507,7 +8507,54 @@
                     label: 'label.end.reserved.system.IP',
                     docID: 'helpPodEndIP',
                     validation: { required: false }
+                  },
+
+                   isDedicated:{
+                       label:'Dedicate',
+                       isBoolean:true,
+                       isChecked:false,
+                       docID:'helpDedicateResource'
+
+
+                   },
+
+                   domainId:{
+                      label:'Domain',
+                      isHidden:true,
+                      validation:{required:true},
+                      dependsOn:'isDedicated',
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                      }
+                   },
+
+                    accountId:{
+                     label:'Account',
+                     isHidden:true,
+                     dependsOn:'isDedicated',
+                     docID:'helpAccountForDedication',
+                     validation:{required:false}
+
                   }
+
                 }
               },
 
@@ -9007,8 +9054,55 @@
 
                    },
 
-                  //hypervisor==VMWare begins here
+                  
+                   isDedicated:{
+                       label:'Dedicate',
+                       isBoolean:true,
+                       isChecked:false,
+                       docID:'helpDedicateResource'
+
+
+                   },
+
+                   domainId:{
+                      label:'Domain',
+                      isHidden:true,
+                      validation:{required:true},
+                      dependsOn:'isDedicated',
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
 
+
+                        });
+                      }
+                   },
+
+                    accountId:{
+                     label:'Account',
+                     isHidden:true,
+                     dependsOn:'isDedicated',
+                     docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  },
+
+                  //hypervisor==VMWare begins here
+ 
                   vCenterHost: {
                     label: 'label.vcenter.host',
                     docID: 'helpClustervCenterHost',
@@ -9996,7 +10090,55 @@
                     validation: { required: true },
                     isHidden: true,
                     isPassword: true
+                  }, 
+
+                   isDedicated:{
+                       label:'Dedicate',
+                       isBoolean:true,
+                       isChecked:false,
+                       docID:'helpDedicateResource'
+
+
+                   },
+
+                   domainId:{
+                      label:'Domain',
+                      isHidden:true,
+                      validation:{required:true},
+                      dependsOn:'isDedicated',
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+
+                      }
+                   },
+
+                   accountId:{
+                     label:'Account',
+                     isHidden:true,
+                     dependsOn:'isDedicated',
+                     docID:'helpAccountForDedication',
+                     validation:{required:false}
+
                   },
+
                   //input_group="general" ends here
 
                   //input_group="VMWare" starts here


[20/25] git commit: updated refs/heads/master to 2f29185

Posted by pr...@apache.org.
Explicit Dedication - Zone action item dedication/release API integration


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

Branch: refs/heads/master
Commit: 8c79aa8cc1f349bc7d86c640f8a6ef3ddf317c2a
Parents: d847ef7
Author: Pranav Saxena <pr...@citrix.com>
Authored: Tue May 28 21:44:45 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Thu May 30 21:57:15 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |  175 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 162 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8c79aa8c/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 02e13bd..c8c747d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -5436,6 +5436,121 @@
                     }
                   },
 
+                   dedicate:{
+                   label: 'Dedicate Zone',
+                messages: {
+                  confirm: function(args) {
+                    return 'Do you really want to dedicate this zone to a domain/account? ';
+                  },
+                  notification: function(args) {
+                    return 'Zone Dedicated';
+                  }
+                },
+                createForm:{
+                   title:'Dedicate Zone',
+                   fields:{
+                         domainId:{
+                      label:'Domain',
+                      validation:{required:true},
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id ,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                       }
+                   },
+
+                   accountId:{
+                     label:'Account',
+                    // docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  }
+
+
+                     }
+                },
+            
+               action: function(args) {
+                     //EXPLICIT DEDICATION
+                      var array2 = [];
+                      if(args.data.accountId != "")
+                        array2.push("&accountId=" +todb(args.data.accountId));
+
+                    $.ajax({
+                    url: createURL("dedicateZone&zoneId=" + args.context.physicalResources[0].id + "&domainId=" +args.data.domainId + array2.join("") ),
+                    dataType: "json",
+                    success: function(json) {
+                       var jid = json.dedicatezoneresponse.jobid;
+                            args.response.success({
+                               _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:zoneActionfilter
+
+
+                          });
+
+                    }
+                  });
+                }
+
+              },
+
+              release:{
+                label:'Release Dedicated Zone',
+                messages:{
+                   confirm: function(args) {
+                    return 'Do you want to release this dedicated zone ?';
+                  },
+                  notification: function(args) {
+                    return 'Zone dedication released';
+                  }
+                },
+               action:function(args){
+                  $.ajax({
+                     url:createURL("releaseDedicatedZone&zoneid=" + args.context.physicalResources[0].id),
+                     dataType:"json",
+                     async:true,
+                      success:function(json){
+                       var jid = json.releasededicatedzoneresponse.jobid;
+                        args.response.success({
+                             _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:zoneActionfilter
+
+                       });
+                     },
+                    error:function(json){
+                      args.response.error(parseXMLHttpResponse(json));
+                    }
+                  });
+
+               }
+              },
+
                   'remove': {
                     label: 'label.action.delete.zone',
                     messages: {
@@ -5533,7 +5648,15 @@
 												  isEditable: true,
 												  converter:cloudStack.converters.toBooleanText
                         }
-                      }
+                      },
+
+                       {
+
+                       isdedicated:{label:'Dedicated'},
+                       domainid:{label:'Domain ID'}
+
+                       }
+
                     ],
                     dataProvider: function(args) {
                       $.ajax({
@@ -5542,12 +5665,32 @@
                           id: args.context.physicalResources[0].id
                         },
                         success: function(json) {
-                          selectedZoneObj = json.listzonesresponse.zone[0];
-                          args.response.success({
-                            data: json.listzonesresponse.zone[0],
-                            actionFilter: zoneActionfilter
-                          });
-                        }
+                           selectedZoneObj = json.listzonesresponse.zone[0];
+                             $.ajax({
+                                                    url:createURL("listDedicatedZones&zoneid=" +args.context.physicalResources[0].id),
+                                                    dataType:"json",
+                                                    async:false,
+                                                    success:function(json){
+                                                        if(json.listdedicatedzonesresponse.dedicatedzone != undefined){
+                                                          var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
+                                                            if (zoneItem.domainid != null) {
+                                                            $.extend(selectedZoneObj, zoneItem , { isdedicated: 'Yes' });
+                                                          }
+                                                        }
+                                                        else
+                                                            $.extend(selectedZoneObj,{ isdedicated: 'No' })
+
+                                                    },
+                                                  error:function(json){
+                                                       args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                                                  }
+                                              });
+                                             args.response.success({
+                                                actionFilter: zoneActionfilter,
+                                                data: selectedZoneObj
+                                            });
+
+                           }
                       });
                     }
                   },
@@ -8833,8 +8976,8 @@
 
                        });
                      },
-                    error:function(args){
-                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    error:function(json){
+                      args.response.error(parseXMLHttpResponse(json));
                     }
                   });
 
@@ -9821,8 +9964,8 @@
 
                        });
                      },
-                    error:function(args){
-                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    error:function(json){
+                      args.response.error(parseXMLHttpResponse(json));
                     }
                   });
 
@@ -10847,8 +10990,8 @@
 
                        });
                      },
-                    error:function(args){
-                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    error:function(json){
+                      args.response.error(parseXMLHttpResponse(json));
                     }
                   });
 
@@ -13065,6 +13208,12 @@
   var zoneActionfilter = function(args) {
     var jsonObj = args.context.item;
     var allowedActions = ['enableSwift'];
+
+     if(jsonObj.domainid != null)
+      allowedActions.push("release");
+    else
+    allowedActions.push("dedicate");
+
     allowedActions.push("edit");
     if(jsonObj.allocationstate == "Disabled")
       allowedActions.push("enable");