cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10024) Physical Networking Migration
Date Mon, 23 Oct 2017 23:39:03 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16216061#comment-16216061
] 

ASF GitHub Bot commented on CLOUDSTACK-10024:
---------------------------------------------

GabrielBrascher commented on a change in pull request #2259: CLOUDSTACK-10024: Network migration
support
URL: https://github.com/apache/cloudstack/pull/2259#discussion_r146315585
 
 

 ##########
 File path: api/src/org/apache/cloudstack/api/command/admin/network/MigrateNetworkCmd.java
 ##########
 @@ -0,0 +1,157 @@
+// 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.admin.network;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+import org.apache.cloudstack.api.ACL;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject.ResponseView;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.NetworkOfferingResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.context.CallContext;
+
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.network.Network;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.user.Account;
+import com.cloud.user.User;
+
+@APICommand(name = "migrateNetwork", description = "moves a network do another physical network",
responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType
= {Network.class},
+        requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class MigrateNetworkCmd extends BaseAsyncCmd {
+    public static final Logger s_logger = Logger.getLogger(MigrateNetworkCmd.class.getName());
+
+    private static final String s_name = "migratenetworkresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+    @ACL(accessType = AccessType.OperateEntry)
+    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.UUID, entityType = NetworkResponse.class,
+            required=true, description="the ID of the network")
+    protected Long id;
+
+    @Parameter(name = ApiConstants.NETWORK_OFFERING_ID, type = CommandType.UUID, entityType
= NetworkOfferingResponse.class, description = "network offering ID")
+    private Long networkOfferingId;
+
+    @Parameter(name = ApiConstants.RESUME, type = CommandType.BOOLEAN, description = "true
if previous network migration cmd failed")
+    private Boolean resume;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getNetworkOfferingId() {
+        return networkOfferingId;
+    }
+
+    public Boolean getResume() {
+        return resume != null ? resume : false;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        Network network = _networkService.getNetwork(id);
+        if (network == null) {
+            throw new InvalidParameterValueException("Networkd id=" + id + " doesn't exist");
+        } else {
+            return _networkService.getNetwork(id).getAccountId();
+        }
+    }
+
+    @Override
+    public void execute() throws InsufficientCapacityException, ConcurrentOperationException
{
 
 Review comment:
   Sorry if I am missing something here, but I do not see where those exceptions are launched;
is it necessary to add the `throws InsufficientCapacityException, ConcurrentOperationException`?
The compiler doesn't complain when removing them.

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


> Physical Networking Migration
> -----------------------------
>
>                 Key: CLOUDSTACK-10024
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10024
>             Project: CloudStack
>          Issue Type: New Feature
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: API, KVM, Management Server, VMware
>            Reporter: Frank Maximus
>            Assignee: Frank Maximus
>             Fix For: 4.11.0.0
>
>
> *As a* Cloud Owner
> *I want to* migrate my existing guest networks to another physical network infrastructure
> *In order to* make use of the extra features SDN provides.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message