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 <pranav.sax...@citrix.com>
Authored: Tue May 14 16:37:54 2013 +0530
Committer: Pranav Saxena <pranav.sax...@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: {

Reply via email to