You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2013/01/10 01:48:36 UTC

[42/52] [partial] Summary: Fixes for api_refactoring

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
deleted file mode 100644
index 1aa43e6..0000000
--- a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
+++ /dev/null
@@ -1,168 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ServiceOfferingResponse;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
-public class CreateServiceOfferingCmd extends BaseCmd {
-	public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
-	private static final String _name = "createserviceofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.LONG, required=true, description="the CPU number of the service offering")
-    private Long cpuNumber;
-
-    @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.")
-    private Long cpuSpeed;
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the service offering")
-    private String displayText;
-
-    @Parameter(name=ApiConstants.MEMORY, type=CommandType.LONG, required=true, description="the total memory of the service offering in MB")
-    private Long memory;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the service offering")
-    private String serviceOfferingName;
-
-    @Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA for the service offering")
-    private Boolean offerHa;
-
-    @Parameter(name=ApiConstants.LIMIT_CPU_USE, type=CommandType.BOOLEAN, description="restrict the CPU usage to committed service offering")
-    private Boolean limitCpuUse;
-
-    @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.")
-    private String storageType;
-
-    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.")
-    private String tags;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
-    private Long domainId; 
-    
-    @Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.STRING, description="the host tag for this service offering.")
-    private String hostTag;
-
-    @Parameter(name=ApiConstants.IS_SYSTEM_OFFERING, type=CommandType.BOOLEAN, description="is this a system vm offering")
-    private Boolean isSystem;
-
-    @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".")
-    private String systemVmType;
-    
-    @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype")
-    private Integer networkRate;
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getCpuNumber() {
-        return cpuNumber;
-    }
-
-    public Long getCpuSpeed() {
-        return cpuSpeed;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getMemory() {
-        return memory;
-    }
-
-    public String getServiceOfferingName() {
-        return serviceOfferingName;
-    }
-
-    public Boolean getOfferHa() {
-        return offerHa;
-    }
-
-    public Boolean GetLimitCpuUse() {
-    	return limitCpuUse;
-    }
-
-    public String getStorageType() {
-        return storageType;
-    }
-
-    public String getTags() {
-        return tags;
-    }
-
-    public Long getDomainId() {
-		return domainId;
-	}
-
-    public String getHostTag() {
-        return hostTag;
-    }
-
-    public Boolean getIsSystem() {
-        return  isSystem == null ? false : isSystem;
-    }
-
-    public String getSystemVmType() {
-        return systemVmType;
-    }
-    
-    public Integer getNetworkRate() {
-        return networkRate;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-	@Override
-    public String getCommandName() {
-		return _name;
-	}
-	
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        ServiceOffering result = _configService.createServiceOffering(this);
-        if (result != null) {
-            ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create service offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateSnapshotCmd.java b/api/src/com/cloud/api/commands/CreateSnapshotCmd.java
deleted file mode 100755
index e78dbda..0000000
--- a/api/src/com/cloud/api/commands/CreateSnapshotCmd.java
+++ /dev/null
@@ -1,193 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SnapshotResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.PermissionDeniedException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.projects.Project;
-import com.cloud.storage.Snapshot;
-import com.cloud.storage.Volume;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description = "Creates an instant snapshot of a volume.", responseObject = SnapshotResponse.class)
-public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSnapshotCmd.class.getName());
-    private static final String s_name = "createsnapshotresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "The account of the snapshot. The account parameter must be used with the domainId parameter.")
-    private String accountName;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.")
-    private Long domainId;
-
-    @IdentityMapper(entityTableName="volumes")
-    @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, required = true, description = "The ID of the disk volume")
-    private Long volumeId;
-
-    @IdentityMapper(entityTableName="snapshot_policy")
-    @Parameter(name = ApiConstants.POLICY_ID, type = CommandType.LONG, description = "policy id of the snapshot, if this is null, then use MANUAL_POLICY.")
-    private Long policyId;
-        
-    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-    
-    public String getEntityTable() {
-    	return "snapshots";
-    }
-
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public Long getVolumeId() {
-        return volumeId;
-    }
-
-    public Long getPolicyId() {
-        if (policyId != null) {
-            return policyId;
-        } else {
-            return Snapshot.MANUAL_POLICY_ID;
-        }
-    }
-    
-    private Long getHostId() {
-        Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
-        if (volume == null) {
-            throw new InvalidParameterValueException("Unable to find volume by id");
-        }
-        return _snapshotService.getHostIdForSnapshotOperation(volume);
-    }
-
-    
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "snapshot";
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        
-        Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
-        if (volume == null) {
-        	throw new InvalidParameterValueException("Unable to find volume by id=" + volumeId);
-        }
-        
-        Account account = _accountService.getAccount(volume.getAccountId());
-        //Can create templates for enabled projects/accounts only
-        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
-        	Project project = _projectService.findByProjectAccountId(volume.getAccountId());
-            if (project.getState() != Project.State.Active) {
-                throw new PermissionDeniedException("Can't add resources to the project id=" + project.getId() + " in state=" + project.getState() + " as it's no longer active");
-            }
-        } else if (account.getState() == Account.State.disabled) {
-            throw new PermissionDeniedException("The owner of template is disabled: " + account);
-        }
-        
-        return volume.getAccountId();
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_SNAPSHOT_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "creating snapshot for volume: " + getVolumeId();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Snapshot;
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        Snapshot snapshot = _snapshotService.allocSnapshot(getVolumeId(), getPolicyId());
-        if (snapshot != null) {
-            this.setEntityId(snapshot.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot");
-        }
-    }
-
-    @Override
-    public void execute() {
-        UserContext.current().setEventDetails("Volume Id: "+getVolumeId());
-        Snapshot snapshot = _snapshotService.createSnapshot(getVolumeId(), getPolicyId(), getEntityId(), _accountService.getAccount(getEntityOwnerId()));
-        if (snapshot != null) {
-            SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId);
-        }
-    }
-    
-    
-    @Override
-    public String getSyncObjType() {
-        if (getSyncObjId() != null) {
-            return syncObjectType;
-        }
-        return null;
-    }
-
-    @Override
-    public Long getSyncObjId() {
-        if (getHostId() != null) {
-            return getHostId();
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java b/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java
deleted file mode 100644
index 6708bf9..0000000
--- a/api/src/com/cloud/api/commands/CreateSnapshotPolicyCmd.java
+++ /dev/null
@@ -1,135 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SnapshotPolicyResponse;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.PermissionDeniedException;
-import com.cloud.projects.Project;
-import com.cloud.storage.Volume;
-import com.cloud.storage.snapshot.SnapshotPolicy;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a snapshot policy for the account.", responseObject=SnapshotPolicyResponse.class)
-public class CreateSnapshotPolicyCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateSnapshotPolicyCmd.class.getName());
-
-    private static final String s_name = "createsnapshotpolicyresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.INTERVAL_TYPE, type=CommandType.STRING, required=true, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY")
-    private String intervalType;
-
-    @Parameter(name=ApiConstants.MAX_SNAPS, type=CommandType.INTEGER, required=true, description="maximum number of snapshots to retain")
-    private Integer maxSnaps;
-
-    @Parameter(name=ApiConstants.SCHEDULE, type=CommandType.STRING, required=true, description="time the snapshot is scheduled to be taken. " +
-    																				"Format is:" +
-    																				"* if HOURLY, MM" +
-    																				"* if DAILY, MM:HH" +
-    																				"* if WEEKLY, MM:HH:DD (1-7)" +
-    																				"* if MONTHLY, MM:HH:DD (1-28)")
-    private String schedule;
-
-    @Parameter(name=ApiConstants.TIMEZONE, type=CommandType.STRING, required=true, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.")
-    private String timezone;
-
-    @IdentityMapper(entityTableName="volumes")
-    @Parameter(name=ApiConstants.VOLUME_ID, type=CommandType.LONG, required=true, description="the ID of the disk volume")
-    private Long volumeId;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getIntervalType() {
-        return intervalType;
-    }
-
-    public Integer getMaxSnaps() {
-        return maxSnaps;
-    }
-
-    public String getSchedule() {
-        return schedule;
-    }
-
-    public String getTimezone() {
-        return timezone;
-    }
-
-    public Long getVolumeId() {
-        return volumeId;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
-        if (volume == null) {
-        	throw new InvalidParameterValueException("Unable to find volume by id=" + volumeId);
-        }
-        
-        Account account = _accountService.getAccount(volume.getAccountId());
-        //Can create templates for enabled projects/accounts only
-        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
-        	Project project = _projectService.findByProjectAccountId(volume.getAccountId());
-            if (project.getState() != Project.State.Active) {
-            	PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the specified project id in state=" + project.getState() + " as it's no longer active");
-                ex.addProxyObject(project, project.getId(), "projectId");
-                throw ex;
-            }
-        } else if (account.getState() == Account.State.disabled) {
-            throw new PermissionDeniedException("The owner of template is disabled: " + account);
-        }
-        
-        return volume.getAccountId();
-    }
-    
-    @Override
-    public void execute(){
-        SnapshotPolicy result = _snapshotService.createPolicy(this, _accountService.getAccount(getEntityOwnerId()));
-        if (result != null) {
-            SnapshotPolicyResponse response = _responseGenerator.createSnapshotPolicyResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot policy");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateStaticRouteCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateStaticRouteCmd.java b/api/src/com/cloud/api/commands/CreateStaticRouteCmd.java
deleted file mode 100644
index bf287e9..0000000
--- a/api/src/com/cloud/api/commands/CreateStaticRouteCmd.java
+++ /dev/null
@@ -1,149 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.StaticRouteResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.vpc.StaticRoute;
-import com.cloud.network.vpc.VpcGateway;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Creates a static route", responseObject=StaticRouteResponse.class)
-public class CreateStaticRouteCmd extends BaseAsyncCreateCmd{
-    private static final String s_name = "createstaticrouteresponse";
-    public static final Logger s_logger = Logger.getLogger(CreateStaticRouteCmd.class.getName());
-    
-    @IdentityMapper(entityTableName="vpc_gateways")
-    @Parameter(name=ApiConstants.GATEWAY_ID, type=CommandType.LONG, required=true, 
-                                                description="the gateway id we are creating static route for")
-    private Long gatewayId;
-    
-    @Parameter(name = ApiConstants.CIDR, required = true, type = CommandType.STRING, description = "static route cidr")
-    private String cidr;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-    public long getGatewayId() {
-        return gatewayId;
-    }
-
-    public String getCidr() {
-        return cidr;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-    @Override
-    public void create() throws ResourceAllocationException {
-        try {
-            StaticRoute result = _vpcService.createStaticRoute(getGatewayId(), getCidr());
-            setEntityId(result.getId());
-        } catch (NetworkRuleConflictException ex) {
-            s_logger.info("Network rule conflict: " + ex.getMessage());
-            s_logger.trace("Network rule conflict: ", ex);
-            throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
-        }
-    }
-
-    @Override
-    public String getEntityTable() {
-        return "static_routes";
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_STATIC_ROUTE_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "creating static route";
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException {
-        boolean success = false;
-        StaticRoute route = _entityMgr.findById(StaticRoute.class, getEntityId());
-        try {
-            UserContext.current().setEventDetails("Static route Id: " + getEntityId());
-            success = _vpcService.applyStaticRoutes(route.getVpcId());
-
-            // State is different after the route is applied, so get new object here
-            route = _entityMgr.findById(StaticRoute.class, getEntityId());
-            StaticRouteResponse routeResponse = new StaticRouteResponse(); 
-            if (route != null) {
-                routeResponse = _responseGenerator.createStaticRouteResponse(route);
-                setResponseObject(routeResponse);
-            }
-            routeResponse.setResponseName(getCommandName());
-        } finally {
-            if (!success || route == null) {
-                _vpcService.revokeStaticRoute(getEntityId());
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create static route");
-            }
-        }
-    }
-    
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-         VpcGateway gateway =  _vpcService.getVpcGateway(gatewayId);
-         if (gateway == null) {
-             throw new InvalidParameterValueException("Invalid gateway id is specified");
-         }
-         return _vpcService.getVpc(gateway.getVpcId()).getAccountId();
-    }
-    
-    @Override
-    public String getSyncObjType() {
-        return BaseAsyncCmd.vpcSyncObject;
-    }
-
-    @Override
-    public Long getSyncObjId() {
-        VpcGateway gateway =  _vpcService.getVpcGateway(gatewayId);
-        if (gateway == null) {
-            throw new InvalidParameterValueException("Invalid id is specified for the gateway");
-        }
-        return gateway.getVpcId();
-    }
-    
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StaticRoute;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java b/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java
deleted file mode 100755
index 8299ec9..0000000
--- a/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java
+++ /dev/null
@@ -1,127 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.StorageNetworkIpRangeResponse;
-import com.cloud.dc.StorageNetworkIpRange;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a Storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
-public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
-	public static final Logger s_logger = Logger.getLogger(CreateStorageNetworkIpRangeCmd.class);
-	
-	private static final String s_name = "createstoragenetworkiprangeresponse";
-	
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////    
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="UUID of pod where the ip range belongs to")
-    private Long podId;
-    
-    @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address")
-    private String startIp;
-
-    @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address")
-    private String endIp;
-    
-	@Parameter(name = ApiConstants.VLAN, type = CommandType.INTEGER, description = "Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table")
-    private Integer vlan;
-        
-    @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask for storage network")
-    private String netmask;
-    
-    @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for storage network")
-    private String gateway;
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getEndIp() {
-        return endIp;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getStartIp() {
-        return startIp;
-    }
-
-    public Integer getVlan() {
-        return vlan;
-    }
-            
-    public String getNetmask() {
-    	return netmask;
-    }
-    
-    public String getGateWay() {
-    	return gateway;
-    }
-
-	@Override
-	public String getEventType() {
-		return EventTypes.EVENT_STORAGE_IP_RANGE_CREATE;
-	}
-
-	@Override
-	public String getEventDescription() {
-		return "Creating storage ip range from " + getStartIp() + " to " + getEndIp() + " with vlan " + getVlan();
-	}
-
-	@Override
-	public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
-	        ResourceAllocationException {
-		try {
-			StorageNetworkIpRange result = _storageNetworkService.createIpRange(this);
-			StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
-			response.setResponseName(getCommandName());
-			this.setResponseObject(response);
-		} catch (Exception e) {
-			s_logger.warn("Create storage network IP range failed", e);
-			throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
-		}
-	}
-
-	@Override
-	public String getCommandName() {
-		return s_name;
-	}
-
-	@Override
-	public long getEntityOwnerId() {
-		return Account.ACCOUNT_ID_SYSTEM;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java b/api/src/com/cloud/api/commands/CreateStoragePoolCmd.java
deleted file mode 100644
index 8926ea7..0000000
--- a/api/src/com/cloud/api/commands/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 com.cloud.api.commands;
-
-import java.net.UnknownHostException;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.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/c4c9d2d8/api/src/com/cloud/api/commands/CreateTagsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateTagsCmd.java b/api/src/com/cloud/api/commands/CreateTagsCmd.java
deleted file mode 100644
index d52c52f..0000000
--- a/api/src/com/cloud/api/commands/CreateTagsCmd.java
+++ /dev/null
@@ -1,132 +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 com.cloud.api.commands;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
-@Implementation(description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
-public class CreateTagsCmd extends BaseAsyncCmd{
-    public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
-
-    private static final String s_name = "createtagsresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-    
-    @Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, required=true, description = "Map of tags (key/value pairs)")
-    private Map tag;
-    
-    @Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.STRING, required=true, description="type of the resource")
-    private String resourceType;
-    
-    @Parameter(name=ApiConstants.RESOURCE_IDS, type=CommandType.LIST, required=true, 
-            collectionType=CommandType.STRING, description="list of resources to create the tags for")
-    private List<String> resourceIds;
-    
-    @Parameter(name=ApiConstants.CUSTOMER, type=CommandType.STRING, description="identifies client specific tag. " +
-    		"When the value is not null, the tag can't be used by cloudStack code internally")
-    private String customer;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    
-    public TaggedResourceType getResourceType(){
-        return _taggedResourceService.getResourceType(resourceType);
-    } 
-    
-    public Map<String, String> getTags() {
-        Map<String, String> tagsMap = null;
-        if (!tag.isEmpty()) {
-            tagsMap = new HashMap<String, String>();
-            Collection<?> servicesCollection = tag.values();
-            Iterator<?> iter = servicesCollection.iterator();
-            while (iter.hasNext()) {
-                HashMap<String, String> services = (HashMap<String, String>) iter.next();
-                String key = services.get("key");
-                String value = services.get("value");
-                tagsMap.put(key, value);
-            }
-        }
-        return tagsMap;
-    }
-    
-    public List<String> getResourceIds() {
-        return resourceIds;
-    }
-    
-    public String getCustomer() {
-        return customer;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        //FIXME - validate the owner here
-       return 1;
-    }
-
-    @Override
-    public void execute() {
-        List<ResourceTag> tags = _taggedResourceService.createTags(getResourceIds(), getResourceType(), getTags(), getCustomer());
-        
-        if (tags != null && !tags.isEmpty()) {
-                SuccessResponse response = new SuccessResponse(getCommandName());
-                this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create tags");
-        }
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_TAGS_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "creating tags";
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateTemplateCmd.java b/api/src/com/cloud/api/commands/CreateTemplateCmd.java
deleted file mode 100755
index 05f18fb..0000000
--- a/api/src/com/cloud/api/commands/CreateTemplateCmd.java
+++ /dev/null
@@ -1,286 +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 com.cloud.api.commands;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.PermissionDeniedException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.projects.Project;
-import com.cloud.storage.Snapshot;
-import com.cloud.storage.Volume;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(responseObject = StoragePoolResponse.class, description = "Creates a template of a virtual machine. " + "The virtual machine must be in a STOPPED state. "
-        + "A template created from this command is automatically designated as a private template visible to the account that created it.")
-        public class CreateTemplateCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateTemplateCmd.class.getName());
-    private static final String s_name = "createtemplateresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.BITS, type = CommandType.INTEGER, description = "32 or 64 bit")
-    private Integer bits;
-
-    @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "the display text of the template. This is usually used for display purposes.", length=4096)
-    private String displayText;
-
-    @Parameter(name = ApiConstants.IS_FEATURED, type = CommandType.BOOLEAN, description = "true if this template is a featured template, false otherwise")
-    private Boolean featured;
-
-    @Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "true if this template is a public template, false otherwise")
-    private Boolean publicTemplate;
-
-    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the template")
-    private String templateName;
-
-    @IdentityMapper(entityTableName="guest_os")
-    @Parameter(name = ApiConstants.OS_TYPE_ID, type = CommandType.LONG, required = true, description = "the ID of the OS Type that best represents the OS of this template.")
-    private Long osTypeId;
-
-    @Parameter(name = ApiConstants.PASSWORD_ENABLED, type = CommandType.BOOLEAN, description = "true if the template supports the password reset feature; default is false")
-    private Boolean passwordEnabled;
-
-    @Parameter(name = ApiConstants.REQUIRES_HVM, type = CommandType.BOOLEAN, description = "true if the template requres HVM, false otherwise")
-    private Boolean requiresHvm;
-
-    @IdentityMapper(entityTableName="snapshots")
-    @Parameter(name = ApiConstants.SNAPSHOT_ID, type = CommandType.LONG, description = "the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in")
-    private Long snapshotId;
-
-    @IdentityMapper(entityTableName="volumes")
-    @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, description = "the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in")
-    private Long volumeId;
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, description="Optional, VM ID. If this presents, it is going to create a baremetal template for VM this ID refers to. This is only for VM whose hypervisor type is BareMetal")
-    private Long vmId;
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, description="Optional, only for baremetal hypervisor. The directory name where template stored on CIFS server")
-    private String url;
-
-    @Parameter(name=ApiConstants.TEMPLATE_TAG, type=CommandType.STRING, description="the tag for this template.")
-    private String templateTag;
-    
-    @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="Template details in key/value pairs.")
-    protected Map details;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-    
-    public String getEntityTable() {
-    	return "vm_template";
-    }
-
-    public Integer getBits() {
-        return bits;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Boolean isFeatured() {
-        return featured;
-    }
-
-    public Boolean isPublic() {
-        return publicTemplate;
-    }
-
-    public String getTemplateName() {
-        return templateName;
-    }
-
-    public Long getOsTypeId() {
-        return osTypeId;
-    }
-
-    public Boolean isPasswordEnabled() {
-        return passwordEnabled;
-    }
-
-    public Boolean getRequiresHvm() {
-        return requiresHvm;
-    }
-
-    public Long getSnapshotId() {
-        return snapshotId;
-    }
-
-    public Long getVolumeId() {
-        return volumeId;
-    }
-
-    public Long getVmId() {
-        return vmId;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public String getTemplateTag() {
-        return templateTag;
-    }
-    
-    public Map getDetails() {
-    	if (details == null || details.isEmpty()) {
-    		return null;
-    	}
-    	
-    	Collection paramsCollection = details.values();
-    	Map params = (Map) (paramsCollection.toArray())[0];
-    	return params;
-    }
-    
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "template";
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Long volumeId = getVolumeId();
-        Long snapshotId = getSnapshotId();
-        Long accountId = null;
-        if (volumeId != null) {
-            Volume volume = _entityMgr.findById(Volume.class, volumeId);
-            if (volume != null) {
-                accountId = volume.getAccountId();
-            } else {
-            	throw new InvalidParameterValueException("Unable to find volume by id=" + volumeId);
-            }
-        } else {
-            Snapshot snapshot = _entityMgr.findById(Snapshot.class, snapshotId);
-            if (snapshot != null) {
-                accountId = snapshot.getAccountId();
-            } else {
-            	throw new InvalidParameterValueException("Unable to find snapshot by id=" + snapshotId);
-            }
-        }
-        
-        Account account = _accountService.getAccount(accountId);
-        //Can create templates for enabled projects/accounts only
-        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
-        	Project project = _projectService.findByProjectAccountId(accountId);
-            if (project.getState() != Project.State.Active) {
-            	PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the specified project id in state=" + project.getState() + " as it's no longer active");
-                ex.addProxyObject(project, project.getId(), "projectId");
-            }
-        } else if (account.getState() == Account.State.disabled) {
-            throw new PermissionDeniedException("The owner of template is disabled: " + account);
-        }
-        
-        return accountId;
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_TEMPLATE_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "creating template: " + getTemplateName();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Template;
-    }
-
-    private boolean isBareMetal() {
-        return (this.getVmId() != null && this.getUrl() != null);
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        if (isBareMetal()) {
-            _bareMetalVmService.createPrivateTemplateRecord(this, _accountService.getAccount(getEntityOwnerId()));
-            /*Baremetal creates template record after taking image proceeded, use vmId as entity id here*/
-            this.setEntityId(vmId);
-        } else {
-            VirtualMachineTemplate template = null;
-            template = _userVmService.createPrivateTemplateRecord(this, _accountService.getAccount(getEntityOwnerId()));
-            if (template != null) {
-                this.setEntityId(template.getId());
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR,
-                "Failed to create a template");
-            }
-        }
-    }
-
-    @Override
-    public void execute() {
-        UserContext.current().setEventDetails("Template Id: "+getEntityId()+((getSnapshotId() == null) ? " from volume Id: " + getVolumeId() : " from snapshot Id: " + getSnapshotId()));
-        VirtualMachineTemplate template = null;
-        if (isBareMetal()) {
-            template = _bareMetalVmService.createPrivateTemplate(this);
-        } else {
-            template = _userVmService.createPrivateTemplate(this);
-        }
-
-        if (template != null){
-            List<TemplateResponse> templateResponses;
-            if (isBareMetal()) {
-                templateResponses = _responseGenerator.createTemplateResponses(template.getId(), vmId);
-            } else {
-                templateResponses = _responseGenerator.createTemplateResponses(template.getId(), snapshotId, volumeId, false);
-            }
-            TemplateResponse response = new TemplateResponse();
-            if (templateResponses != null && !templateResponses.isEmpty()) {
-                response = templateResponses.get(0);
-            }
-            response.setResponseName(getCommandName());              
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create private template");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateUserCmd.java b/api/src/com/cloud/api/commands/CreateUserCmd.java
deleted file mode 100644
index fc10437..0000000
--- a/api/src/com/cloud/api/commands/CreateUserCmd.java
+++ /dev/null
@@ -1,143 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.UserResponse;
-import com.cloud.user.Account;
-import com.cloud.user.User;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Creates a user for an account that already exists", responseObject=UserResponse.class)
-public class CreateUserCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateUserCmd.class.getName());
-
-    private static final String s_name = "createuserresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Creates the user under the specified account. If no account is specified, the username will be used as the account name.")
-    private String accountName;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Creates the user under the specified domain. Has to be accompanied with the account parameter")
-    private Long domainId;
-
-    @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, required=true, description="email")
-    private String email;
-
-    @Parameter(name=ApiConstants.FIRSTNAME, type=CommandType.STRING, required=true, description="firstname")
-    private String firstname;
-
-    @Parameter(name=ApiConstants.LASTNAME, type=CommandType.STRING, required=true, description="lastname")
-    private String lastname;
-
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.")
-    private String password;
-
-    @Parameter(name=ApiConstants.TIMEZONE, type=CommandType.STRING, description="Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.")
-    private String timezone;
-
-    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="Unique username.")
-    private String username;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public String getFirstName() {
-        return firstname;
-    }
-
-    public String getLastName() {
-        return lastname;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public String getTimezone() {
-        return timezone;
-    }
-
-    public String getUserName() {
-        return username;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        Account account = UserContext.current().getCaller();
-        if ((account == null) || isAdmin(account.getType())) {
-            if ((domainId != null) && (accountName != null)) {
-                Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
-                if (userAccount != null) {
-                    return userAccount.getId();
-                }
-            }
-        }
-
-        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("UserName: "+getUserName()+", FirstName :"+getFirstName()+", LastName: "+getLastName());
-        User user = _accountService.createUser(getUserName(), getPassword(), getFirstName(), getLastName(), getEmail(), getTimezone(), getAccountName(), getDomainId());
-        if (user != null) {
-            UserResponse response = _responseGenerator.createUserResponse(user);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a user");
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateVMGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateVMGroupCmd.java b/api/src/com/cloud/api/commands/CreateVMGroupCmd.java
deleted file mode 100644
index a5cdcd7..0000000
--- a/api/src/com/cloud/api/commands/CreateVMGroupCmd.java
+++ /dev/null
@@ -1,105 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.InstanceGroupResponse;
-import com.cloud.user.UserContext;
-import com.cloud.vm.InstanceGroup;
-
-@Implementation(description = "Creates a vm group", responseObject = InstanceGroupResponse.class)
-public class CreateVMGroupCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateVMGroupCmd.class.getName());
-
-    private static final String s_name = "createinstancegroupresponse";
-
-    // ///////////////////////////////////////////////////
-    // ////////////// API parameters /////////////////////
-    // ///////////////////////////////////////////////////
-
-    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the instance group")
-    private String groupName;
-
-    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account of the instance group. The account parameter must be used with the domainId parameter.")
-    private String accountName;
-
-    @IdentityMapper(entityTableName = "domain")
-    @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "the domain ID of account owning the instance group")
-    private Long domainId;
-
-    @IdentityMapper(entityTableName = "projects")
-    @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.LONG, description = "The project of the instance group")
-    private Long projectId;
-
-    // ///////////////////////////////////////////////////
-    // ///////////////// Accessors ///////////////////////
-    // ///////////////////////////////////////////////////
-
-    public String getGroupName() {
-        return groupName;
-    }
-
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    // ///////////////////////////////////////////////////
-    // ///////////// API Implementation///////////////////
-    // ///////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
-        if (accountId == null) {
-            return UserContext.current().getCaller().getId();
-        }
-
-        return accountId;
-    }
-
-    @Override
-    public void execute() {
-        InstanceGroup result = _userVmService.createVmGroup(this);
-        if (result != null) {
-            InstanceGroupResponse response = _responseGenerator.createInstanceGroupResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create vm instance group");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateVPCCmd.java b/api/src/com/cloud/api/commands/CreateVPCCmd.java
deleted file mode 100644
index 35b526d..0000000
--- a/api/src/com/cloud/api/commands/CreateVPCCmd.java
+++ /dev/null
@@ -1,189 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.VpcResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.vpc.Vpc;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Creates a VPC", responseObject=VpcResponse.class)
-public class CreateVPCCmd extends BaseAsyncCreateCmd{
-    public static final Logger s_logger = Logger.getLogger(CreateVPCCmd.class.getName());
-    private static final String s_name = "createvpcresponse";
-    
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the VPC. " +
-    		"Must be used with the domainId parameter.")
-    private String accountName;
-    
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the VPC. " +
-    		"If used with the account parameter returns the VPC associated with the account for the specified domain.")
-    private Long domainId;
-    
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="create VPC for the project")
-    private Long projectId;
-    
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the availability zone")
-    private Long zoneId;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the VPC")
-    private String vpcName;
-    
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of " +
-            "the VPC")
-    private String displayText;
-    
-    @Parameter(name=ApiConstants.CIDR, type=CommandType.STRING, required=true, description="the cidr of the VPC. All VPC " +
-    		"guest networks' cidrs should be within this CIDR")
-    private String cidr;
-    
-    
-    @IdentityMapper(entityTableName="vpc_offerings")
-    @Parameter(name=ApiConstants.VPC_OFF_ID, type=CommandType.LONG, required=true, description="the ID of the VPC offering")
-    private Long vpcOffering;
-    
-    @Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, 
-            description="VPC network domain. All networks inside the VPC will belong to this domain")
-    private String networkDomain;
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-    
-    public String getAccountName() {
-        return accountName;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public String getVpcName() {
-        return vpcName;
-    }
-
-    public String getCidr() {
-        return cidr;
-    }
-    
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getVpcOffering() {
-        return vpcOffering;
-    }
-    
-    public String getNetworkDomain() {
-        return networkDomain;
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        Vpc vpc = _vpcService.createVpc(getZoneId(), getVpcOffering(), getEntityOwnerId(), getVpcName(), getDisplayText(),
-                getCidr(), getNetworkDomain());
-        if (vpc != null) {
-            this.setEntityId(vpc.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a VPC");
-        }
-    }
-    
-    @Override
-    public void execute() {
-        Vpc vpc = null;
-        try {
-             if (_vpcService.startVpc(this.getEntityId(), true)) {
-                 vpc = _vpcService.getVpc(getEntityId());
-             }
-        } catch (ResourceUnavailableException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
-        } catch (ConcurrentOperationException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage()); 
-        } catch (InsufficientCapacityException ex) {
-            s_logger.info(ex);
-            s_logger.trace(ex);
-            throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
-        }
-        
-        if (vpc != null) {
-            VpcResponse response = _responseGenerator.createVpcResponse(vpc);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create VPC");
-        }
-    }
-
-    @Override
-    public String getEntityTable() {
-        return "vpc";
-    }
-
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VPC_CREATE;
-    }
-
-
-    @Override
-    public String getEventDescription() {
-        return  "creating VPC. Id: " + getEntityId();
-    }
-    
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
-        if (accountId == null) {
-            return UserContext.current().getCaller().getId();
-        }
-        
-        return accountId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateVPCOfferingCmd.java b/api/src/com/cloud/api/commands/CreateVPCOfferingCmd.java
deleted file mode 100644
index 78ce285..0000000
--- a/api/src/com/cloud/api/commands/CreateVPCOfferingCmd.java
+++ /dev/null
@@ -1,120 +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 com.cloud.api.commands;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.BaseCmd.CommandType;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.VpcOfferingResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.network.vpc.VpcOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates VPC offering", responseObject=VpcOfferingResponse.class)
-public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{
-    public static final Logger s_logger = Logger.getLogger(CreateVPCOfferingCmd.class.getName());
-    private static final String _name = "createvpcofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the vpc offering")
-    private String vpcOfferingName;
-    
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of " +
-    		"the vpc offering")
-    private String displayText;
-    
-    @Parameter(name=ApiConstants.SUPPORTED_SERVICES, type=CommandType.LIST, required=true, collectionType=CommandType.STRING,
-            description="services supported by the vpc offering")
-    private List<String> supportedServices;
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-    
-    public String getVpcOfferingName() {
-        return vpcOfferingName;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public List<String> getSupportedServices() {
-        return supportedServices;
-    }
-  
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        VpcOffering vpcOff = _vpcService.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices());
-        if (vpcOff != null) {
-            this.setEntityId(vpcOff.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a VPC offering");
-        }
-    }
-    
-    @Override
-    public void execute() {
-        VpcOffering vpc = _vpcService.getVpcOffering(this.getEntityId());
-        if (vpc != null) {
-            VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(vpc);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create VPC offering");
-        }
-    }
-
-    @Override
-    public String getEntityTable() {
-       return "vpc_offerings";
-    }
-
-    @Override
-    public String getEventType() {
-       return EventTypes.EVENT_VPC_OFFERING_CREATE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "creating VPC offering. Id: " + getEntityId();
-    }
-
-    @Override
-    public String getCommandName() {
-        return _name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-       return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c4c9d2d8/api/src/com/cloud/api/commands/CreateVirtualRouterElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateVirtualRouterElementCmd.java b/api/src/com/cloud/api/commands/CreateVirtualRouterElementCmd.java
deleted file mode 100644
index 2c44663..0000000
--- a/api/src/com/cloud/api/commands/CreateVirtualRouterElementCmd.java
+++ /dev/null
@@ -1,117 +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 com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.PlugService;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.VirtualRouterProviderResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.network.VirtualRouterProvider;
-import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
-import com.cloud.network.element.VirtualRouterElementService;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(responseObject=VirtualRouterProviderResponse.class, description="Create a virtual router element.")
-public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
-	public static final Logger s_logger = Logger.getLogger(CreateVirtualRouterElementCmd.class.getName());
-    private static final String s_name = "createvirtualrouterelementresponse";
-    
-    @PlugService
-    private VirtualRouterElementService _service;
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.NETWORK_SERVICE_PROVIDER_ID, type=CommandType.LONG, required=true, description="the network service provider ID of the virtual router element")
-    @IdentityMapper(entityTableName="physical_network_service_providers")
-    private Long nspId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public void setNspId(Long nspId) {
-        this.nspId = nspId;
-    }
-
-    @Override
-    public String getEntityTable() {
-        return "virtual_router_providers";
-    }
-
-    public Long getNspId() {
-        return nspId;
-    }
-    
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Virtual router element Id: "+getEntityId());
-        VirtualRouterProvider result = _service.getCreatedElement(getEntityId());
-        if (result != null) {
-            VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        }else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
-        }
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException {
-        VirtualRouterProvider result = _service.addElement(getNspId(), VirtualRouterProviderType.VirtualRouter);
-        if (result != null) {
-            setEntityId(result.getId());
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
-        }        
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_SERVICE_PROVIDER_CREATE;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        return  "Adding physical network ServiceProvider Virtual Router: " + getEntityId();
-    }
-}