Skip to content

Commit 9334f26

Browse files
author
Jessica Wang
committed
CLOUDSTACK-6889: UI - create network offering - remove non-needed parameters from API call whose size might exceed limit in some cases.
1 parent b85dd95 commit 9334f26

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

ui/scripts/configuration.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,9 +2926,11 @@
29262926
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
29272927
serviceCapabilityIndex++;
29282928
}
2929-
} else if (value != '') { // Normal data
2929+
} else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egresspolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted)
2930+
if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate")) {
29302931
inputData[key] = value;
29312932
}
2933+
}
29322934
});
29332935

29342936
for (var key1 in inputData) {
@@ -3008,9 +3010,6 @@
30083010
serviceProviderIndex++;
30093011
});
30103012

3011-
if (args.$form.find('.form-item[rel=availability]').css("display") == "none")
3012-
inputData['availability'] = 'Optional';
3013-
30143013
if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) {
30153014
inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false;
30163015
} else {
@@ -3025,8 +3024,7 @@
30253024
$.ajax({
30263025
url: createURL('createNetworkOffering'),
30273026
data: inputData,
3028-
dataType: 'json',
3029-
async: true,
3027+
type: "POST", //use POST instead of GET since the API call might be overlong and exceed size limit
30303028
success: function(data) {
30313029
var item = data.createnetworkofferingresponse.networkoffering;
30323030

0 commit comments

Comments
 (0)