You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/04 11:02:57 UTC

[50/55] [abbrv] api_refactor: refactor vpn and vm apis

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/ServiceOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/ServiceOfferingResponse.java b/api/src/com/cloud/api/response/ServiceOfferingResponse.java
index fe0efc0..3f12350 100644
--- a/api/src/com/cloud/api/response/ServiceOfferingResponse.java
+++ b/api/src/com/cloud/api/response/ServiceOfferingResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/ServiceResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/ServiceResponse.java b/api/src/com/cloud/api/response/ServiceResponse.java
index 3c73e92..7e72b51 100644
--- a/api/src/com/cloud/api/response/ServiceResponse.java
+++ b/api/src/com/cloud/api/response/ServiceResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java b/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java
index 7c706f3..b17a46d 100644
--- a/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java
+++ b/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/Site2SiteVpnConnectionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/Site2SiteVpnConnectionResponse.java b/api/src/com/cloud/api/response/Site2SiteVpnConnectionResponse.java
index 1af5017..86a7f31 100644
--- a/api/src/com/cloud/api/response/Site2SiteVpnConnectionResponse.java
+++ b/api/src/com/cloud/api/response/Site2SiteVpnConnectionResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/Site2SiteVpnGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/Site2SiteVpnGatewayResponse.java b/api/src/com/cloud/api/response/Site2SiteVpnGatewayResponse.java
index b1eaffd..a7b9c32 100644
--- a/api/src/com/cloud/api/response/Site2SiteVpnGatewayResponse.java
+++ b/api/src/com/cloud/api/response/Site2SiteVpnGatewayResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/SnapshotResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/SnapshotResponse.java b/api/src/com/cloud/api/response/SnapshotResponse.java
index 71b1b14..ba29fdb 100644
--- a/api/src/com/cloud/api/response/SnapshotResponse.java
+++ b/api/src/com/cloud/api/response/SnapshotResponse.java
@@ -19,7 +19,7 @@ package com.cloud.api.response;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.storage.Snapshot;
 import com.cloud.utils.IdentityProxy;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/StaticRouteResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/StaticRouteResponse.java b/api/src/com/cloud/api/response/StaticRouteResponse.java
index 0b950ec..dabae1c 100644
--- a/api/src/com/cloud/api/response/StaticRouteResponse.java
+++ b/api/src/com/cloud/api/response/StaticRouteResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.utils.IdentityProxy;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/StorageNetworkIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/StorageNetworkIpRangeResponse.java b/api/src/com/cloud/api/response/StorageNetworkIpRangeResponse.java
index 8db19d8..f072dd9 100755
--- a/api/src/com/cloud/api/response/StorageNetworkIpRangeResponse.java
+++ b/api/src/com/cloud/api/response/StorageNetworkIpRangeResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/StoragePoolResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/StoragePoolResponse.java b/api/src/com/cloud/api/response/StoragePoolResponse.java
index 3b6a579..4dbe104 100755
--- a/api/src/com/cloud/api/response/StoragePoolResponse.java
+++ b/api/src/com/cloud/api/response/StoragePoolResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.cloud.storage.StoragePoolStatus;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/SwiftResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/SwiftResponse.java b/api/src/com/cloud/api/response/SwiftResponse.java
index 81171de..7471f82 100755
--- a/api/src/com/cloud/api/response/SwiftResponse.java
+++ b/api/src/com/cloud/api/response/SwiftResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/SystemVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/SystemVmResponse.java b/api/src/com/cloud/api/response/SystemVmResponse.java
index ea00258..86b8493 100644
--- a/api/src/com/cloud/api/response/SystemVmResponse.java
+++ b/api/src/com/cloud/api/response/SystemVmResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/TemplatePermissionsResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/TemplatePermissionsResponse.java b/api/src/com/cloud/api/response/TemplatePermissionsResponse.java
index 1f80146..9058afb 100644
--- a/api/src/com/cloud/api/response/TemplatePermissionsResponse.java
+++ b/api/src/com/cloud/api/response/TemplatePermissionsResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/TemplateResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/TemplateResponse.java b/api/src/com/cloud/api/response/TemplateResponse.java
index 5c3d339..950071a 100755
--- a/api/src/com/cloud/api/response/TemplateResponse.java
+++ b/api/src/com/cloud/api/response/TemplateResponse.java
@@ -20,7 +20,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.utils.IdentityProxy;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/TrafficTypeImplementorResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/TrafficTypeImplementorResponse.java b/api/src/com/cloud/api/response/TrafficTypeImplementorResponse.java
index 3a5d4f7..29d6b95 100755
--- a/api/src/com/cloud/api/response/TrafficTypeImplementorResponse.java
+++ b/api/src/com/cloud/api/response/TrafficTypeImplementorResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/TrafficTypeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/TrafficTypeResponse.java b/api/src/com/cloud/api/response/TrafficTypeResponse.java
index f64fbb1..3b63683 100644
--- a/api/src/com/cloud/api/response/TrafficTypeResponse.java
+++ b/api/src/com/cloud/api/response/TrafficTypeResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/UpgradeVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/UpgradeVmResponse.java b/api/src/com/cloud/api/response/UpgradeVmResponse.java
index e48ec08..9e272fb 100644
--- a/api/src/com/cloud/api/response/UpgradeVmResponse.java
+++ b/api/src/com/cloud/api/response/UpgradeVmResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.Date;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/UserVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/UserVmResponse.java b/api/src/com/cloud/api/response/UserVmResponse.java
index f74c072..6f8f080 100755
--- a/api/src/com/cloud/api/response/UserVmResponse.java
+++ b/api/src/com/cloud/api/response/UserVmResponse.java
@@ -19,7 +19,7 @@ package com.cloud.api.response;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.utils.IdentityProxy;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VirtualRouterProviderResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VirtualRouterProviderResponse.java b/api/src/com/cloud/api/response/VirtualRouterProviderResponse.java
index 3e3e33d..15710b2 100644
--- a/api/src/com/cloud/api/response/VirtualRouterProviderResponse.java
+++ b/api/src/com/cloud/api/response/VirtualRouterProviderResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VlanIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VlanIpRangeResponse.java b/api/src/com/cloud/api/response/VlanIpRangeResponse.java
index 6335816..197e3fb 100644
--- a/api/src/com/cloud/api/response/VlanIpRangeResponse.java
+++ b/api/src/com/cloud/api/response/VlanIpRangeResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VolumeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VolumeResponse.java b/api/src/com/cloud/api/response/VolumeResponse.java
index b563390..2d97287 100755
--- a/api/src/com/cloud/api/response/VolumeResponse.java
+++ b/api/src/com/cloud/api/response/VolumeResponse.java
@@ -19,7 +19,7 @@ package com.cloud.api.response;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.utils.IdentityProxy;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VpcOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VpcOfferingResponse.java b/api/src/com/cloud/api/response/VpcOfferingResponse.java
index 51c5fc2..6c20c34 100644
--- a/api/src/com/cloud/api/response/VpcOfferingResponse.java
+++ b/api/src/com/cloud/api/response/VpcOfferingResponse.java
@@ -19,7 +19,7 @@ package com.cloud.api.response;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.utils.IdentityProxy;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VpcResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VpcResponse.java b/api/src/com/cloud/api/response/VpcResponse.java
index bb79e53..d94a796 100644
--- a/api/src/com/cloud/api/response/VpcResponse.java
+++ b/api/src/com/cloud/api/response/VpcResponse.java
@@ -19,7 +19,7 @@ package com.cloud.api.response;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.serializer.Param;
 import com.cloud.utils.IdentityProxy;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/VpnUsersResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/VpnUsersResponse.java b/api/src/com/cloud/api/response/VpnUsersResponse.java
index d1e0580..97f2686 100644
--- a/api/src/com/cloud/api/response/VpnUsersResponse.java
+++ b/api/src/com/cloud/api/response/VpnUsersResponse.java
@@ -16,7 +16,7 @@
 // under the License.
 package com.cloud.api.response;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/api/response/ZoneResponse.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/response/ZoneResponse.java b/api/src/com/cloud/api/response/ZoneResponse.java
