From a1cd244a12aea264387a268556bfda25f8189ee2 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Fri, 24 May 2013 17:35:48 +0530 Subject: [PATCH] explicit dedication API-UI integration --- ui/scripts/system.js | 21 ++++++++++++++++----- ui/scripts/zoneWizard.js | 6 +++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 119e8f64569..2f667a28318 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -8037,12 +8037,14 @@ 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("")), dataType: "json", success: function(json) { var item = json.createpodresponse.pod; + podId = json.createpodresponse.pod.id; + /* args.response.success({ data:item }); @@ -8064,8 +8066,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 + }); }, @@ -8919,12 +8930,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'}) }); }, diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index f2e1a66e7af..8fbb3add115 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -1605,7 +1605,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("")), @@ -1627,10 +1627,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)}); },