[GitHub] [cloudstack] nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add local ISO upload via UI

2019-04-03 Thread GitBox
nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add 
local ISO upload via UI
URL: https://github.com/apache/cloudstack/pull/3251#discussion_r271902301
 
 

 ##
 File path: server/src/main/java/com/cloud/template/TemplateAdapterBase.java
 ##
 @@ -284,35 +285,62 @@ public TemplateProfile prepare(RegisterTemplateCmd cmd) 
throws ResourceAllocatio
 
 }
 
-@Override
-public TemplateProfile prepare(GetUploadParamsForTemplateCmd cmd) throws 
ResourceAllocationException {
+/**
+ * Prepare upload parameters internal method for templates and ISOs local 
upload
+ */
+private TemplateProfile prepareUploadParamsInternal(boolean isIso, long 
userId, String name, String displayText,
 
 Review comment:
   Ok, how about now?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [cloudstack] nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add local ISO upload via UI

2019-04-01 Thread GitBox
nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add 
local ISO upload via UI
URL: https://github.com/apache/cloudstack/pull/3251#discussion_r271102727
 
 

 ##
 File path: 
api/src/main/java/org/apache/cloudstack/api/command/user/iso/GetUploadParamsForIsoCmd.java
 ##
 @@ -0,0 +1,158 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command.user.iso;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.AbstractGetUploadParamsCmd;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.GetUploadParamsResponse;
+import org.apache.cloudstack.api.response.GuestOSResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+
+import java.net.MalformedURLException;
+
+@APICommand(name = GetUploadParamsForIsoCmd.APINAME,
+description = "upload an existing ISO into the CloudStack cloud.",
+responseObject = GetUploadParamsResponse.class, since = "4.11.2",
 
 Review comment:
   Done, thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [cloudstack] nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add local ISO upload via UI

2019-04-01 Thread GitBox
nvazquez commented on a change in pull request #3251: [WIP DO NOT MERGE] Add 
local ISO upload via UI
URL: https://github.com/apache/cloudstack/pull/3251#discussion_r271102538
 
 

 ##
 File path: server/src/main/java/com/cloud/template/TemplateAdapterBase.java
 ##
 @@ -284,35 +285,62 @@ public TemplateProfile prepare(RegisterTemplateCmd cmd) 
throws ResourceAllocatio
 
 }
 
-@Override
-public TemplateProfile prepare(GetUploadParamsForTemplateCmd cmd) throws 
ResourceAllocationException {
+/**
+ * Prepare upload parameters internal method for templates and ISOs local 
upload
+ */
+private TemplateProfile prepareUploadParamsInternal(boolean isIso, long 
userId, String name, String displayText,
 
 Review comment:
   I could have used an object of the `TemplateProfile` class as parameter, but 
I think that can be confusing, as it is intended that the method returns a 
valid `TemplateProfile`. The one passed as parameter will just be a holder for 
the needed parameters and could cause confusion with the valid one. Do you 
agree? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services