Skip to content

Commit e0fa8e1

Browse files
author
Jessica Wang
committed
CLOUDSTACK-2351: object store - UI - cloudstack.js - replace listS3s, listSwiftsAPI with new API listImageStores.
1 parent d9733e9 commit e0fa8e1

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

‎ui/scripts/cloudStack.js‎

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,26 @@
186186

187187
if (userValid && isAdmin()) {
188188
$.ajax({
189-
url: createURL("listSwifts"),
190-
dataType: "json",
189+
url: createURL("listImageStores"),
190+
data: {
191+
provider: 'Swift'
192+
},
191193
async: false,
192194
success: function(json) {
193-
var items = json.listswiftsresponse.swift;
195+
var items = json.listimagestoreresponse.imagestore;
194196
if(items != null && items.length > 0)
195197
havingSwift = true;
196198
}
197199
});
198200
if (havingSwift == false) {
199201
$.ajax({
200-
url: createURL("listS3s"),
201-
dataType: "json",
202+
url: createURL("listImageStores"),
203+
data: {
204+
provider: 'S3'
205+
},
202206
async: false,
203207
success: function(json) {
204-
var items = json.lists3sresponse.s3;
208+
var items = json.listimagestoreresponse.imagestore;
205209
if (items != null && items.length > 0) {
206210
havingS3 = true;
207211
}
@@ -328,22 +332,26 @@
328332

329333
if (isAdmin()) {
330334
$.ajax({
331-
url: createURL("listSwifts"),
332-
dataType: "json",
335+
url: createURL("listImageStores"),
336+
data:{
337+
provider: 'Swift'
338+
},
333339
async: false,
334340
success: function(json) {
335-
var items = json.listswiftsresponse.swift;
341+
var items = json.listimagestoreresponse.imagestore;
336342
if(items != null && items.length > 0)
337343
havingSwift = true;
338344
}
339345
});
340346
if (havingSwift = false) {
341347
$.ajax({
342-
url: createURL("listS3s"),
343-
dataType: "json",
348+
url: createURL("listImageStores"),
349+
data: {
350+
provider: 'S3'
351+
},
344352
async: false,
345353
success: function(json) {
346-
var items = json.lists3sresponse.s3;
354+
var items = json.listimagestoreresponse.imagestore;
347355
if (items != null && items.length > 0) {
348356
havingS3 = true;
349357
}

‎ui/scripts/system.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@
265265
secondaryStorageCount: function(data) {
266266
$.ajax({
267267
url: createURL('listImageStores'),
268-
data: {
269-
type: 'image',
268+
data: {
270269
page: 1,
271270
pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property.
272271
},
@@ -5455,7 +5454,7 @@
54555454

54565455
$.ajax({
54575456
url: createURL('listImageStores' + searchByArgs),
5458-
data: { type: 'image', page: args.page, pageSize: pageSize, listAll: true },
5457+
data: { page: args.page, pageSize: pageSize, listAll: true },
54595458
success: function (json) {
54605459
args.response.success({ data: json.listimagestoreresponse.imagestore });
54615460
},
@@ -10321,7 +10320,7 @@
1032110320
}
1032210321
}
1032310322
$.ajax({
10324-
url: createURL("listImageStores&type=image&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
10323+
url: createURL("listImageStores&page=" + args.page + "&pagesize=" + pageSize + array1.join("")),
1032510324
dataType: "json",
1032610325
async: true,
1032710326
success: function(json) {

0 commit comments

Comments
 (0)