incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [31/57] api: move and group all under command, org.apache.cloudstack.command.*
Date Sat, 08 Dec 2012 03:29:52 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/router/command/StopRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/router/command/StopRouterCmd.java b/api/src/org/apache/cloudstack/api/admin/router/command/StopRouterCmd.java
deleted file mode 100644
index 593b4c6..0000000
--- a/api/src/org/apache/cloudstack/api/admin/router/command/StopRouterCmd.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// 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.admin.router.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.DomainRouterResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.router.VirtualRouter;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description = "Stops a router.", responseObject = DomainRouterResponse.class)
-public class StopRouterCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopRouterCmd.class.getName());
-    private static final String s_name = "stoprouterresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the router")
-    private Long id;
-
-    @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.")
-    private Boolean forced;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
-        if (router != null) {
-            return router.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_ROUTER_STOP;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "stopping router: " + getId();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.DomainRouter;
-    }
-
-    @Override
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    public boolean isForced() {
-        return (forced != null) ? forced : false;
-    }
-
-    @Override
-    public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
-        UserContext.current().setEventDetails("Router Id: "+getId());
-        VirtualRouter result = _routerService.stopRouter(getId(), isForced());
-        if (result != null) {
-            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to stop router");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/router/command/UpgradeRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/router/command/UpgradeRouterCmd.java b/api/src/org/apache/cloudstack/api/admin/router/command/UpgradeRouterCmd.java
deleted file mode 100644
index 11633bd..0000000
--- a/api/src/org/apache/cloudstack/api/admin/router/command/UpgradeRouterCmd.java
+++ /dev/null
@@ -1,90 +0,0 @@
-// 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.admin.router.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.DomainRouterResponse;
-import com.cloud.network.router.VirtualRouter;
-import com.cloud.user.Account;
-
-@Implementation(description="Upgrades domain router to a new service offering", responseObject=DomainRouterResponse.class)
-public class UpgradeRouterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
-    private static final String s_name = "changeserviceforrouterresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the router")
-    private Long id;
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the domain router")
-    private Long serviceOfferingId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public Long getServiceOfferingId() {
-        return serviceOfferingId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-         return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
-        if (router != null) {
-            return router.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public void execute(){
-        VirtualRouter router = _routerService.upgradeRouter(this);
-        if (router != null){
-            DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(router);
-            routerResponse.setResponseName(getCommandName());
-            this.setResponseObject(routerResponse);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to upgrade router");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/CancelPrimaryStorageMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/CancelPrimaryStorageMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/CancelPrimaryStorageMaintenanceCmd.java
deleted file mode 100644
index d87259b..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/CancelPrimaryStorageMaintenanceCmd.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// 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.admin.storagepool.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.storage.StoragePool;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Cancels maintenance for primary storage", responseObject=StoragePoolResponse.class)
-public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(CancelPrimaryStorageMaintenanceCmd.class.getName());
-
-    private static final String s_name = "cancelprimarystoragemaintenanceresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the primary storage ID")
-    private Long id;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "primarystorage";
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StoragePool;
-    }
-
-    @Override
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_MAINTENANCE_CANCEL_PRIMARY_STORAGE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "canceling maintenance for primary storage pool: " + getId();
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException{
-        StoragePool result = _storageService.cancelPrimaryStorageForMaintenance(this);
-        if (result != null) {
-            StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to cancel primary storage maintenance");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/CreateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/CreateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/CreateStoragePoolCmd.java
deleted file mode 100644
index fd3ca39..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/CreateStoragePoolCmd.java
+++ /dev/null
@@ -1,139 +0,0 @@
-// 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.admin.storagepool.command;
-
-import java.net.UnknownHostException;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.exception.ResourceInUseException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.storage.StoragePool;
-import com.cloud.user.Account;
-
-@SuppressWarnings("rawtypes")
-@Implementation(description="Creates a storage pool.", responseObject=StoragePoolResponse.class)
-public class CreateStoragePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateStoragePoolCmd.class.getName());
-
-    private static final String s_name = "createstoragepoolresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, required=true, description="the cluster ID for the storage pool")
-    private Long clusterId;
-
-    @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the storage pool")
-    private Map details;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name for the storage pool")
-    private String storagePoolName;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the storage pool")
-    private Long podId;
-
-    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for the storage pool")
-    private String tags;
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL of the storage pool")
-    private String url;
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the storage pool")
-    private Long zoneId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getClusterId() {
-        return clusterId;
-    }
-
-    public Map getDetails() {
-        return details;
-    }
-
-    public String getStoragePoolName() {
-        return storagePoolName;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getTags() {
-        return tags;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        try {
-            StoragePool result = _storageService.createPool(this);
-            if (result != null) {
-                StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
-                response.setResponseName(getCommandName());
-                this.setResponseObject(response);
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add storage pool");
-            }
-        } catch (ResourceUnavailableException ex1) {
-            s_logger.warn("Exception: ", ex1);
-            throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex1.getMessage());
-        }catch (ResourceInUseException ex2) {
-            s_logger.warn("Exception: ", ex2);
-            throw new ServerApiException(BaseCmd.RESOURCE_IN_USE_ERROR, ex2.getMessage());
-        } catch (UnknownHostException ex3) {
-            s_logger.warn("Exception: ", ex3);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex3.getMessage());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/DeletePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/DeletePoolCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/DeletePoolCmd.java
deleted file mode 100644
index 473d35e..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/DeletePoolCmd.java
+++ /dev/null
@@ -1,90 +0,0 @@
-// 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.admin.storagepool.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.user.Account;
-
-@Implementation(description = "Deletes a storage pool.", responseObject = SuccessResponse.class)
-public class DeletePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeletePoolCmd.class.getName());
-    private static final String s_name = "deletestoragepoolresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "Storage pool id")
-    private Long id;
-
-    @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force destroy storage pool " +
-            "(force expunge volumes in Destroyed state as a part of pool removal)")
-    private Boolean forced;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public boolean isForced() {
-        return (forced != null) ? forced : false;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute() {
-        boolean result = _storageService.deletePool(this);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            StoragePool pool = _storageService.getStoragePool(id);
-            if (pool != null && pool.getStatus() == StoragePoolStatus.Removed) {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to finish storage pool removal. The storage pool will not be used but cleanup is needed");
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete storage pool");
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/ListStoragePoolsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/ListStoragePoolsCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/ListStoragePoolsCmd.java
deleted file mode 100644
index b987962..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/ListStoragePoolsCmd.java
+++ /dev/null
@@ -1,130 +0,0 @@
-// 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.admin.storagepool.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.storage.StoragePool;
-import com.cloud.utils.Pair;
-
-@Implementation(description="Lists storage pools.", responseObject=StoragePoolResponse.class)
-public class ListStoragePoolsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListStoragePoolsCmd.class.getName());
-
-    private static final String s_name = "liststoragepoolsresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="list storage pools belongig to the specific cluster")
-    private Long clusterId;
-
-    @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="the IP address for the storage pool")
-    private String ipAddress;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the storage pool")
-    private String storagePoolName;
-
-    @Parameter(name=ApiConstants.PATH, type=CommandType.STRING, description="the storage pool path")
-    private String path;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the storage pool")
-    private Long podId;
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the storage pool")
-    private Long zoneId;
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the storage pool")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getClusterId() {
-        return clusterId;
-    }
-
-    public String getIpAddress() {
-        return ipAddress;
-    }
-
-    public String getStoragePoolName() {
-        return storagePoolName;
-    }
-
-    public String getPath() {
-        return path;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StoragePool;
-    }
-
-    @Override
-    public void execute(){
-        Pair<List<? extends StoragePool>, Integer> pools = _mgr.searchForStoragePools(this);
-        ListResponse<StoragePoolResponse> response = new ListResponse<StoragePoolResponse>();
-        List<StoragePoolResponse> poolResponses = new ArrayList<StoragePoolResponse>();
-        for (StoragePool pool : pools.first()) {
-            StoragePoolResponse poolResponse = _responseGenerator.createStoragePoolResponse(pool);
-            poolResponse.setObjectName("storagepool");
-            poolResponses.add(poolResponse);
-        }
-
-        response.setResponses(poolResponses, pools.second());
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/PreparePrimaryStorageForMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/PreparePrimaryStorageForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/PreparePrimaryStorageForMaintenanceCmd.java
deleted file mode 100644
index 3f7f80d..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/PreparePrimaryStorageForMaintenanceCmd.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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.admin.storagepool.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.storage.StoragePool;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Puts storage pool into maintenance state", responseObject=StoragePoolResponse.class)
-public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(PreparePrimaryStorageForMaintenanceCmd.class.getName());
-    private static final String s_name = "prepareprimarystorageformaintenanceresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Primary storage ID")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "primarystorage";
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StoragePool;
-    }
-
-    @Override
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_MAINTENANCE_PREPARE_PRIMARY_STORAGE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "preparing storage pool: " + getId() + " for maintenance";
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
-        StoragePool result = _storageService.preparePrimaryStorageForMaintenance(getId());
-        if (result != null){
-            StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
-            response.setResponseName("storagepool");
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to prepare primary storage for maintenance");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/storagepool/command/UpdateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/storagepool/command/UpdateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/admin/storagepool/command/UpdateStoragePoolCmd.java
deleted file mode 100644
index c027224..0000000
--- a/api/src/org/apache/cloudstack/api/admin/storagepool/command/UpdateStoragePoolCmd.java
+++ /dev/null
@@ -1,88 +0,0 @@
-// 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.admin.storagepool.command;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.storage.StoragePool;
-import com.cloud.user.Account;
-
-@Implementation(description="Updates a storage pool.", responseObject=StoragePoolResponse.class, since="3.0.0")
-public class UpdateStoragePoolCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateStoragePoolCmd.class.getName());
-
-    private static final String s_name = "updatestoragepoolresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the Id of the storage pool")
-    private Long id;
-
-    @Parameter(name=ApiConstants.TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma-separated list of tags for the storage pool")
-    private List<String> tags;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public List<String> getTags() {
-        return tags;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        StoragePool result = _storageService.updateStoragePool(this);
-        if (result != null){
-            StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update storage pool");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/swift/command/AddSwiftCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/swift/command/AddSwiftCmd.java b/api/src/org/apache/cloudstack/api/admin/swift/command/AddSwiftCmd.java
deleted file mode 100644
index 1850240..0000000
--- a/api/src/org/apache/cloudstack/api/admin/swift/command/AddSwiftCmd.java
+++ /dev/null
@@ -1,106 +0,0 @@
-// 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.admin.swift.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.SwiftResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.storage.Swift;
-import com.cloud.user.Account;
-
-@Implementation(description = "Adds Swift.", responseObject = HostResponse.class, since="3.0.0")
-public class AddSwiftCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddSwiftCmd.class.getName());
-    private static final String s_name = "addswiftresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "the URL for swift")
-    private String url;
-
-    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account for swift")
-    private String account;
-
-    @Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, description = "the username for swift")
-    private String username;
-
-    @Parameter(name = ApiConstants.KEY, type = CommandType.STRING, description = " key for the user for swift")
-    private String key;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getUrl() {
-        return url;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    public String getAccount() {
-        return account;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        try {
-            Swift result = _resourceService.discoverSwift(this);
-            SwiftResponse swiftResponse = null;
-            if (result != null) {
-                swiftResponse = _responseGenerator.createSwiftResponse(result);
-                swiftResponse.setResponseName(getCommandName());
-                swiftResponse.setObjectName("swift");
-                this.setResponseObject(swiftResponse);
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Swift");
-            }
-        } catch (DiscoveryException ex) {
-            String errMsg = "Failed to add Swift due to " + ex.toString();
-            s_logger.warn(errMsg, ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, errMsg);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/swift/command/ListSwiftsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/swift/command/ListSwiftsCmd.java b/api/src/org/apache/cloudstack/api/admin/swift/command/ListSwiftsCmd.java
deleted file mode 100644
index 3a2202a..0000000
--- a/api/src/org/apache/cloudstack/api/admin/swift/command/ListSwiftsCmd.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// 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.admin.swift.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.SwiftResponse;
-import com.cloud.storage.Swift;
-import com.cloud.user.Account;
-
-@Implementation(description = "List Swift.", responseObject = HostResponse.class, since="3.0.0")
-public class ListSwiftsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSwiftsCmd.class.getName());
-    private static final String s_name = "listswiftsresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the id of the swift")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        List<? extends Swift> result = _resourceService.listSwifts(this);
-        ListResponse<SwiftResponse> response = new ListResponse<SwiftResponse>();
-        List<SwiftResponse> swiftResponses = new ArrayList<SwiftResponse>();
-
-        if (result != null) {
-            SwiftResponse swiftResponse = null;
-            for (Swift swift : result) {
-                swiftResponse = _responseGenerator.createSwiftResponse(swift);
-                swiftResponse.setResponseName(getCommandName());
-                swiftResponse.setObjectName("swift");
-                swiftResponses.add(swiftResponse);
-            }
-        }
-        response.setResponses(swiftResponses);
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/DestroySystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/DestroySystemVmCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/DestroySystemVmCmd.java
deleted file mode 100644
index 56a82fb..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/DestroySystemVmCmd.java
+++ /dev/null
@@ -1,106 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(responseObject=SystemVmResponse.class, description="Destroyes a system virtual machine.")
-public class DestroySystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroySystemVmCmd.class.getName());
-
-    private static final String s_name = "destroysystemvmresponse";
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
-    private Long id;
-
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "systemvm";
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
-        if(type == VirtualMachine.Type.ConsoleProxy){
-            return EventTypes.EVENT_PROXY_DESTROY;
-        }
-        else{
-            return EventTypes.EVENT_SSVM_DESTROY;
-        }
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "destroying system vm: " + getId();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.SystemVm;
-    }
-
-    @Override
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        VirtualMachine instance = _mgr.destroySystemVM(this);
-        if (instance != null) {
-            SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to destroy system vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/ListSystemVMsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/ListSystemVMsCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/ListSystemVMsCmd.java
deleted file mode 100644
index a1e27cd..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/ListSystemVMsCmd.java
+++ /dev/null
@@ -1,138 +0,0 @@
-// 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.admin.systemvm.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.utils.Pair;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(description="List system virtual machines.", responseObject=SystemVmResponse.class)
-public class ListSystemVMsCmd extends BaseListCmd {
-    public static final Logger s_logger = Logger.getLogger(ListSystemVMsCmd.class.getName());
-
-    private static final String s_name = "listsystemvmsresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID of the system VM")
-    private Long hostId;
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the system VM")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the system VM")
-    private String systemVmName;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID of the system VM")
-    private Long podId;
-
-    @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the system VM")
-    private String state;
-
-    @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\" and \"secondarystoragevm\".")
-    private String systemVmType;
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID of the system VM")
-    private Long zoneId;
-
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to", since="3.0.1")
-    private Long storageId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getSystemVmName() {
-        return systemVmName;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getState() {
-        return state;
-    }
-
-    public String getSystemVmType() {
-        return systemVmType;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public Long getStorageId() {
-        return storageId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.SystemVm;
-    }
-
-    @Override
-    public void execute(){
-        Pair<List<? extends VirtualMachine>, Integer> systemVMs = _mgr.searchForSystemVm(this);
-        ListResponse<SystemVmResponse> response = new ListResponse<SystemVmResponse>();
-        List<SystemVmResponse> vmResponses = new ArrayList<SystemVmResponse>();
-        for (VirtualMachine systemVM : systemVMs.first()) {
-            SystemVmResponse vmResponse = _responseGenerator.createSystemVmResponse(systemVM);
-            vmResponse.setObjectName("systemvm");
-            vmResponses.add(vmResponse);
-        }
-
-        response.setResponses(vmResponses, systemVMs.second());
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/MigrateSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/MigrateSystemVMCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/MigrateSystemVMCmd.java
deleted file mode 100644
index 8876be1..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/MigrateSystemVMCmd.java
+++ /dev/null
@@ -1,134 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmInstanceResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ManagementServerException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.exception.VirtualMachineMigrationException;
-import com.cloud.host.Host;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(description="Attempts Migration of a system virtual machine to the host specified.", responseObject=SystemVmInstanceResponse.class)
-public class MigrateSystemVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(MigrateSystemVMCmd.class.getName());
-
-    private static final String s_name = "migratesystemvmresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, required=true, description="destination Host ID to migrate VM to")
-    private Long hostId;
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine")
-    private Long virtualMachineId;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Long getVirtualMachineId() {
-        return virtualMachineId;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_MIGRATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: "+ getHostId();
-    }
-
-    @Override
-    public void execute(){
-
-        Host destinationHost = _resourceService.getHost(getHostId());
-        if (destinationHost == null) {
-            throw new InvalidParameterValueException("Unable to find the host to migrate the VM, host id=" + getHostId());
-        }
-        try{
-            UserContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " to host Id: "+ getHostId());
-            //FIXME : Should not be calling UserVmService to migrate all types of VMs - need a generic VM layer
-            VirtualMachine migratedVm = _userVmService.migrateVirtualMachine(getVirtualMachineId(), destinationHost);
-            if (migratedVm != null) {
-                // return the generic system VM instance response
-                SystemVmInstanceResponse response = _responseGenerator.createSystemVmInstanceResponse(migratedVm);
-                response.setResponseName(getCommandName());
-                this.setResponseObject(response);
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to migrate the system vm");
-            }
-        } catch (ResourceUnavailableException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
-        } catch (ConcurrentOperationException e) {
-            s_logger.warn("Exception: ", e);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
-        } catch (ManagementServerException e) {
-            s_logger.warn("Exception: ", e);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
-        } catch (VirtualMachineMigrationException e) {
-            s_logger.warn("Exception: ", e);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/RebootSystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/RebootSystemVmCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/RebootSystemVmCmd.java
deleted file mode 100644
index 61a8892..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/RebootSystemVmCmd.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(description="Reboots a system VM.", responseObject=SystemVmResponse.class)
-public class RebootSystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootSystemVmCmd.class.getName());
-
-    private static final String s_name = "rebootsystemvmresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
-        if(type == VirtualMachine.Type.ConsoleProxy){
-            return EventTypes.EVENT_PROXY_REBOOT;
-        }
-        else{
-            return EventTypes.EVENT_SSVM_REBOOT;
-        }
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "rebooting system vm: " + getId();
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.SystemVm;
-    }
-
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        VirtualMachine result = _mgr.rebootSystemVM(this);
-        if (result != null) {
-            SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to reboot system vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/StartSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/StartSystemVMCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/StartSystemVMCmd.java
deleted file mode 100644
index f9e12a8..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/StartSystemVMCmd.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(responseObject=SystemVmResponse.class, description="Starts a system virtual machine.")
-public class StartSystemVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StartSystemVMCmd.class.getName());
-
-    private static final String s_name = "startsystemvmresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "systemvm";
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
-        if(type == VirtualMachine.Type.ConsoleProxy){
-            return EventTypes.EVENT_PROXY_START;
-        }
-        else{
-            return EventTypes.EVENT_SSVM_START;
-        }
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "starting system vm: " + getId();
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.SystemVm;
-    }
-
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        VirtualMachine instance = _mgr.startSystemVM(getId());
-        if (instance != null) {
-            SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to start system vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/StopSystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/StopSystemVmCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/StopSystemVmCmd.java
deleted file mode 100644
index 1bf9583..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/StopSystemVmCmd.java
+++ /dev/null
@@ -1,123 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(description="Stops a system VM.", responseObject=SystemVmResponse.class)
-public class StopSystemVmCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(StopSystemVmCmd.class.getName());
-
-    private static final String s_name = "stopsystemvmresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine")
-    private Long id;
-
-    @Parameter(name=ApiConstants.FORCED, type=CommandType.BOOLEAN, required=false, description="Force stop the VM.  The caller knows the VM is stopped.")
-    private Boolean forced;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        VirtualMachine.Type type = _mgr.findSystemVMTypeById(getId());
-        if(type == VirtualMachine.Type.ConsoleProxy){
-            return EventTypes.EVENT_PROXY_STOP;
-        }
-        else{
-            return EventTypes.EVENT_SSVM_STOP;
-        }
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "stopping system vm: " + getId();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.SystemVm;
-    }
-
-    @Override
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    public boolean isForced() {
-        return (forced != null) ? forced : false;
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        VirtualMachine result = _mgr.stopSystemVM(this);
-        if (result != null) {
-            SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to stop system vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/systemvm/command/UpgradeSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/systemvm/command/UpgradeSystemVMCmd.java b/api/src/org/apache/cloudstack/api/admin/systemvm/command/UpgradeSystemVMCmd.java
deleted file mode 100644
index 88b69e1..0000000
--- a/api/src/org/apache/cloudstack/api/admin/systemvm/command/UpgradeSystemVMCmd.java
+++ /dev/null
@@ -1,104 +0,0 @@
-// 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.admin.systemvm.command;
-
-import org.apache.cloudstack.api.user.vm.command.UpgradeVMCmd;
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.vm.VirtualMachine;
-
-@Implementation(responseObject=SystemVmResponse.class, description="Changes the service offering for a system vm (console proxy or secondary storage). " +
-                                                                                            "The system vm must be in a \"Stopped\" state for " +
-                                                                                            "this command to take effect.")
-public class UpgradeSystemVMCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName());
-    private static final String s_name = "changeserviceforsystemvmresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system vm")
-    private Long id;
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true,
-                description="the service offering ID to apply to the system vm")
-    private Long serviceOfferingId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public Long getServiceOfferingId() {
-        return serviceOfferingId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if (account != null) {
-            return account.getId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-
-        ServiceOffering serviceOffering = _configService.getServiceOffering(serviceOfferingId);
-        if (serviceOffering == null) {
-            throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
-        }
-
-        VirtualMachine result = _mgr.upgradeSystemVM(this);
-        if (result != null) {
-            SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to reboot system vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/af28c069/api/src/org/apache/cloudstack/api/admin/template/command/PrepareTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/template/command/PrepareTemplateCmd.java b/api/src/org/apache/cloudstack/api/admin/template/command/PrepareTemplateCmd.java
deleted file mode 100644
index 910169b..0000000
--- a/api/src/org/apache/cloudstack/api/admin/template/command/PrepareTemplateCmd.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// 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.admin.template.command;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.user.Account;
-
-@Implementation(responseObject=TemplateResponse.class, description="load template into primary storage")
-public class PrepareTemplateCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(PrepareTemplateCmd.class.getName());
-
-    private static final String s_name = "preparetemplateresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, required=true, type=CommandType.LONG, description="zone ID of the template to be prepared in primary storage(s).")
-    private Long zoneId;
-
-    @IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.TEMPLATE_ID, required=true, type=CommandType.LONG, description="template ID of the template to be prepared in primary storage(s).")
-    private Long templateId;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public Long getTemplateId() {
-        return templateId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute() {
-        ListResponse<TemplateResponse> response = new ListResponse<TemplateResponse>();
-
-        VirtualMachineTemplate vmTemplate = _templateService.prepareTemplate(templateId, zoneId);
-        List<TemplateResponse> templateResponses = _responseGenerator.createTemplateResponses(vmTemplate.getId(), zoneId, true);
-        response.setResponses(templateResponses);
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-}
-


Mime
View raw message