index 98f808d..69c83cb 100755
--- a/api/src/com/cloud/api/response/ZoneResponse.java
+++ b/api/src/com/cloud/api/response/ZoneResponse.java
@@ -18,7 +18,7 @@ package com.cloud.api.response;
 
 import java.util.List;
 
-import com.cloud.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants;
 import com.cloud.utils.IdentityProxy;
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/async/AsyncJob.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java
index b8551ed..50ca906 100644
--- a/api/src/com/cloud/async/AsyncJob.java
+++ b/api/src/com/cloud/async/AsyncJob.java
@@ -18,7 +18,7 @@ package com.cloud.async;
 
 import java.util.Date;
 
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
 
 public interface AsyncJob extends Identity {
     public enum Type {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/network/vpc/VpcGateway.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpc/VpcGateway.java b/api/src/com/cloud/network/vpc/VpcGateway.java
index c972c35..23f31fb 100644
--- a/api/src/com/cloud/network/vpc/VpcGateway.java
+++ b/api/src/com/cloud/network/vpc/VpcGateway.java
@@ -17,7 +17,7 @@
 package com.cloud.network.vpc;
 
 import com.cloud.acl.ControlledEntity;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
 
 public interface VpcGateway extends Identity, ControlledEntity {
     public enum Type {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
index 4d820a7..b74611b 100644
--- a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
+++ b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
@@ -18,7 +18,7 @@ package com.cloud.network.vpn;
 
 import java.util.List;
 
-import com.cloud.api.commands.ListRemoteAccessVpnsCmd;
+import org.apache.cloudstack.api.user.vpn.command.ListRemoteAccessVpnsCmd;
 import com.cloud.api.commands.ListVpnUsersCmd;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceUnavailableException;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
index 69eab1a..94863cf 100644
--- a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
+++ b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
@@ -18,17 +18,17 @@ package com.cloud.network.vpn;
 
 import java.util.List;
 
-import com.cloud.api.commands.CreateVpnConnectionCmd;
-import com.cloud.api.commands.CreateVpnCustomerGatewayCmd;
-import com.cloud.api.commands.CreateVpnGatewayCmd;
-import com.cloud.api.commands.DeleteVpnConnectionCmd;
-import com.cloud.api.commands.DeleteVpnCustomerGatewayCmd;
-import com.cloud.api.commands.DeleteVpnGatewayCmd;
-import com.cloud.api.commands.ListVpnConnectionsCmd;
-import com.cloud.api.commands.ListVpnCustomerGatewaysCmd;
-import com.cloud.api.commands.ListVpnGatewaysCmd;
-import com.cloud.api.commands.ResetVpnConnectionCmd;
-import com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.user.vpn.command.CreateVpnConnectionCmd;
+import org.apache.cloudstack.api.user.vpn.command.CreateVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.user.vpn.command.CreateVpnGatewayCmd;
+import org.apache.cloudstack.api.user.vpn.command.DeleteVpnConnectionCmd;
+import org.apache.cloudstack.api.user.vpn.command.DeleteVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.user.vpn.command.DeleteVpnGatewayCmd;
+import org.apache.cloudstack.api.user.vpn.command.ListVpnConnectionsCmd;
+import org.apache.cloudstack.api.user.vpn.command.ListVpnCustomerGatewaysCmd;
+import org.apache.cloudstack.api.user.vpn.command.ListVpnGatewaysCmd;
+import org.apache.cloudstack.api.user.vpn.command.ResetVpnConnectionCmd;
+import org.apache.cloudstack.api.user.vpn.command.UpdateVpnCustomerGatewayCmd;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.Site2SiteCustomerGateway;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/projects/Project.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/projects/Project.java b/api/src/com/cloud/projects/Project.java
index f67506e..f861a5b 100644
--- a/api/src/com/cloud/projects/Project.java
+++ b/api/src/com/cloud/projects/Project.java
@@ -18,7 +18,7 @@ package com.cloud.projects;
 
 import java.util.Date;
 
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
 import com.cloud.domain.PartOf;
 
 public interface Project extends PartOf, Identity {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 7532cae..c97b67b 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -23,12 +23,12 @@ import java.util.Map;
 import java.util.Set;
 
 import com.cloud.alert.Alert;
-import com.cloud.api.ServerApiException;
+import org.apache.cloudstack.api.ServerApiException;
 import com.cloud.api.commands.CreateSSHKeyPairCmd;
 import com.cloud.api.commands.DeleteSSHKeyPairCmd;
 import com.cloud.api.commands.DestroySystemVmCmd;
 import com.cloud.api.commands.ExtractVolumeCmd;
-import com.cloud.api.commands.GetVMPasswordCmd;
+import org.apache.cloudstack.api.user.vm.command.GetVMPasswordCmd;
 import com.cloud.api.commands.ListAlertsCmd;
 import com.cloud.api.commands.ListAsyncJobsCmd;
 import com.cloud.api.commands.ListCapabilitiesCmd;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/vm/UserVmService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java
index 98d02db..adc1ac5 100755
--- a/api/src/com/cloud/vm/UserVmService.java
+++ b/api/src/com/cloud/vm/UserVmService.java
@@ -21,22 +21,22 @@ import java.util.Map;
 
 import javax.naming.InsufficientResourcesException;
 
-import com.cloud.api.commands.AssignVMCmd;
+import org.apache.cloudstack.api.admin.vm.command.AssignVMCmd;
 import com.cloud.api.commands.AttachVolumeCmd;
 import com.cloud.api.commands.CreateTemplateCmd;
 import com.cloud.api.commands.CreateVMGroupCmd;
 import com.cloud.api.commands.DeleteVMGroupCmd;
-import com.cloud.api.commands.DeployVMCmd;
-import com.cloud.api.commands.DestroyVMCmd;
+import org.apache.cloudstack.api.user.vm.command.DeployVMCmd;
+import org.apache.cloudstack.api.user.vm.command.DestroyVMCmd;
 import com.cloud.api.commands.DetachVolumeCmd;
-import com.cloud.api.commands.ListVMsCmd;
-import com.cloud.api.commands.RebootVMCmd;
-import com.cloud.api.commands.RecoverVMCmd;
-import com.cloud.api.commands.ResetVMPasswordCmd;
-import com.cloud.api.commands.RestoreVMCmd;
-import com.cloud.api.commands.StartVMCmd;
-import com.cloud.api.commands.UpdateVMCmd;
-import com.cloud.api.commands.UpgradeVMCmd;
+import org.apache.cloudstack.api.user.vm.command.ListVMsCmd;
+import org.apache.cloudstack.api.user.vm.command.RebootVMCmd;
+import org.apache.cloudstack.api.admin.vm.command.RecoverVMCmd;
+import org.apache.cloudstack.api.user.vm.command.ResetVMPasswordCmd;
+import org.apache.cloudstack.api.user.vm.command.RestoreVMCmd;
+import org.apache.cloudstack.api.user.vm.command.StartVMCmd;
+import org.apache.cloudstack.api.user.vm.command.UpdateVMCmd;
+import org.apache.cloudstack.api.user.vm.command.UpgradeVMCmd;
 import com.cloud.dc.DataCenter;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/com/cloud/vm/VirtualMachine.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java
index 1fa16c3..af6d102 100755
--- a/api/src/com/cloud/vm/VirtualMachine.java
+++ b/api/src/com/cloud/vm/VirtualMachine.java
@@ -20,7 +20,7 @@ import java.util.Date;
 import java.util.Map;
 
 import com.cloud.acl.ControlledEntity;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.utils.fsm.StateMachine2;
 import com.cloud.utils.fsm.StateObject;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/ACL.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ACL.java b/api/src/org/apache/cloudstack/api/ACL.java
new file mode 100644
index 0000000..3623d1a
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/ACL.java
@@ -0,0 +1,31 @@
+// 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;
+
+import static java.lang.annotation.ElementType.FIELD;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ FIELD })
+public @interface ACL {
+
+    boolean checkKeyAccess() default false;
+    boolean checkValueAccess() default false;
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
new file mode 100755
index 0000000..8b05f1d
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -0,0 +1,431 @@
+// 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;
+
+public class ApiConstants {
+    public static final String ACCOUNT = "account";
+    public static final String ACCOUNTS = "accounts";
+    public static final String ACCOUNT_TYPE = "accounttype";
+    public static final String ACCOUNT_ID = "accountid";
+    public static final String ALGORITHM = "algorithm";
+    public static final String ALLOCATED_ONLY = "allocatedonly";
+    public static final String API_KEY = "userapikey";
+    public static final String APPLIED = "applied";
+    public static final String AVAILABLE = "available";
+    public static final String BITS = "bits";
+    public static final String BOOTABLE = "bootable";
+    public static final String BIND_DN = "binddn";
+    public static final String BIND_PASSWORD = "bindpass";
+    public static final String CATEGORY = "category";
+    public static final String CERTIFICATE = "certificate";
+    public static final String PRIVATE_KEY = "privatekey";
+    public static final String DOMAIN_SUFFIX = "domainsuffix";
+    public static final String DNS_SEARCH_ORDER = "dnssearchorder";
+    public static final String CIDR = "cidr";
+    public static final String CIDR_LIST = "cidrlist";
+    public static final String CLEANUP = "cleanup";
+    public static final String CLUSTER_ID = "clusterid";
+    public static final String CLUSTER_NAME = "clustername";
+    public static final String CLUSTER_TYPE = "clustertype";
+    public static final String COMPONENT = "component";
+    public static final String CPU_NUMBER = "cpunumber";
+    public static final String CPU_SPEED = "cpuspeed";
+    public static final String CREATED = "created";
+    public static final String CUSTOMIZED = "customized";
+    public static final String DESCRIPTION = "description";
+    public static final String DESTINATION_ZONE_ID = "destzoneid";
+    public static final String DETAILS = "details";
+    public static final String DEVICE_ID = "deviceid";
+    public static final String DISK_OFFERING_ID = "diskofferingid";
+    public static final String DISK_SIZE = "disksize";
+    public static final String DISPLAY_NAME = "displayname";
+    public static final String DISPLAY_TEXT = "displaytext";
+    public static final String DNS1 = "dns1";
+    public static final String DNS2 = "dns2";
+    public static final String DOMAIN = "domain";
+    public static final String DOMAIN_ID = "domainid";
+    public static final String DURATION = "duration";
+    public static final String EMAIL = "email";
+    public static final String END_DATE = "enddate";
+    public static final String END_IP = "endip";
+    public static final String END_PORT = "endport";
+    public static final String ENTRY_TIME = "entrytime";
+    public static final String FETCH_LATEST = "fetchlatest";
+    public static final String FIRSTNAME = "firstname";
+    public static final String FORCED = "forced";
+    public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
+    public static final String FORMAT = "format";
+    public static final String FOR_VIRTUAL_NETWORK = "forvirtualnetwork";
+    public static final String GATEWAY = "gateway";
+    public static final String GROUP = "group";
+    public static final String GROUP_ID = "groupid";
+    public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
+    public static final String HA_ENABLE = "haenable";
+    public static final String HOST_ID = "hostid";
+    public static final String HOST_NAME = "hostname";
+    public static final String HYPERVISOR = "hypervisor";
+    public static final String INLINE = "inline";
+    public static final String INSTANCE = "instance";
+    public static final String ICMP_CODE = "icmpcode";
+    public static final String ICMP_TYPE = "icmptype";
+    public static final String ID = "id";
+    public static final String IDS = "ids";
+    public static final String INTERNAL_DNS1 = "internaldns1";
+    public static final String INTERNAL_DNS2 = "internaldns2";
+    public static final String INTERVAL_TYPE = "intervaltype";
+    public static final String IP_ADDRESS = "ipaddress";
+    public static final String IP_ADDRESS_ID = "ipaddressid";
+    public static final String IP_AVAILABLE = "ipavailable";
+    public static final String IP_LIMIT = "iplimit";
+    public static final String IP_TOTAL = "iptotal";
+    public static final String IS_CLEANUP_REQUIRED = "iscleanuprequired";
+    public static final String IS_EXTRACTABLE = "isextractable";
+    public static final String IS_FEATURED = "isfeatured";
+    public static final String IS_PUBLIC = "ispublic";
+    public static final String IS_READY = "isready";
+    public static final String IS_RECURSIVE = "isrecursive";
+    public static final String ISO_FILTER = "isofilter";
+    public static final String ISO_GUEST_OS_NONE = "None";
+    public static final String JOB_ID = "jobid";
+    public static final String JOB_STATUS = "jobstatus";
+    public static final String LASTNAME = "lastname";
+    public static final String LEVEL = "level";
+    public static final String LIMIT_CPU_USE = "limitcpuuse";
+    public static final String LOCK = "lock";
+    public static final String LUN = "lun";
+    public static final String LBID = "lbruleid";
+    public static final String MAX = "max";
+    public static final String MAX_SNAPS = "maxsnaps";
+    public static final String MEMORY = "memory";
+    public static final String MODE = "mode";
+    public static final String NAME = "name";
+    public static final String METHOD_NAME = "methodname";
+    public static final String NETWORK_DOMAIN = "networkdomain";
+    public static final String NETMASK = "netmask";
+    public static final String NEW_NAME = "newname";
+    public static final String NUM_RETRIES = "numretries";
+    public static final String OFFER_HA = "offerha";
+    public static final String IS_SYSTEM_OFFERING = "issystem";
+    public static final String IS_DEFAULT_USE = "defaultuse";
+    public static final String OP = "op";
+    public static final String OS_CATEGORY_ID = "oscategoryid";
+    public static final String OS_TYPE_ID = "ostypeid";
+    public static final String PARENT_DOMAIN_ID = "parentdomainid";
+    public static final String PASSWORD = "password";
+    public static final String NEW_PASSWORD = "new_password";
+    public static final String PASSWORD_ENABLED = "passwordenabled";
+    public static final String SSHKEY_ENABLED = "sshkeyenabled";
+    public static final String PATH = "path";
+    public static final String POD_ID = "podid";
+    public static final String POD_IDS = "podids";
+    public static final String POLICY_ID = "policyid";
+    public static final String PORT = "port";
+    public static final String PORTAL = "portal";
+    public static final String PORT_FORWARDING_SERVICE_ID = "portforwardingserviceid";
+    public static final String PRIVATE_INTERFACE = "privateinterface";
+    public static final String PRIVATE_IP = "privateip";
+    public static final String PRIVATE_PORT = "privateport";
+    public static final String PRIVATE_START_PORT = "privateport";
+    public static final String PRIVATE_END_PORT = "privateendport";
+    public static final String PRIVATE_ZONE = "privatezone";
+    public static final String PROTOCOL = "protocol";
+    public static final String PUBLIC_INTERFACE = "publicinterface";
+    public static final String PUBLIC_IP_ID = "publicipid";
+    public static final String PUBLIC_IP = "publicip";
+    public static final String PUBLIC_PORT = "publicport";
+    public static final String PUBLIC_START_PORT = "publicport";
+    public static final String PUBLIC_END_PORT = "publicendport";
+    public static final String PUBLIC_ZONE = "publiczone";
+    public static final String RECEIVED_BYTES = "receivedbytes";
+    public static final String REQUIRES_HVM = "requireshvm";
+    public static final String RESOURCE_TYPE = "resourcetype";
+    public static final String QUERY_FILTER = "queryfilter";
+    public static final String SCHEDULE = "schedule";
+    public static final String SCOPE = "scope";
+    public static final String SECRET_KEY = "usersecretkey";
+    public static final String KEY = "key";
+    public static final String SEARCH_BASE = "searchbase";
+    public static final String SECURITY_GROUP_IDS = "securitygroupids";
+    public static final String SECURITY_GROUP_NAMES = "securitygroupnames";
+    public static final String SECURITY_GROUP_NAME = "securitygroupname";
+    public static final String SECURITY_GROUP_ID = "securitygroupid";
+    public static final String SENT = "sent";
+    public static final String SENT_BYTES = "sentbytes";
+    public static final String SERVICE_OFFERING_ID = "serviceofferingid";
+    public static final String SHOW_CAPACITIES = "showcapacities";
+    public static final String SIZE = "size";
+    public static final String SNAPSHOT_ID = "snapshotid";
+    public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid";
+    public static final String SNAPSHOT_TYPE = "snapshottype";
+    public static final String SOURCE_ZONE_ID = "sourcezoneid";
+    public static final String START_DATE = "startdate";
+    public static final String START_IP = "startip";
+    public static final String START_PORT = "startport";
+    public static final String STATE = "state";
+    public static final String STATUS = "status";
+    public static final String STORAGE_TYPE = "storagetype";
+    public static final String SYSTEM_VM_TYPE = "systemvmtype";
+    public static final String TAGS = "tags";
+    public static final String TARGET_IQN = "targetiqn";
+    public static final String TEMPLATE_FILTER = "templatefilter";
+    public static final String TEMPLATE_ID = "templateid";
+    public static final String ISO_ID = "isoid";
+    public static final String TIMEOUT = "timeout";
+    public static final String TIMEZONE = "timezone";
+    public static final String TYPE = "type";
+    public static final String TRUST_STORE = "truststore";
+    public static final String TRUST_STORE_PASSWORD = "truststorepass";
+    public static final String URL = "url";
+    public static final String USAGE_INTERFACE = "usageinterface";
+    public static final String USER_DATA = "userdata";
+    public static final String USER_ID = "userid";
+    public static final String USE_SSL = "ssl";
+    public static final String USERNAME = "username";
+    public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
+    public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
+    public static final String VALUE = "value";
+    public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
+    public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
+    public static final String VLAN = "vlan";
+    public static final String VLAN_ID = "vlanid";
+    public static final String VM_AVAILABLE = "vmavailable";
+    public static final String VM_LIMIT = "vmlimit";
+    public static final String VM_TOTAL = "vmtotal";
+    public static final String VNET = "vnet";
+    public static final String VOLUME_ID = "volumeid";
+    public static final String ZONE_ID = "zoneid";
+    public static final String ZONE_NAME = "zonename";
+    public static final String NETWORK_TYPE = "networktype";
+    public static final String PAGE = "page";
+    public static final String PAGE_SIZE = "pagesize";
+    public static final String COUNT = "count";
+    public static final String TRAFFIC_TYPE = "traffictype";
+    public static final String NETWORK_OFFERING_ID = "networkofferingid";
+    public static final String NETWORK_IDS = "networkids";
+    public static final String NETWORK_ID = "networkid";
+    public static final String SPECIFY_VLAN = "specifyvlan";
+    public static final String IS_DEFAULT = "isdefault";
+    public static final String IS_SYSTEM = "issystem";
+    public static final String AVAILABILITY = "availability";
+    public static final String NETWORKRATE = "networkrate";
+    public static final String HOST_TAGS = "hosttags";
+    public static final String SSH_KEYPAIR = "keypair";
+    public static final String HOST_CPU_CAPACITY = "hostcpucapacity";
+    public static final String HOST_CPU_NUM = "hostcpunum";
+    public static final String HOST_MEM_CAPACITY = "hostmemcapacity";
+    public static final String HOST_MAC = "hostmac";
+    public static final String HOST_TAG = "hosttag";
+    public static final String PXE_SERVER_TYPE = "pxeservertype";
+    public static final String LINMIN_USERNAME = "linminusername";
+    public static final String LINMIN_PASSWORD = "linminpassword";
+    public static final String LINMIN_APID = "linminapid";
+    public static final String DHCP_SERVER_TYPE = "dhcpservertype";
+    public static final String LINK_LOCAL_IP = "linklocalip";
+    public static final String LINK_LOCAL_MAC_ADDRESS = "linklocalmacaddress";
+    public static final String LINK_LOCAL_MAC_NETMASK = "linklocalnetmask";
+    public static final String LINK_LOCAL_NETWORK_ID = "linklocalnetworkid";
+    public static final String PRIVATE_MAC_ADDRESS = "privatemacaddress";
+    public static final String PRIVATE_NETMASK = "privatenetmask";
+    public static final String PRIVATE_NETWORK_ID = "privatenetworkid";
+    public static final String ALLOCATION_STATE = "allocationstate";
+    public static final String MANAGED_STATE = "managedstate";
+    public static final String STORAGE_ID = "storageid";
+    public static final String PING_STORAGE_SERVER_IP = "pingstorageserverip";
+    public static final String PING_DIR = "pingdir";
+    public static final String TFTP_DIR = "tftpdir";
+    public static final String PING_CIFS_USERNAME = "pingcifsusername";
+    public static final String PING_CIFS_PASSWORD = "pingcifspassword";
+    public static final String CHECKSUM = "checksum";
+    public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";
+    public static final String NETWORK_DEVICE_PARAMETER_LIST = "networkdeviceparameterlist";
+    public static final String ZONE_TOKEN = "zonetoken";
+    public static final String DHCP_PROVIDER = "dhcpprovider";
+    public static final String RESULT = "success";
+    public static final String LUN_ID = "lunId";
+    public static final String IQN = "iqn";
+    public static final String AGGREGATE_NAME = "aggregatename";
+    public static final String POOL_NAME = "poolname";
+    public static final String VOLUME_NAME = "volumename";
+    public static final String SNAPSHOT_POLICY = "snapshotpolicy";
+    public static final String SNAPSHOT_RESERVATION = "snapshotreservation";
+    public static final String IP_NETWORK_LIST = "iptonetworklist";
+    public static final String PARAM_LIST = "param";
+    public static final String FOR_LOAD_BALANCING = "forloadbalancing";
+    public static final String KEYBOARD = "keyboard";
+    public static final String OPEN_FIREWALL = "openfirewall";
+    public static final String TEMPLATE_TAG = "templatetag";
+    public static final String HYPERVISOR_VERSION = "hypervisorversion";
+    public static final String MAX_GUESTS_LIMIT = "maxguestslimit";
+    public static final String PROJECT_ID = "projectid";
+    public static final String PROJECT_IDS = "projectids";
+    public static final String PROJECT = "project";
+    public static final String ROLE = "role";
+    public static final String USER = "user";
+    public static final String ACTIVE_ONLY = "activeonly";
+    public static final String TOKEN = "token";
+    public static final String ACCEPT = "accept";
+    public static final String SORT_KEY = "sortkey";
+    public static final String ACCOUNT_DETAILS = "accountdetails";
+    public static final String SERVICE_PROVIDER_LIST = "serviceproviderlist";
+    public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
+    public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
+    public static final String PROVIDER = "provider";
+    public static final String NETWORK_SPEED = "networkspeed";
+    public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";
+    public static final String ISOLATION_METHODS = "isolationmethods";
+    public static final String PHYSICAL_NETWORK_ID = "physicalnetworkid";
+    public static final String DEST_PHYSICAL_NETWORK_ID = "destinationphysicalnetworkid";
+    public static final String ENABLED = "enabled";
+    public static final String SERVICE_NAME = "servicename";
+    public static final String DHCP_RANGE = "dhcprange";
+    public static final String UUID = "uuid";
+    public static final String SECURITY_GROUP_EANBLED = "securitygroupenabled";
+    public static final String LOCAL_STORAGE_ENABLED = "localstorageenabled";
+    public static final String GUEST_IP_TYPE = "guestiptype";
+    public static final String XEN_NETWORK_LABEL = "xennetworklabel";
+    public static final String KVM_NETWORK_LABEL = "kvmnetworklabel";
+    public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel";
+    public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid";
+    public static final String SERVICE_LIST = "servicelist";
+    public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice";
+    public static final String SUPPORTED_SERVICES = "supportedservices";
+    public static final String NSP_ID = "nspid";
+    public static final String ACL_TYPE = "acltype";
+    public static final String SUBDOMAIN_ACCESS = "subdomainaccess";
+    public static final String LOAD_BALANCER_DEVICE_ID = "lbdeviceid";
+    public static final String LOAD_BALANCER_DEVICE_NAME = "lbdevicename";
+    public static final String LOAD_BALANCER_DEVICE_STATE = "lbdevicestate";
+    public static final String LOAD_BALANCER_DEVICE_CAPACITY = "lbdevicecapacity";
+    public static final String LOAD_BALANCER_DEVICE_DEDICATED = "lbdevicededicated";
+    public static final String FIREWALL_DEVICE_ID = "fwdeviceid";
+    public static final String FIREWALL_DEVICE_NAME = "fwdevicename";
+    public static final String FIREWALL_DEVICE_STATE = "fwdevicestate";
+    public static final String FIREWALL_DEVICE_CAPACITY = "fwdevicecapacity";
+    public static final String FIREWALL_DEVICE_DEDICATED = "fwdevicededicated";
+    public static final String SERVICE = "service";
+    public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
+    public static final String ASSOCIATED_NETWORK_NAME = "associatednetworkname";
+    public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
+    public static final String RESOURCE_STATE = "resourcestate";
+    public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
+    public static final String RESTART_REQUIRED = "restartrequired";
+    public static final String ALLOW_USER_CREATE_PROJECTS = "allowusercreateprojects";
+    public static final String CONSERVE_MODE = "conservemode";
+    public static final String TRAFFIC_TYPE_IMPLEMENTOR = "traffictypeimplementor";
+    public static final String KEYWORD = "keyword";
+    public static final String LIST_ALL = "listall";
+    public static final String SPECIFY_IP_RANGES = "specifyipranges";
+    public static final String IS_SOURCE_NAT = "issourcenat";
+    public static final String IS_STATIC_NAT = "isstaticnat";
+    public static final String SORT_BY = "sortby";
+    public static final String CHANGE_CIDR = "changecidr";
+    public static final String PURPOSE = "purpose";
+    public static final String IS_TAGGED = "istagged";
+    public static final String INSTANCE_NAME = "instancename";
+    public static final String START_VM = "startvm";
+    public static final String HA_HOST = "hahost";
+    public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
+    public static final String DEFAULT_ZONE_ID = "defaultzoneid";
+    public static final String GUID = "guid";
+
+    public static final String EXTERNAL_SWITCH_MGMT_DEVICE_ID = "vsmdeviceid";
+    public static final String EXTERNAL_SWITCH_MGMT_DEVICE_NAME = "vsmdevicename";
+    public static final String EXTERNAL_SWITCH_MGMT_DEVICE_STATE = "vsmdevicestate";
+    // Would we need to have a capacity field for Cisco N1KV VSM? Max hosts managed by it perhaps? May remove this later.
+    public static final String EXTERNAL_SWITCH_MGMT_DEVICE_CAPACITY = "vsmdevicecapacity";
+    public static final String CISCO_NEXUS_VSM_NAME = "vsmname";
+    public static final String VSM_USERNAME = "vsmusername";
+    public static final String VSM_PASSWORD = "vsmpassword";
+    public static final String VSM_IPADDRESS = "vsmipaddress";
+    public static final String VSM_MGMT_VLAN_ID = "vsmmgmtvlanid";
+    public static final String VSM_PKT_VLAN_ID = "vsmpktvlanid";
+    public static final String VSM_CTRL_VLAN_ID = "vsmctrlvlanid";
+    public static final String VSM_STORAGE_VLAN_ID = "vsmstoragevlanid";
+    public static final String VSM_DOMAIN_ID = "vsmdomainid";
+    public static final String VSM_CONFIG_MODE = "vsmconfigmode";
+    public static final String VSM_CONFIG_STATE = "vsmconfigstate";
+    public static final String VSM_DEVICE_STATE = "vsmdevicestate";
+    public static final String ADD_VSM_FLAG = "addvsmflag";
+    public static final String VPC_OFF_ID = "vpcofferingid";
+    public static final String NETWORK = "network";
+    public static final String VPC_ID = "vpcid";
+    public static final String GATEWAY_ID = "gatewayid";
+    public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
+    public static final String RESOURCE_IDS = "resourceids";
+    public static final String RESOURCE_ID = "resourceid";
+    public static final String CUSTOMER = "customer";
+    public static final String S2S_VPN_GATEWAY_ID = "s2svpngatewayid";
+    public static final String S2S_CUSTOMER_GATEWAY_ID = "s2scustomergatewayid";
+    public static final String IPSEC_PSK = "ipsecpsk";
+    public static final String GUEST_IP = "guestip";
+    public static final String REMOVED = "removed";
+    public static final String IKE_POLICY = "ikepolicy";
+    public static final String ESP_POLICY = "esppolicy";
+    public static final String IKE_LIFETIME = "ikelifetime";
+    public static final String ESP_LIFETIME = "esplifetime";
+    public static final String DPD = "dpd";
+    public static final String FOR_VPC = "forvpc";
+    public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
+    public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
+    public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
+    public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
+
+    public static final String SOURCE = "source";
+    public static final String COUNTER_ID = "counterid";
+    public static final String AGGR_OPERATOR = "aggroperator";
+    public static final String AGGR_FUNCTION = "aggrfunction";
+    public static final String AGGR_VALUE = "aggrvalue";
+    public static final String THRESHOLD = "threshold";
+    public static final String RELATIONAL_OPERATOR = "relationaloperator";
+    public static final String OTHER_DEPLOY_PARAMS = "otherdeployparams";
+    public static final String MIN_MEMBERS = "minmembers";
+    public static final String MAX_MEMBERS = "maxmembers";
+    public static final String AUTOSCALE_VM_DESTROY_TIME = "destroyvmgraceperiod";
+    public static final String VMPROFILE_ID = "vmprofileid";
+    public static final String VMGROUP_ID = "vmgroupid";
+    public static final String CS_URL = "csurl";
+    public static final String SCALEUP_POLICY_IDS = "scaleuppolicyids";
+    public static final String SCALEDOWN_POLICY_IDS = "scaledownpolicyids";
+    public static final String SCALEUP_POLICIES = "scaleuppolicies";
+    public static final String SCALEDOWN_POLICIES = "scaledownpolicies";
+    public static final String INTERVAL = "interval";
+    public static final String QUIETTIME = "quiettime";
+    public static final String ACTION = "action";
+    public static final String CONDITION_ID = "conditionid";
+    public static final String CONDITION_IDS = "conditionids";
+    public static final String COUNTERPARAM_LIST = "counterparam";
+    public static final String AUTOSCALE_USER_ID = "autoscaleuserid";
+
+    public enum HostDetails {
+        all, capacity, events, stats, min;
+    }
+
+    public enum VMDetails {
+        all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
+    }
+
+    public enum LDAPParams {
+        hostname, port, usessl, queryfilter, searchbase, dn, passwd, truststore, truststorepass;
+
+        @Override
+        public String toString() {
+            return "ldap." + name();
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
new file mode 100644
index 0000000..4bcd9eb
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
@@ -0,0 +1,134 @@
+// 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;
+
+import com.cloud.api.response.AsyncJobResponse;
+import com.cloud.async.AsyncJob;
+import com.cloud.user.User;
+import com.cloud.user.UserContext;
+
+/**
+ * queryAsyncJobResult API command.
+ */
+public abstract class BaseAsyncCmd extends BaseCmd {
+
+    public static final String ipAddressSyncObject = "ipaddress";
+    public static final String networkSyncObject = "network";
+    public static final String vpcSyncObject = "vpc";
+    public static final String snapshotHostSyncObject = "snapshothost";
+
+    private AsyncJob job;
+
+    @Parameter(name = "starteventid", type = CommandType.LONG)
+    private Long startEventId;
+
+    /**
+     * For proper tracking of async commands through the system, events must be generated when the command is
+     * scheduled, started, and completed. Commands should specify the type of event so that when the scheduled,
+     * started, and completed events are saved to the events table, they have the proper type information.
+     *
+     * @return a string representing the type of event, e.g. VM.START, VOLUME.CREATE.
+     */
+    public abstract String getEventType();
+
+    /**
+     * For proper tracking of async commands through the system, events must be generated when the command is
+     * scheduled, started, and completed. Commands should specify a description for these events so that when
+     * the scheduled, started, and completed events are saved to the events table, they have a meaningful description.
+     *
+     * @return a string representing a description of the event
+     */
+    public abstract String getEventDescription();
+
+    public ResponseObject getResponse(long jobId) {
+        AsyncJobResponse response = new AsyncJobResponse();
+
+        response.setJobId(jobId);
+        response.setResponseName(getCommandName());
+        return response;
+    }
+
+    public void setJob(AsyncJob job) {
+        this.job = job;
+    }
+
+    public Long getStartEventId() {
+        return startEventId;
+    }
+
+    public void setStartEventId(Long startEventId) {
+        this.startEventId = startEventId;
+    }
+
+    /**
+     * Async commands that want to be tracked as part of the listXXX commands need to
+     * provide implementations of the two following methods, getInstanceId() and getInstanceType()
+     *
+     * getObjectId() should return the id of the object the async command is executing on
+     * getObjectType() should return a type from the AsyncJob.Type enumeration
+     */
+    public Long getInstanceId() {
+        return null;
+    }
+
+    public AsyncJob.Type getInstanceType() {
+        return AsyncJob.Type.None;
+    }
+
+    public String getSyncObjType() {
+        return null;
+    }
+
+    public Long getSyncObjId() {
+        return null;
+    }
+
+    public AsyncJob getJob() {
+        return job;
+    }
+
+    protected long saveStartedEvent() {
+        return saveStartedEvent(getEventType(), "Executing job for " + getEventDescription(), getStartEventId());
+    }
+
+    protected long saveStartedEvent(String eventType, String description, Long startEventId) {
+        UserContext ctx = UserContext.current();
+        Long userId = ctx.getCallerUserId();
+        userId = (userId == null) ? User.UID_SYSTEM : userId;
+        Long startEvent = startEventId;
+        if (startEvent == null) {
+            startEvent = 0L;
+        }
+        return _mgr.saveStartedEvent((userId == null) ? User.UID_SYSTEM : userId, getEntityOwnerId(), eventType, description, startEvent);
+    }
+
+    protected long saveCompletedEvent(String level, String description) {
+        return saveCompletedEvent(level, getEventType(), description, getStartEventId());
+    }
+
+    protected long saveCompletedEvent(String level, String eventType, String description, Long startEventId) {
+        UserContext ctx = UserContext.current();
+        Long userId = ctx.getCallerUserId();
+        userId = (userId == null) ? User.UID_SYSTEM : userId;
+        Long startEvent = startEventId;
+        if (startEvent == null) {
+            startEvent = 0L;
+        }
+        return _mgr.saveCompletedEvent((userId == null) ? User.UID_SYSTEM : userId, getEntityOwnerId(), level, eventType, description, startEvent);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
new file mode 100644
index 0000000..44b05ed
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
@@ -0,0 +1,55 @@
+// 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;
+
+import com.cloud.api.response.CreateCmdResponse;
+import com.cloud.exception.ResourceAllocationException;
+
+public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
+    @Parameter(name = "id", type = CommandType.LONG)
+    private Long id;
+
+    public abstract void create() throws ResourceAllocationException;
+
+    public Long getEntityId() {
+        return id;
+    }
+
+    public void setEntityId(Long id) {
+        this.id = id;
+    }
+
+    public abstract String getEntityTable();
+
+    public String getResponse(long jobId, long objectId, String objectEntityTable) {
+        CreateCmdResponse response = new CreateCmdResponse();
+        response.setJobId(jobId);
+        response.setId(objectId);
+        response.setIdEntityTable(objectEntityTable);
+        response.setResponseName(getCommandName());
+        return _responseGenerator.toSerializedString(response, getResponseType());
+    }
+
+    public String getCreateEventType() {
+        return null;
+    }
+
+    public String getCreateEventDescription() {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
new file mode 100755
index 0000000..e7701fb
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -0,0 +1,533 @@
+// 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;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.configuration.ConfigurationService;
+import com.cloud.consoleproxy.ConsoleProxyService;
+import com.cloud.dao.EntityManager;
+import com.cloud.domain.Domain;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.NetworkService;
+import com.cloud.network.StorageNetworkService;
+import com.cloud.network.VpcVirtualNetworkApplianceService;
+import com.cloud.network.as.AutoScaleService;
+import com.cloud.network.firewall.FirewallService;
+import com.cloud.network.firewall.NetworkACLService;
+import com.cloud.network.lb.LoadBalancingRulesService;
+import com.cloud.network.rules.RulesService;
+import com.cloud.network.security.SecurityGroupService;
+import com.cloud.network.vpc.VpcService;
+import com.cloud.network.vpn.RemoteAccessVpnService;
+import com.cloud.network.vpn.Site2SiteVpnService;
+import com.cloud.projects.Project;
+import com.cloud.projects.ProjectService;
+import com.cloud.resource.ResourceService;
+import com.cloud.server.ManagementService;
+import com.cloud.server.TaggedResourceService;
+import com.cloud.storage.StorageService;
+import com.cloud.storage.snapshot.SnapshotService;
+import com.cloud.template.TemplateService;
+import com.cloud.user.Account;
+import com.cloud.user.AccountService;
+import com.cloud.user.DomainService;
+import com.cloud.user.ResourceLimitService;
+import com.cloud.utils.IdentityProxy;
+import com.cloud.utils.Pair;
+import com.cloud.utils.component.ComponentLocator;
+import com.cloud.vm.BareMetalVmService;
+import com.cloud.vm.UserVmService;
+
+public abstract class BaseCmd {
+    private static final Logger s_logger = Logger.getLogger(BaseCmd.class.getName());
+
+    public static final String USER_ERROR_MESSAGE = "Internal error executing command, please contact your system administrator";
+    public static final int PROGRESS_INSTANCE_CREATED = 1;
+
+    public static final String RESPONSE_TYPE_XML = "xml";
+    public static final String RESPONSE_TYPE_JSON = "json";
+
+    public enum CommandType {
+        BOOLEAN, DATE, FLOAT, INTEGER, SHORT, LIST, LONG, OBJECT, MAP, STRING, TZDATE
+    }
+
+    // FIXME: Extract these out into a separate file
+    // Client error codes
+    public static final int MALFORMED_PARAMETER_ERROR = 430;
+    public static final int PARAM_ERROR = 431;
+    public static final int UNSUPPORTED_ACTION_ERROR = 432;
+    public static final int PAGE_LIMIT_EXCEED = 433;
+
+    // Server error codes
+    public static final int INTERNAL_ERROR = 530;
+    public static final int ACCOUNT_ERROR = 531;
+    public static final int ACCOUNT_RESOURCE_LIMIT_ERROR = 532;
+    public static final int INSUFFICIENT_CAPACITY_ERROR = 533;
+    public static final int RESOURCE_UNAVAILABLE_ERROR = 534;
+    public static final int RESOURCE_ALLOCATION_ERROR = 534;
+    public static final int RESOURCE_IN_USE_ERROR = 536;
+    public static final int NETWORK_RULE_CONFLICT_ERROR = 537;
+
+    public static final DateFormat INPUT_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+    public static final DateFormat NEW_INPUT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    public static Pattern newInputDateFormat = Pattern.compile("[\\d]+-[\\d]+-[\\d]+ [\\d]+:[\\d]+:[\\d]+");
+    private static final DateFormat _outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+
+    private Object _responseObject = null;
+    private Map<String, String> fullUrlParams;
+
+    @Parameter(name = "response", type = CommandType.STRING)
+    private String responseType;
+
+    public static ComponentLocator s_locator;
+    public static ConfigurationService _configService;
+    public static AccountService _accountService;
+    public static UserVmService _userVmService;
+    public static ManagementService _mgr;
+    public static StorageService _storageService;
+    public static ResourceService _resourceService;
+    public static NetworkService _networkService;
+    public static TemplateService _templateService;
+    public static SecurityGroupService _securityGroupService;
+    public static SnapshotService _snapshotService;
+    public static ConsoleProxyService _consoleProxyService;
+    public static VpcVirtualNetworkApplianceService _routerService;
+    public static ResponseGenerator _responseGenerator;
+    public static EntityManager _entityMgr;
+    public static RulesService _rulesService;
+    public static AutoScaleService _autoScaleService;
+    public static LoadBalancingRulesService _lbService;
+    public static RemoteAccessVpnService _ravService;
+    public static BareMetalVmService _bareMetalVmService;
+    public static ProjectService _projectService;
+    public static FirewallService _firewallService;
+    public static DomainService _domainService;
+    public static ResourceLimitService _resourceLimitService;
+    public static IdentityService _identityService;
+    public static StorageNetworkService _storageNetworkService;
+    public static TaggedResourceService _taggedResourceService;
+    public static VpcService _vpcService;
+    public static NetworkACLService _networkACLService;
+    public static Site2SiteVpnService _s2sVpnService;
+
+    static void setComponents(ResponseGenerator generator) {
+        ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
+        _mgr = (ManagementService) ComponentLocator.getComponent(ManagementService.Name);
+        _accountService = locator.getManager(AccountService.class);
+        _configService = locator.getManager(ConfigurationService.class);
+        _userVmService = locator.getManager(UserVmService.class);
+        _storageService = locator.getManager(StorageService.class);
+        _resourceService = locator.getManager(ResourceService.class);
+        _networkService = locator.getManager(NetworkService.class);
+        _templateService = locator.getManager(TemplateService.class);
+        _securityGroupService = locator.getManager(SecurityGroupService.class);
+        _snapshotService = locator.getManager(SnapshotService.class);
+        _consoleProxyService = locator.getManager(ConsoleProxyService.class);
+        _routerService = locator.getManager(VpcVirtualNetworkApplianceService.class);
+        _entityMgr = locator.getManager(EntityManager.class);
+        _rulesService = locator.getManager(RulesService.class);
+        _lbService = locator.getManager(LoadBalancingRulesService.class);
+        _autoScaleService = locator.getManager(AutoScaleService.class);
+        _ravService = locator.getManager(RemoteAccessVpnService.class);
+        _responseGenerator = generator;
+        _bareMetalVmService = locator.getManager(BareMetalVmService.class);
+        _projectService = locator.getManager(ProjectService.class);
+        _firewallService = locator.getManager(FirewallService.class);
+        _domainService = locator.getManager(DomainService.class);
+        _resourceLimitService = locator.getManager(ResourceLimitService.class);
+        _identityService = locator.getManager(IdentityService.class);
+        _storageNetworkService = locator.getManager(StorageNetworkService.class);
+        _taggedResourceService = locator.getManager(TaggedResourceService.class);
+        _vpcService = locator.getManager(VpcService.class);
+        _networkACLService = locator.getManager(NetworkACLService.class);
+        _s2sVpnService = locator.getManager(Site2SiteVpnService.class);
+    }
+
+    public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;
+
+    public String getResponseType() {
+        if (responseType == null) {
+            return RESPONSE_TYPE_XML;
+        }
+        return responseType;
+    }
+
+    public void setResponseType(String responseType) {
+        this.responseType = responseType;
+    }
+
+    public abstract String getCommandName();
+
+    /**
+     * For commands the API framework needs to know the owner of the object being acted upon. This method is
+     * used to determine that information.
+     *
+     * @return the id of the account that owns the object being acted upon
+     */
+    public abstract long getEntityOwnerId();
+
+    public Object getResponseObject() {
+        return _responseObject;
+    }
+
+    public void setResponseObject(Object responseObject) {
+        _responseObject = responseObject;
+    }
+
+    public ManagementService getMgmtServiceRef() {
+        return _mgr;
+    }
+
+    public static String getDateString(Date date) {
+        if (date == null) {
+            return "";
+        }
+        String formattedString = null;
+        synchronized (_outputFormat) {
+            formattedString = _outputFormat.format(date);
+        }
+        return formattedString;
+    }
+
+    // FIXME: move this to a utils method so that maps can be unpacked and integer/long values can be appropriately cast
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public Map<String, Object> unpackParams(Map<String, String> params) {
+        Map<String, Object> lowercaseParams = new HashMap<String, Object>();
+        for (String key : params.keySet()) {
+            int arrayStartIndex = key.indexOf('[');
+            int arrayStartLastIndex = key.lastIndexOf('[');
+            if (arrayStartIndex != arrayStartLastIndex) {
+                throw new ServerApiException(MALFORMED_PARAMETER_ERROR, "Unable to decode parameter " + key
+                        + "; if specifying an object array, please use parameter[index].field=XXX, e.g. userGroupList[0].group=httpGroup");
+            }
+
+            if (arrayStartIndex > 0) {
+                int arrayEndIndex = key.indexOf(']');
+                int arrayEndLastIndex = key.lastIndexOf(']');
+                if ((arrayEndIndex < arrayStartIndex) || (arrayEndIndex != arrayEndLastIndex)) {
+                    // malformed parameter
+                    throw new ServerApiException(MALFORMED_PARAMETER_ERROR, "Unable to decode parameter " + key
+                            + "; if specifying an object array, please use parameter[index].field=XXX, e.g. userGroupList[0].group=httpGroup");
+                }
+
+                // Now that we have an array object, check for a field name in the case of a complex object
+                int fieldIndex = key.indexOf('.');
+                String fieldName = null;
+                if (fieldIndex < arrayEndIndex) {
+                    throw new ServerApiException(MALFORMED_PARAMETER_ERROR, "Unable to decode parameter " + key
+                            + "; if specifying an object array, please use parameter[index].field=XXX, e.g. userGroupList[0].group=httpGroup");
+                } else {
+                    fieldName = key.substring(fieldIndex + 1);
+                }
+
+                // parse the parameter name as the text before the first '[' character
+                String paramName = key.substring(0, arrayStartIndex);
+                paramName = paramName.toLowerCase();
+
+                Map<Integer, Map> mapArray = null;
+                Map<String, Object> mapValue = null;
+                String indexStr = key.substring(arrayStartIndex + 1, arrayEndIndex);
+                int index = 0;
+                boolean parsedIndex = false;
+                try {
+                    if (indexStr != null) {
+                        index = Integer.parseInt(indexStr);
+                        parsedIndex = true;
+                    }
+                } catch (NumberFormatException nfe) {
+                    s_logger.warn("Invalid parameter " + key + " received, unable to parse object array, returning an error.");
+                }
+
+                if (!parsedIndex) {
+                    throw new ServerApiException(MALFORMED_PARAMETER_ERROR, "Unable to decode parameter " + key
+                            + "; if specifying an object array, please use parameter[index].field=XXX, e.g. userGroupList[0].group=httpGroup");
+                }
+
+                Object value = lowercaseParams.get(paramName);
+                if (value == null) {
+                    // for now, assume object array with sub fields
+                    mapArray = new HashMap<Integer, Map>();
+                    mapValue = new HashMap<String, Object>();
+                    mapArray.put(Integer.valueOf(index), mapValue);
+                } else if (value instanceof Map) {
+                    mapArray = (HashMap) value;
+                    mapValue = mapArray.get(Integer.valueOf(index));
+                    if (mapValue == null) {
+                        mapValue = new HashMap<String, Object>();
+                        mapArray.put(Integer.valueOf(index), mapValue);
+                    }
+                }
+
+                // we are ready to store the value for a particular field into the map for this object
+                mapValue.put(fieldName, params.get(key));
+
+                lowercaseParams.put(paramName, mapArray);
+            } else {
+                lowercaseParams.put(key.toLowerCase(), params.get(key));
+            }
+        }
+        return lowercaseParams;
+    }
+
+    public String buildResponse(ServerApiException apiException, String responseType) {
+        StringBuffer sb = new StringBuffer();
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            // JSON response
+            sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
+            sb.append("\"errorcode\" : \"" + apiException.getErrorCode() + "\", \"description\" : \"" + apiException.getDescription() + "\" } }");
+        } else {
+            sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
+            sb.append("<" + getCommandName() + ">");
+            sb.append("<errorcode>" + apiException.getErrorCode() + "</errorcode>");
+            sb.append("<description>" + escapeXml(apiException.getDescription()) + "</description>");
+            sb.append("</" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
+        }
+        return sb.toString();
+    }
+
+    public String buildResponse(List<Pair<String, Object>> tagList, String responseType) {
+        StringBuffer prefixSb = new StringBuffer();
+        StringBuffer suffixSb = new StringBuffer();
+
+        // set up the return value with the name of the response
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
+        } else {
+            prefixSb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
+            prefixSb.append("<" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
+        }
+
+        int i = 0;
+        for (Pair<String, Object> tagData : tagList) {
+            String tagName = tagData.first();
+            Object tagValue = tagData.second();
+            if (tagValue instanceof Object[]) {
+                Object[] subObjects = (Object[]) tagValue;
+                if (subObjects.length < 1) {
+                    continue;
+                }
+                writeObjectArray(responseType, suffixSb, i++, tagName, subObjects);
+            } else {
+                writeNameValuePair(suffixSb, tagName, tagValue, responseType, i++);
+            }
+        }
+
+        if (suffixSb.length() > 0) {
+            if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) { // append comma only if we have some suffix else
+                // not as per strict Json syntax.
+                prefixSb.append(",");
+            }
+            prefixSb.append(suffixSb);
+        }
+        // close the response
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            prefixSb.append("} }");
+        } else {
+            prefixSb.append("</" + getCommandName() + ">");
+        }
+        return prefixSb.toString();
+    }
+
+    private void writeNameValuePair(StringBuffer sb, String tagName, Object tagValue, String responseType, int propertyCount) {
+        if (tagValue == null) {
+            return;
+        }
+
+        if (tagValue instanceof Object[]) {
+            Object[] subObjects = (Object[]) tagValue;
+            if (subObjects.length < 1) {
+                return;
+            }
+            writeObjectArray(responseType, sb, propertyCount, tagName, subObjects);
+        } else {
+            if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+                String seperator = ((propertyCount > 0) ? ", " : "");
+                sb.append(seperator + "\"" + tagName + "\" : \"" + escapeJSON(tagValue.toString()) + "\"");
+            } else {
+                sb.append("<" + tagName + ">" + escapeXml(tagValue.toString()) + "</" + tagName + ">");
+            }
+        }
+    }
+
+    @SuppressWarnings("rawtypes")
+    private void writeObjectArray(String responseType, StringBuffer sb, int propertyCount, String tagName, Object[] subObjects) {
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            String separator = ((propertyCount > 0) ? ", " : "");
+            sb.append(separator);
+        }
+        int j = 0;
+        for (Object subObject : subObjects) {
+            if (subObject instanceof List) {
+                List subObjList = (List) subObject;
+                writeSubObject(sb, tagName, subObjList, responseType, j++);
+            }
+        }
+
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            sb.append("]");
+        }
+    }
+
+    @SuppressWarnings("rawtypes")
+    private void writeSubObject(StringBuffer sb, String tagName, List tagList, String responseType, int objectCount) {
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            sb.append(((objectCount == 0) ? "\"" + tagName + "\" : [  { " : ", { "));
+        } else {
+            sb.append("<" + tagName + ">");
+        }
+
+        int i = 0;
+        for (Object tag : tagList) {
+            if (tag instanceof Pair) {
+                Pair nameValuePair = (Pair) tag;
+                writeNameValuePair(sb, (String) nameValuePair.first(), nameValuePair.second(), responseType, i++);
+            }
+        }
+
+        if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
+            sb.append("}");
+        } else {
+            sb.append("</" + tagName + ">");
+        }
+    }
+
+    /**
+     * Escape xml response set to false by default. API commands to override this method to allow escaping
+     */
+    public boolean requireXmlEscape() {
+        return true;
+    }
+
+    private String escapeXml(String xml) {
+        if (!requireXmlEscape()) {
+            return xml;
+        }
+        int iLen = xml.length();
+        if (iLen == 0) {
+            return xml;
+        }
+        StringBuffer sOUT = new StringBuffer(iLen + 256);
+        int i = 0;
+        for (; i < iLen; i++) {
+            char c = xml.charAt(i);
+            if (c == '<') {
+                sOUT.append("&lt;");
+            } else if (c == '>') {
+                sOUT.append("&gt;");
+            } else if (c == '&') {
+                sOUT.append("&amp;");
+            } else if (c == '"') {
+                sOUT.append("&quot;");
+            } else if (c == '\'') {
+                sOUT.append("&apos;");
+            } else {
+                sOUT.append(c);
+            }
+        }
+        return sOUT.toString();
+    }
+
+    private static String escapeJSON(String str) {
+        if (str == null) {
+            return str;
+        }
+
+        return str.replace("\"", "\\\"");
+    }
+
+    protected long getInstanceIdFromJobSuccessResult(String result) {
+        s_logger.debug("getInstanceIdFromJobSuccessResult not overridden in subclass " + this.getClass().getName());
+        return 0;
+    }
+
+    public static boolean isAdmin(short accountType) {
+        return ((accountType == Account.ACCOUNT_TYPE_ADMIN) ||
+                (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
+                (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
+    }
+
+    public static boolean isRootAdmin(short accountType) {
+        return ((accountType == Account.ACCOUNT_TYPE_ADMIN));
+    }
+
+    public void setFullUrlParams(Map<String, String> map) {
+        this.fullUrlParams = map;
+    }
+
+    public Map<String, String> getFullUrlParams() {
+        return this.fullUrlParams;
+    }
+
+    public Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly) {
+        if (accountName != null) {
+            if (domainId == null) {
+                throw new InvalidParameterValueException("Account must be specified with domainId parameter");
+            }
+
+            Domain domain = _domainService.getDomain(domainId);
+            if (domain == null) {
+                throw new InvalidParameterValueException("Unable to find domain by id");
+            }
+
+            Account account = _accountService.getActiveAccountByName(accountName, domainId);
+            if (account != null && account.getType() != Account.ACCOUNT_TYPE_PROJECT) {
+                if (!enabledOnly || account.getState() == Account.State.enabled) {
+                    return account.getId();
+                } else {
+                    throw new PermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
+                }
+            } else {
+                List<IdentityProxy> idList = new ArrayList<IdentityProxy>();
+                idList.add(new IdentityProxy("domain", domainId, "domainId"));
+                throw new InvalidParameterValueException("Unable to find account by name " + accountName + " in domain with specified id");
+            }
+        }
+
+        if (projectId != null) {
+            Project project = _projectService.getProject(projectId);
+            if (project != null) {
+                if (!enabledOnly || project.getState() == Project.State.Active) {
+                    return project.getProjectAccountId();
+                } else {
+                    PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + " as it's no longer active");
+                    ex.addProxyObject(project, projectId, "projectId");
+                    throw ex;
+                }
+            } else {
+                throw new InvalidParameterValueException("Unable to find project by id");
+            }
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fc3bc37/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
new file mode 100644
index 0000000..038da63
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
@@ -0,0 +1,27 @@
+// 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;
+
+public abstract class BaseListAccountResourcesCmd extends BaseListDomainResourcesCmd {
+
+    @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "List resources by account. Must be used with the domainId parameter.")
+    private String accountName;
+
+    public String getAccountName() {
+        return accountName;
+    }
+}