Skip to content

Commit eb9973d

Browse files
author
Jessica Wang
committed
cloudStack 3.0 - extract template, extract ISO - zoneId is no longer required.
1 parent 7d51e9f commit eb9973d

3 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎api/src/com/cloud/api/commands/ExtractIsoCmd.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class ExtractIsoCmd extends BaseAsyncCmd {
5252
private String url;
5353

5454
@IdentityMapper(entityTableName="data_center")
55-
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located")
55+
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=false, description="the ID of the zone where the ISO is originally located")
5656
private Long zoneId;
5757

5858
@Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")

‎api/src/com/cloud/api/commands/ExtractTemplateCmd.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class ExtractTemplateCmd extends BaseAsyncCmd {
5252
private String url;
5353

5454
@IdentityMapper(entityTableName="data_center")
55-
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the zone where the ISO is originally located" )
55+
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=false, description="the ID of the zone where the ISO is originally located" )
5656
private Long zoneId;
5757

5858
@Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")

‎ui/scripts/templates.js‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,12 @@
376376
}
377377
},
378378
action: function(args) {
379+
var apiCmd = "extractTemplate&mode=HTTP_DOWNLOAD&id=" + args.context.templates[0].id;
380+
if(args.context.templates[0].zoneid != null)
381+
apiCmd += "&zoneid=" + args.context.templates[0].zoneid;
382+
379383
$.ajax({
380-
url: createURL("extractTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.templates[0].zoneid + "&mode=HTTP_DOWNLOAD"),
384+
url: createURL(apiCmd),
381385
dataType: "json",
382386
async: true,
383387
success: function(json) {
@@ -622,9 +626,13 @@
622626
return htmlMsg2;
623627
}
624628
},
625-
action: function(args) {
629+
action: function(args) {
630+
var apiCmd = "extractTemplate&mode=HTTP_DOWNLOAD&id=" + args.context.templates[0].id;
631+
if(args.context.templates[0].zoneid != null)
632+
apiCmd += "&zoneid=" + args.context.templates[0].zoneid;
633+
626634
$.ajax({
627-
url: createURL("extractTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.templates[0].zoneid + "&mode=HTTP_DOWNLOAD"),
635+
url: createURL(apiCmd),
628636
dataType: "json",
629637
async: true,
630638
success: function(json) {
@@ -1065,8 +1073,12 @@
10651073
}
10661074
},
10671075
action: function(args) {
1076+
var apiCmd = "extractIso&mode=HTTP_DOWNLOAD&id=" + args.context.isos[0].id;
1077+
if(args.context.isos[0].zoneid != null)
1078+
apiCmd += "&zoneid=" + args.context.isos[0].zoneid;
1079+
10681080
$.ajax({
1069-
url: createURL("extractIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.isos[0].zoneid + "&mode=HTTP_DOWNLOAD"),
1081+
url: createURL(apiCmd),
10701082
dataType: "json",
10711083
async: true,
10721084
success: function(json) {
@@ -1311,9 +1323,13 @@
13111323
return htmlMsg2;
13121324
}
13131325
},
1314-
action: function(args) {
1326+
action: function(args) {
1327+
var apiCmd = "extractIso&mode=HTTP_DOWNLOAD&id=" + args.context.isos[0].id;
1328+
if(args.context.isos[0].zoneid != null)
1329+
apiCmd += "&zoneid=" + args.context.isos[0].zoneid;
1330+
13151331
$.ajax({
1316-
url: createURL("extractIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.isos[0].zoneid + "&mode=HTTP_DOWNLOAD"),
1332+
url: createURL(apiCmd),
13171333
dataType: "json",
13181334
async: true,
13191335
success: function(json) {

0 commit comments

Comments
 (0)