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 <pranav.sax...@citrix.com>
Authored: Wed May 15 18:19:05 2013 +0530
Committer: Pranav Saxena <pranav.sax...@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);

Reply via email to