You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/01/17 23:40:49 UTC

[47/50] [abbrv] Merge branch 'master' into rbac.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
index dde86a4,f699cce..98c675b
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
@@@ -40,8 -36,7 +40,8 @@@ import com.cloud.event.EventTypes
  import com.cloud.user.Account;
  import com.cloud.uservm.UserVm;
  
- @APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = { AclEntityType.VirtualMachine })
 -@APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class)
 +
++@APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = { AclEntityType.VirtualMachine })
  public class UpdateDefaultNicForVMCmd extends BaseAsyncCmd {
      public static final Logger s_logger = Logger.getLogger(UpdateDefaultNicForVMCmd.class);
      private static final String s_name = "updatedefaultnicforvirtualmachineresponse";
@@@ -50,13 -45,10 +50,12 @@@
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "Virtual Machine ID")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType=UserVmResponse.class,
 +            required=true, description="Virtual Machine ID")
      private Long vmId;
  
-     @Parameter(name=ApiConstants.NIC_ID, type=CommandType.UUID, entityType=NicResponse.class,
-             required=true, description="NIC ID")
+     @Parameter(name = ApiConstants.NIC_ID, type = CommandType.UUID, entityType = NicResponse.class, required = true, description = "NIC ID")
      private Long nicId;
  
      /////////////////////////////////////////////////////
@@@ -91,10 -83,9 +90,9 @@@
  
      @Override
      public String getEventDescription() {
 -        return "Updating NIC " + getNicId() + " on user vm: " + getVmId();
 +        return  "Updating NIC " + getNicId() + " on user vm: " + getVmId();
      }
  
- 
      @Override
      public long getEntityOwnerId() {
          UserVm vm = _responseGenerator.findUserVmById(getVmId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
index b963392,e0ca787..4b541f4
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
@@@ -24,9 -21,8 +24,9 @@@ import org.apache.cloudstack.api.ACL
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.ApiErrorCode;
- import org.apache.cloudstack.api.BaseCmd;
+ import org.apache.cloudstack.api.BaseCustomIdCmd;
  import org.apache.cloudstack.api.Parameter;
 +import org.apache.cloudstack.api.ResponseObject.ResponseView;
  import org.apache.cloudstack.api.ServerApiException;
  import org.apache.cloudstack.api.response.GuestOSResponse;
  import org.apache.cloudstack.api.response.UserVmResponse;
@@@ -37,11 -33,10 +37,11 @@@ import com.cloud.exception.ResourceUnav
  import com.cloud.user.Account;
  import com.cloud.uservm.UserVm;
  
 -@APICommand(name = "updateVirtualMachine", description = "Updates properties of a virtual machine. The VM has to be stopped and restarted for the "
 -    + "new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. "
 -    + "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class)
 +
 +@APICommand(name = "updateVirtualMachine", description="Updates properties of a virtual machine. The VM has to be stopped and restarted for the " +
 +        "new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. " +
 + "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = { AclEntityType.VirtualMachine })
- public class UpdateVMCmd extends BaseCmd{
+ public class UpdateVMCmd extends BaseCustomIdCmd {
      public static final Logger s_logger = Logger.getLogger(UpdateVMCmd.class.getName());
      private static final String s_name = "updatevirtualmachineresponse";
  
@@@ -49,31 -44,36 +49,38 @@@
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
-     @Parameter(name=ApiConstants.DISPLAY_NAME, type=CommandType.STRING, description="user generated name")
+     @Parameter(name = ApiConstants.DISPLAY_NAME, type = CommandType.STRING, description = "user generated name")
      private String displayName;
  
-     @Parameter(name=ApiConstants.GROUP, type=CommandType.STRING, description="group of the virtual machine")
+     @Parameter(name = ApiConstants.GROUP, type = CommandType.STRING, description = "group of the virtual machine")
      private String group;
  
-     @Parameter(name=ApiConstants.HA_ENABLE, type=CommandType.BOOLEAN, description="true if high-availability is enabled for the virtual machine, false otherwise")
+     @Parameter(name = ApiConstants.HA_ENABLE, type = CommandType.BOOLEAN, description = "true if high-availability is enabled for the virtual machine, false otherwise")
      private Boolean haEnable;
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "The ID of the virtual machine")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=UserVmResponse.class,
 +            required=true, description="The ID of the virtual machine")
      private Long id;
  
-     @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.UUID, entityType=GuestOSResponse.class,
-             description="the ID of the OS type that best represents this VM.")
+     @Parameter(name = ApiConstants.OS_TYPE_ID,
+                type = CommandType.UUID,
+                entityType = GuestOSResponse.class,
+                description = "the ID of the OS type that best represents this VM.")
      private Long osTypeId;
  
-     @Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.", length=32768)
+     @Parameter(name = ApiConstants.USER_DATA,
+                type = CommandType.STRING,
+                description = "an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.",
+                length = 32768)
      private String userData;
  
-     @Parameter(name=ApiConstants.DISPLAY_VM, type=CommandType.BOOLEAN, description="an optional field, whether to the display the vm to the end user or not.")
+     @Parameter(name = ApiConstants.DISPLAY_VM, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the vm to the end user or not.")
      private Boolean displayVm;
  
-     @Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE, type = CommandType.BOOLEAN, description = "true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
+     @Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE,
+                type = CommandType.BOOLEAN,
+                description = "true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
      protected Boolean isDynamicallyScalable;
  
      /////////////////////////////////////////////////////
@@@ -137,12 -136,11 +143,11 @@@
      }
  
      @Override
-     public void execute() throws ResourceUnavailableException,
-             InsufficientCapacityException, ServerApiException {
-         CallContext.current().setEventDetails("Vm Id: "+getId());
+     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException {
+         CallContext.current().setEventDetails("Vm Id: " + getId());
          UserVm result = _userVmService.updateVirtualMachine(this);
 -        if (result != null) {
 -            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
 +        if (result != null){
 +            UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "virtualmachine", result).get(0);
              response.setResponseName(getCommandName());
              setResponseObject(response);
          } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
index 1efae12,12ab711..4ed7c43
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
@@@ -16,11 -16,11 +16,16 @@@
  // under the License.
  package org.apache.cloudstack.api.command.user.vm;
  
+ import java.util.Collection;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.Map;
+ 
 +import org.apache.log4j.Logger;
 +
 +import org.apache.cloudstack.acl.AclEntityType;
 +import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 +import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.ApiErrorCode;
@@@ -49,15 -48,15 +54,18 @@@ public class UpgradeVMCmd extends BaseC
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "The ID of the virtual machine")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=UserVmResponse.class,
 +            required=true, description="The ID of the virtual machine")
      private Long id;
  
 -    @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, required = true, description = "the service offering ID to apply to the virtual machine")
 -    private Long serviceOfferingId;
 +    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.UUID, entityType=ServiceOfferingResponse.class,
 +            required=true, description="the service offering ID to apply to the virtual machine")
 +    protected Long serviceOfferingId;
  
+     @Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "name value pairs of custom parameters for cpu, memory and cpunumber. example details[i].name=value")
+     private Map<String, String> details;
+ 
      /////////////////////////////////////////////////////
      /////////////////// Accessors ///////////////////////
      /////////////////////////////////////////////////////
@@@ -103,8 -117,8 +126,9 @@@
          }
  
          UserVm result = _userVmService.upgradeVirtualMachine(this);
 -        if (result != null) {
 -            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
++
 +        if (result != null){
 +            UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "virtualmachine", result).get(0);
              response.setResponseName(getCommandName());
              setResponseObject(response);
          } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
index 6239a77,cec2154..0bb9913
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/RevertToVMSnapshotCmd.java
@@@ -38,13 -37,16 +38,16 @@@ import com.cloud.user.Account
  import com.cloud.uservm.UserVm;
  import com.cloud.vm.snapshot.VMSnapshot;
  
 -@APICommand(name = "revertToVMSnapshot", description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since = "4.2.0")
 +@APICommand(name = "revertToVMSnapshot", description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since = "4.2.0", responseView = ResponseView.Restricted)
  public class RevertToVMSnapshotCmd extends BaseAsyncCmd {
-     public static final Logger s_logger = Logger
-             .getLogger(RevertToVMSnapshotCmd.class.getName());
+     public static final Logger s_logger = Logger.getLogger(RevertToVMSnapshotCmd.class.getName());
      private static final String s_name = "reverttovmsnapshotresponse";
  
-     @Parameter(name = ApiConstants.VM_SNAPSHOT_ID, type = CommandType.UUID, required = true,entityType=VMSnapshotResponse.class,description = "The ID of the vm snapshot")
+     @Parameter(name = ApiConstants.VM_SNAPSHOT_ID,
+                type = CommandType.UUID,
+                required = true,
+                entityType = VMSnapshotResponse.class,
+                description = "The ID of the vm snapshot")
      private Long vmSnapShotId;
  
      public Long getVmSnapShotId() {
@@@ -66,17 -68,15 +69,16 @@@
      }
  
      @Override
 -    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException, ConcurrentOperationException {
 +    public void execute() throws  ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException, ConcurrentOperationException {
-         CallContext.current().setEventDetails(
-                 "vmsnapshot id: " + getVmSnapShotId());
+         CallContext.current().setEventDetails("vmsnapshot id: " + getVmSnapShotId());
          UserVm result = _vmSnapshotService.revertToSnapshot(getVmSnapShotId());
          if (result != null) {
 -            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
 +            UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Restricted,
 +                    "virtualmachine", result).get(0);
              response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 +            setResponseObject(response);
          } else {
-             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"Failed to revert VM snapshot");
+             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to revert VM snapshot");
          }
      }
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
index 6a8da85,cd1e1ed..b69173a
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
@@@ -15,12 -15,9 +15,11 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.acl.SecurityChecker.AccessType;
--
  import org.apache.log4j.Logger;
  
++import org.apache.cloudstack.acl.AclEntityType;
++import org.apache.cloudstack.acl.SecurityChecker.AccessType;
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
@@@ -46,29 -42,21 +45,19 @@@ public class AttachVolumeCmd extends Ba
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
-     @Parameter(name=ApiConstants.DEVICE_ID, type=CommandType.LONG, description="the ID of the device to map the volume to within the guest OS. " +
-                                                                     "If no deviceId is passed in, the next available deviceId will be chosen. " +
-                                                                     "Possible values for a Linux OS are:" +
-                                                                     "* 1 - /dev/xvdb" +
-                                                                     "* 2 - /dev/xvdc" +
-                                                                     "* 4 - /dev/xvde" +
-                                                                     "* 5 - /dev/xvdf" +
-                                                                     "* 6 - /dev/xvdg" +
-                                                                     "* 7 - /dev/xvdh" +
-                                                                     "* 8 - /dev/xvdi" +
-                                                                     "* 9 - /dev/xvdj")
+     @Parameter(name = ApiConstants.DEVICE_ID, type = CommandType.LONG, description = "the ID of the device to map the volume to within the guest OS. "
+         + "If no deviceId is passed in, the next available deviceId will be chosen. " + "Possible values for a Linux OS are:" + "* 1 - /dev/xvdb" + "* 2 - /dev/xvdc"
+         + "* 4 - /dev/xvde" + "* 5 - /dev/xvdf" + "* 6 - /dev/xvdg" + "* 7 - /dev/xvdh" + "* 8 - /dev/xvdi" + "* 9 - /dev/xvdj")
      private Long deviceId;
  
-     @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class,
-             required=true, description="the ID of the disk volume")
+     @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "the ID of the disk volume")
      private Long id;
  
 -    @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
 -               type = CommandType.UUID,
 -               entityType = UserVmResponse.class,
 -               required = true,
 -               description = "    the ID of the virtual machine")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType=UserVmResponse.class,
 +            required=true, description="    the ID of the virtual machine")
      private Long virtualMachineId;
  
- 
      /////////////////////////////////////////////////////
      /////////////////// Accessors ///////////////////////
      /////////////////////////////////////////////////////
@@@ -125,13 -112,13 +113,13 @@@
      }
  
      @Override
-     public void execute(){
-         CallContext.current().setEventDetails("Volume Id: "+getId()+" VmId: "+getVirtualMachineId());
+     public void execute() {
+         CallContext.current().setEventDetails("Volume Id: " + getId() + " VmId: " + getVirtualMachineId());
          Volume result = _volumeService.attachVolumeToVM(this);
          if (result != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(result);
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, result);
              response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 +            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to attach volume");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index dc51e03,c6457c6..a15971c
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@@ -23,9 -24,7 +23,10 @@@ import org.apache.cloudstack.api.APICom
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.ApiErrorCode;
- import org.apache.cloudstack.api.BaseAsyncCreateCmd;
++import org.apache.cloudstack.api.BaseAsyncCreateCustomIdCmd;
++import org.apache.cloudstack.api.BaseCmd;
  import org.apache.cloudstack.api.Parameter;
 +import org.apache.cloudstack.api.ResponseObject.ResponseView;
  import org.apache.cloudstack.api.ServerApiException;
  import org.apache.cloudstack.api.response.DiskOfferingResponse;
  import org.apache.cloudstack.api.response.DomainResponse;
@@@ -40,8 -40,10 +42,8 @@@ import com.cloud.exception.ResourceAllo
  import com.cloud.storage.Snapshot;
  import com.cloud.storage.Volume;
  
 -@APICommand(name = "createVolume",
 -            responseObject = VolumeResponse.class,
 -            description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.")
 +@APICommand(name = "createVolume", responseObject = VolumeResponse.class, description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.", responseView = ResponseView.Restricted, entityType = { AclEntityType.Volume })
- public class CreateVolumeCmd extends BaseAsyncCreateCmd {
+ public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd {
      public static final Logger s_logger = Logger.getLogger(CreateVolumeCmd.class.getName());
      private static final String s_name = "createvolumeresponse";
  
@@@ -175,23 -196,23 +196,23 @@@
      }
  
      @Override
-     public void create() throws ResourceAllocationException{
+     public void create() throws ResourceAllocationException {
  
 -        Volume volume = this._volumeService.allocVolume(this);
 +        Volume volume = _volumeService.allocVolume(this);
          if (volume != null) {
 -            this.setEntityId(volume.getId());
 -            this.setEntityUuid(volume.getUuid());
 +            setEntityId(volume.getId());
 +            setEntityUuid(volume.getUuid());
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create volume");
          }
      }
  
      @Override
-     public void execute(){
-         CallContext.current().setEventDetails("Volume Id: "+getEntityId()+((getSnapshotId() == null) ? "" : " from snapshot: " + getSnapshotId()));
+     public void execute() {
+         CallContext.current().setEventDetails("Volume Id: " + getEntityId() + ((getSnapshotId() == null) ? "" : " from snapshot: " + getSnapshotId()));
          Volume volume = _volumeService.createVolume(this);
          if (volume != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(volume);
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, volume);
              //FIXME - have to be moved to ApiResponseHelper
              if (getSnapshotId() != null) {
                  Snapshot snap = _entityMgr.findById(Snapshot.class, getSnapshotId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
index e532774,550adb9..a786d22
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
@@@ -15,10 -15,9 +15,11 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
 -
+ import org.apache.log4j.Logger;
+ 
 +import org.apache.cloudstack.acl.AclEntityType;
 +import org.apache.cloudstack.acl.SecurityChecker.AccessType;
- 
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.ApiErrorCode;
@@@ -44,12 -41,9 +43,11 @@@ public class DeleteVolumeCmd extends Ba
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "The ID of the disk volume")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class,
 +            required=true, description="The ID of the disk volume")
      private Long id;
  
- 
      /////////////////////////////////////////////////////
      /////////////////// Accessors ///////////////////////
      /////////////////////////////////////////////////////
@@@ -84,11 -77,11 +81,11 @@@
  
      @Override
      public void execute() throws ConcurrentOperationException {
-         CallContext.current().setEventDetails("Volume Id: "+getId());
-         boolean result = this._volumeService.deleteVolume(id, CallContext.current().getCallingAccount());
+         CallContext.current().setEventDetails("Volume Id: " + getId());
 -        boolean result = this._volumeService.deleteVolume(id, CallContext.current().getCallingAccount());
++        boolean result = _volumeService.deleteVolume(id, CallContext.current().getCallingAccount());
          if (result) {
              SuccessResponse response = new SuccessResponse(getCommandName());
--            this.setResponseObject(response);
++            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete volume");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
index 030a1a4,70283ff..ad1ac8d
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
@@@ -15,12 -15,9 +15,11 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.acl.SecurityChecker.AccessType;
--
  import org.apache.log4j.Logger;
  
++import org.apache.cloudstack.acl.AclEntityType;
++import org.apache.cloudstack.acl.SecurityChecker.AccessType;
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
@@@ -47,16 -43,16 +46,18 @@@ public class DetachVolumeCmd extends Ba
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, description = "the ID of the disk volume")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class,
 +            description="the ID of the disk volume")
      private Long id;
  
-     @Parameter(name=ApiConstants.DEVICE_ID, type=CommandType.LONG, description="the device ID on the virtual machine where volume is detached from")
+     @Parameter(name = ApiConstants.DEVICE_ID, type = CommandType.LONG, description = "the device ID on the virtual machine where volume is detached from")
      private Long deviceId;
  
-     @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType=UserVmResponse.class,
-             description="the ID of the virtual machine where the volume is detached from")
+     @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID,
+                type = CommandType.UUID,
+                entityType = UserVmResponse.class,
+                description = "the ID of the virtual machine where the volume is detached from")
      private Long virtualMachineId;
  
      /////////////////////////////////////////////////////
@@@ -136,13 -132,13 +137,13 @@@
      }
  
      @Override
-     public void execute(){
-         CallContext.current().setEventDetails("Volume Id: "+getId()+" VmId: "+getVirtualMachineId());
+     public void execute() {
+         CallContext.current().setEventDetails("Volume Id: " + getId() + " VmId: " + getVirtualMachineId());
          Volume result = _volumeService.detachVolumeFromVM(this);
 -        if (result != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(result);
 +        if (result != null){
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, result);
              response.setResponseName("volume");
 -            this.setResponseObject(response);
 +            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to detach volume");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
index 9b44056,d73143a..750f84d
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
@@@ -15,10 -15,9 +15,12 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
+ 
+ import org.apache.log4j.Logger;
+ 
 +import org.apache.cloudstack.acl.AclEntityType;
 +import org.apache.cloudstack.acl.SecurityChecker.AccessType;
- 
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
@@@ -49,20 -46,20 +49,22 @@@ public class ExtractVolumeCmd extends B
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "the ID of the volume")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class,
 +            required=true, description="the ID of the volume")
      private Long id;
  
- 
-     @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the url to which the volume would be extracted")
+     @Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = false, description = "the url to which the volume would be extracted")
      private String url;
  
-     @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
-             required=true, description="the ID of the zone where the volume is located")
+     @Parameter(name = ApiConstants.ZONE_ID,
+                type = CommandType.UUID,
+                entityType = ZoneResponse.class,
+                required = true,
+                description = "the ID of the zone where the volume is located")
      private Long zoneId;
  
-     @Parameter(name=ApiConstants.MODE, type=CommandType.STRING, required=true, description="the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")
+     @Parameter(name = ApiConstants.MODE, type = CommandType.STRING, required = true, description = "the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD")
      private String mode;
  
      /////////////////////////////////////////////////////
@@@ -146,7 -145,7 +150,7 @@@
              Account account = _entityMgr.findById(Account.class, getEntityOwnerId());
              response.setAccountId(account.getUuid());
              response.setUrl(uploadUrl);
--            this.setResponseObject(response);
++            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to extract volume");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
index dd0e3e1,4ebe3bf..4b43acd
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
@@@ -33,9 -32,7 +33,10 @@@ import org.apache.cloudstack.api.respon
  import org.apache.cloudstack.api.response.VolumeResponse;
  import org.apache.cloudstack.api.response.ZoneResponse;
  
 -@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class)
 +
 +
++
 +@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { AclEntityType.Volume })
  public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
      public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName());
  
@@@ -128,9 -122,9 +126,9 @@@
      }
  
      @Override
-     public void execute(){
+     public void execute() {
          ListResponse<VolumeResponse> response = _queryService.searchForVolumes(this);
          response.setResponseName(getCommandName());
 -        this.setResponseObject(response);
 +        setResponseObject(response);
      }
  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java
index 8cbb12f,fa6ac69..bb4cf76
--- a/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java
@@@ -93,22 -95,21 +98,21 @@@ public class MigrateVolumeCmd extends B
  
      @Override
      public String getEventDescription() {
-         return  "Attempting to migrate volume Id: " + getVolumeId() + " to storage pool Id: "+ getStoragePoolId();
+         return "Attempting to migrate volume Id: " + getVolumeId() + " to storage pool Id: " + getStoragePoolId();
      }
  
- 
      @Override
-     public void execute(){
-     	Volume result;
+     public void execute() {
+         Volume result;
  
-     	result = _volumeService.migrateVolume(this);
-     	if (result != null) {
+         result = _volumeService.migrateVolume(this);
+         if (result != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(result);
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, result);
-     		response.setResponseName(getCommandName());
-     		setResponseObject(response);
-     	} else {
-     		throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to migrate volume");
-     	}
+             response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
++            setResponseObject(response);
+         } else {
+             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to migrate volume");
+         }
      }
  
  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
index cf588cb,0cc8039..c98289c
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
@@@ -15,12 -15,9 +15,11 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.acl.SecurityChecker.AccessType;
--
  import org.apache.log4j.Logger;
  
++import org.apache.cloudstack.acl.AclEntityType;
++import org.apache.cloudstack.acl.SecurityChecker.AccessType;
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
@@@ -52,17 -47,20 +51,21 @@@ public class ResizeVolumeCmd extends Ba
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, type = CommandType.UUID, description = "the ID of the disk volume")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, entityType=VolumeResponse.class, type=CommandType.UUID, description="the ID of the disk volume")
      private Long id;
  
-     @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, required=false, description="New volume size in G")
+     @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description = "New volume size in G")
      private Long size;
  
-     @Parameter(name=ApiConstants.SHRINK_OK, type=CommandType.BOOLEAN, required=false, description="Verify OK to Shrink")
+     @Parameter(name = ApiConstants.SHRINK_OK, type = CommandType.BOOLEAN, required = false, description = "Verify OK to Shrink")
      private boolean shrinkOk;
  
-     @Parameter(name=ApiConstants.DISK_OFFERING_ID, entityType=DiskOfferingResponse.class, type=CommandType.UUID, required=false, description="new disk offering id")
+     @Parameter(name = ApiConstants.DISK_OFFERING_ID,
+                entityType = DiskOfferingResponse.class,
+                type = CommandType.UUID,
+                required = false,
+                description = "new disk offering id")
      private Long newDiskOfferingId;
  
      /////////////////////////////////////////////////////
@@@ -115,9 -112,10 +117,10 @@@
          Account account = _accountService.getAccount(volume.getAccountId());
          //Can resize volumes for enabled projects/accounts only
          if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
 -            Project project = _projectService.findByProjectAccountId(volume.getAccountId());
 +                Project project = _projectService.findByProjectAccountId(volume.getAccountId());
              if (project.getState() != Project.State.Active) {
-                 throw new PermissionDeniedException("Can't add resources to  project id=" + project.getId() + " in state=" + project.getState() + " as it's no longer active");
+                 throw new PermissionDeniedException("Can't add resources to  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 volume " + id + "  is disabled: " + account);
@@@ -138,14 -135,14 +140,14 @@@
      }
  
      @Override
-     public void execute() throws ResourceAllocationException{
+     public void execute() throws ResourceAllocationException {
          CallContext.current().setEventDetails("Volume Id: " + getEntityId() + " to size " + getSize() + "G");
-     	Volume volume = _volumeService.resizeVolume(this);
-     	if (volume != null) {
+         Volume volume = _volumeService.resizeVolume(this);
+         if (volume != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(volume);
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, volume);
              //FIXME - have to be moved to ApiResponseHelper
              response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 +            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to resize volume");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index 2a3a240,b57f2b4..f63a53c
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@@ -15,19 -15,15 +15,18 @@@
  // specific language governing permissions and limitations
  // under the License.
  package org.apache.cloudstack.api.command.user.volume;
- import org.apache.cloudstack.api.ACL;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.acl.SecurityChecker.AccessType;
--
  import org.apache.log4j.Logger;
  
++import org.apache.cloudstack.acl.AclEntityType;
++import org.apache.cloudstack.acl.SecurityChecker.AccessType;
++import org.apache.cloudstack.api.ACL;
  import org.apache.cloudstack.api.APICommand;
  import org.apache.cloudstack.api.ApiCommandJobType;
  import org.apache.cloudstack.api.ApiConstants;
  import org.apache.cloudstack.api.ApiErrorCode;
- import org.apache.cloudstack.api.BaseAsyncCmd;
+ import org.apache.cloudstack.api.BaseAsyncCustomIdCmd;
  import org.apache.cloudstack.api.Parameter;
 +import org.apache.cloudstack.api.ResponseObject.ResponseView;
  import org.apache.cloudstack.api.ServerApiException;
  import org.apache.cloudstack.api.response.StoragePoolResponse;
  import org.apache.cloudstack.api.response.VolumeResponse;
@@@ -37,8 -33,8 +36,8 @@@ import com.cloud.event.EventTypes
  import com.cloud.exception.InvalidParameterValueException;
  import com.cloud.storage.Volume;
  
 -@APICommand(name = "updateVolume", description = "Updates the volume.", responseObject = VolumeResponse.class)
 +@APICommand(name = "updateVolume", description = "Updates the volume.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { AclEntityType.Volume })
- public class UpdateVolumeCmd extends BaseAsyncCmd {
+ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
      public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName());
      private static final String s_name = "updatevolumeresponse";
  
@@@ -46,21 -42,25 +45,26 @@@
      //////////////// API parameters /////////////////////
      /////////////////////////////////////////////////////
  
 -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, description = "the ID of the disk volume")
 +    @ACL(accessType = AccessType.OperateEntry)
 +    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class, description="the ID of the disk volume")
      private Long id;
  
-     @Parameter(name=ApiConstants.PATH, type=CommandType.STRING, description="The path of the volume")
+     @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, description = "The path of the volume")
      private String path;
  
-     @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class,
-             description="Destination storage pool UUID for the volume", since="4.3")
+     @Parameter(name = ApiConstants.STORAGE_ID,
+                type = CommandType.UUID,
+                entityType = StoragePoolResponse.class,
+                description = "Destination storage pool UUID for the volume",
+                since = "4.3")
      private Long storageId;
  
-     @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="The state of the volume", since="4.3")
+     @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "The state of the volume", since = "4.3")
      private String state;
  
-     @Parameter(name=ApiConstants.DISPLAY_VOLUME, type=CommandType.BOOLEAN, description="an optional field, whether to the display the volume to the end user or not.")
+     @Parameter(name = ApiConstants.DISPLAY_VOLUME,
+                type = CommandType.BOOLEAN,
+                description = "an optional field, whether to the display the volume to the end user or not.")
      private Boolean displayVolume;
  
      /////////////////////////////////////////////////////
@@@ -138,11 -138,11 +142,11 @@@
      }
  
      @Override
-     public void execute(){
-         CallContext.current().setEventDetails("Volume Id: "+getId());
-         Volume result = _volumeService.updateVolume(getId(), getPath(), getState(), getStorageId(), getDisplayVolume());
+     public void execute() {
+         CallContext.current().setEventDetails("Volume Id: " + getId());
+         Volume result = _volumeService.updateVolume(getId(), getPath(), getState(), getStorageId(), getDisplayVolume(), getCustomId(), getEntityOwnerId());
          if (result != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(result);
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, result);
              response.setResponseName(getCommandName());
              setResponseObject(response);
          } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
index 51045b4,991cfc1..5fdd932
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
@@@ -121,19 -128,17 +130,17 @@@ public class UploadVolumeCmd extends Ba
      /////////////////////////////////////////////////////
  
      @Override
-     public void execute() throws ResourceUnavailableException,
-             InsufficientCapacityException, ServerApiException,
-             ConcurrentOperationException, ResourceAllocationException,
-             NetworkRuleConflictException {
+     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
+         ResourceAllocationException, NetworkRuleConflictException {
  
 -        Volume volume = _volumeService.uploadVolume(this);
 -        if (volume != null) {
 -            VolumeResponse response = _responseGenerator.createVolumeResponse(volume);
 -            response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 -        } else {
 -            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upload volume");
 -        }
 +            Volume volume = _volumeService.uploadVolume(this);
 +            if (volume != null){
 +            VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, volume);
 +                response.setResponseName(getCommandName());
 +                setResponseObject(response);
 +            } else {
 +                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upload volume");
 +            }
      }
  
      @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
index 89bd3b3,d4c52b8..57a7221
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
@@@ -44,49 -42,54 +44,54 @@@ public class CreateVPCCmd extends BaseA
      public static final Logger s_logger = Logger.getLogger(CreateVPCCmd.class.getName());
      private static final String s_name = "createvpcresponse";
  
-     /////////////////////////////////////////////////////
-     //////////////// API parameters /////////////////////
-     /////////////////////////////////////////////////////
+     // ///////////////////////////////////////////////////
+     // ////////////// API parameters /////////////////////
+     // ///////////////////////////////////////////////////
  
-     @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the VPC. " +
+     @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account associated with the VPC. " +
 -        "Must be used with the domainId parameter.")
 +            "Must be used with the domainId parameter.")
      private String accountName;
  
-     @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
-             description="the domain ID associated with the VPC. " +
+     @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class,
+                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.")
 +            "If used with the account parameter returns the VPC associated with the account for the specified domain.")
      private Long domainId;
  
-     @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType=ProjectResponse.class,
-             description="create VPC for the project")
+     @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class,
+                description = "create VPC for the project")
      private Long projectId;
  
-     @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
-             required=true, description="the ID of the availability zone")
+     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
+                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")
+     @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 " +
+     @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "the display text of " +
 -        "the VPC")
 +            "the VPC")
      private String displayText;
  
-     @Parameter(name=ApiConstants.CIDR, type=CommandType.STRING, required=true, description="the cidr of the VPC. All VPC " +
+     @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")
 +            "guest networks' cidrs should be within this CIDR")
      private String cidr;
  
-     @Parameter(name=ApiConstants.VPC_OFF_ID, type=CommandType.UUID, entityType=VpcOfferingResponse.class,
-             required=true, description="the ID of the VPC offering")
+     @Parameter(name = ApiConstants.VPC_OFF_ID, type = CommandType.UUID, entityType = VpcOfferingResponse.class,
+                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")
+     @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 ///////////////////////
-     /////////////////////////////////////////////////////
+     @Parameter(name = ApiConstants.START, type = CommandType.BOOLEAN,
+                description = "If set to false, the VPC won't start (VPC VR will not get allocated) until its first network gets implemented. " +
+                    "True by default.", since = "4.3")
+     private Boolean start;
+ 
+     // ///////////////////////////////////////////////////
+     // ///////////////// Accessors ///////////////////////
+     // ///////////////////////////////////////////////////
  
      public String getAccountName() {
          return accountName;
@@@ -135,10 -144,14 +146,14 @@@
      @Override
      public void execute() {
          Vpc vpc = null;
+         boolean success = true;
          try {
-              if (_vpcService.startVpc(getEntityId(), true)) {
-                 vpc = _entityMgr.findById(Vpc.class, getEntityId());
+             if (isStart()) {
+                 success = _vpcService.startVpc(getEntityId(), true);
+             } else {
+                 s_logger.debug("Not starting VPC as " + ApiConstants.START + "=false was passed to the API");
 -            }
 +             }
+             vpc = _entityMgr.findById(Vpc.class, getEntityId());
          } catch (ResourceUnavailableException ex) {
              s_logger.warn("Exception: ", ex);
              throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
@@@ -166,10 -178,9 +180,9 @@@
          return EventTypes.EVENT_VPC_CREATE;
      }
  
- 
      @Override
      public String getEventDescription() {
 -        return "creating VPC. Id: " + getEntityId();
 +        return  "creating VPC. Id: " + getEntityId();
      }
  
      @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
index 54e9ad6,5732c65..459d4de
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
@@@ -31,10 -30,10 +31,10 @@@ import com.cloud.event.EventTypes
  import com.cloud.network.vpc.Vpc;
  import com.cloud.user.Account;
  
 -@APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class)
 -public class UpdateVPCCmd extends BaseAsyncCmd {
 +@APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted)
 +public class UpdateVPCCmd extends BaseAsyncCmd{
      public static final Logger s_logger = Logger.getLogger(UpdateVPCCmd.class.getName());
-     private static final String _name = "updatevpcresponse";
+     private static final String Name = "updatevpcresponse";
  
      /////////////////////////////////////////////////////
      //////////////// API parameters /////////////////////
@@@ -87,12 -83,12 +84,12 @@@
      }
  
      @Override
-     public void execute(){
+     public void execute() {
          Vpc result = _vpcService.updateVpc(getId(), getVpcName(), getDisplayText());
          if (result != null) {
 -            VpcResponse response = _responseGenerator.createVpcResponse(result);
 +            VpcResponse response = _responseGenerator.createVpcResponse(ResponseView.Restricted, result);
              response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 +            setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update VPC");
          }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
index 27f8b35,0000000..1b2969d
mode 100644,000000..100644
--- a/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java
@@@ -1,134 -1,0 +1,132 @@@
 +// Licensed to the Apache Software Foundation (ASF) under one
 +// or more contributor license agreements.  See the NOTICE file
 +// distributed with this work for additional information
 +// regarding copyright ownership.  The ASF licenses this file
 +// to you under the Apache License, Version 2.0 (the
 +// "License"); you may not use this file except in compliance
 +// with the License.  You may obtain a copy of the License at
 +//
 +//   http://www.apache.org/licenses/LICENSE-2.0
 +//
 +// Unless required by applicable law or agreed to in writing,
 +// software distributed under the License is distributed on an
 +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +// KIND, either express or implied.  See the License for the
 +// specific language governing permissions and limitations
 +// under the License.
 +package org.apache.cloudstack.api.command.user.zone;
 +
 +import java.util.Collection;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.Map;
 +
 +import org.apache.log4j.Logger;
 +
 +import org.apache.cloudstack.api.APICommand;
 +import org.apache.cloudstack.api.ApiConstants;
 +import org.apache.cloudstack.api.BaseListCmd;
 +import org.apache.cloudstack.api.Parameter;
 +import org.apache.cloudstack.api.ResponseObject.ResponseView;
 +import org.apache.cloudstack.api.response.DomainResponse;
 +import org.apache.cloudstack.api.response.ListResponse;
 +import org.apache.cloudstack.api.response.ZoneResponse;
 +
 +import com.cloud.exception.InvalidParameterValueException;
 +
 +@APICommand(name = "listZones", description = "Lists zones", responseObject = ZoneResponse.class, responseView = ResponseView.Restricted)
 +public class ListZonesCmd extends BaseListCmd {
 +    public static final Logger s_logger = Logger.getLogger(ListZonesCmd.class.getName());
- 
 +    private static final String s_name = "listzonesresponse";
 +
 +    /////////////////////////////////////////////////////
 +    //////////////// API parameters /////////////////////
 +    /////////////////////////////////////////////////////
-     @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ZoneResponse.class,
-             description= "the ID of the zone")
++    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "the ID of the zone")
 +    private Long id;
 +
-     @Parameter(name=ApiConstants.AVAILABLE, type=CommandType.BOOLEAN,
-             description="true if you want to retrieve all available Zones. False if you only want to return the Zones" +
-                     " from which you have at least one VM. Default is false.")
++    @Parameter(name = ApiConstants.AVAILABLE,
++               type = CommandType.BOOLEAN,
++               description = "true if you want to retrieve all available Zones. False if you only want to return the Zones"
++                   + " from which you have at least one VM. Default is false.")
 +    private Boolean available;
 +
-     @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
-             description="the ID of the domain associated with the zone")
++    @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the ID of the domain associated with the zone")
 +    private Long domainId;
 +
-     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the zone")
++    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the zone")
 +    private String name;
 +
-     @Parameter(name=ApiConstants.NETWORK_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
++    @Parameter(name = ApiConstants.NETWORK_TYPE, type = CommandType.STRING, description = "the network type of the zone that the virtual machine belongs to")
 +    private String networkType;
-     
-     @Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the zones")
++
++    @Parameter(name = ApiConstants.SHOW_CAPACITIES, type = CommandType.BOOLEAN, description = "flag to display the capacity of the zones")
 +    private Boolean showCapacities;
-     
-     @Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "List zones by resource tags (key/value pairs)", since="4.3")
++
++    @Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "List zones by resource tags (key/value pairs)", since = "4.3")
 +    private Map tags;
 +
 +    /////////////////////////////////////////////////////
 +    /////////////////// Accessors ///////////////////////
 +    /////////////////////////////////////////////////////
 +
 +    public Long getId() {
 +        return id;
 +    }
 +
 +    public Boolean isAvailable() {
 +        return available;
 +    }
 +
-     public Long getDomainId(){
++    public Long getDomainId() {
 +        return domainId;
 +    }
 +
-     public String getName(){
++    public String getName() {
 +        return name;
 +    }
 +
 +    public String getNetworkType() {
 +        return networkType;
 +    }
-     
++
 +    public Boolean getShowCapacities() {
 +        return showCapacities;
 +    }
-     
++
 +    public Map<String, String> getTags() {
 +        Map<String, String> tagsMap = null;
 +        if (tags != null && !tags.isEmpty()) {
 +            tagsMap = new HashMap<String, String>();
 +            Collection<?> servicesCollection = tags.values();
 +            Iterator<?> iter = servicesCollection.iterator();
 +            while (iter.hasNext()) {
-                 HashMap<String, String> services = (HashMap<String, String>) iter.next();
++                HashMap<String, String> services = (HashMap<String, String>)iter.next();
 +                String key = services.get("key");
 +                String value = services.get("value");
 +                if (value == null) {
 +                    throw new InvalidParameterValueException("No value is passed in for key " + key);
 +                }
 +                tagsMap.put(key, value);
 +            }
 +        }
 +        return tagsMap;
 +    }
 +
 +    /////////////////////////////////////////////////////
 +    /////////////// API Implementation///////////////////
 +    /////////////////////////////////////////////////////
 +
 +    @Override
 +    public String getCommandName() {
 +        return s_name;
 +    }
 +
 +    @Override
-     public void execute(){
++    public void execute() {
 +
 +        ListResponse<ZoneResponse> response = _queryService.listDataCenters(this);
 +        response.setResponseName(getCommandName());
 +        setResponseObject(response);
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/api/response/AccountResponse.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/response/AccountResponse.java
index e6e055d,b7d30ca..7d36785
--- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java
@@@ -31,166 -31,214 +31,218 @@@ import com.cloud.user.Account
  @SuppressWarnings("unused")
  @EntityReference(value = Account.class)
  public class AccountResponse extends BaseResponse implements ResourceLimitAndCountResponse {
-     @SerializedName(ApiConstants.ID) @Param(description="the id of the account")
+     @SerializedName(ApiConstants.ID)
+     @Param(description = "the id of the account")
      private String id;
  
-     @SerializedName(ApiConstants.NAME) @Param(description="the name of the account")
+     @SerializedName(ApiConstants.NAME)
+     @Param(description = "the name of the account")
      private String name;
  
-     @SerializedName(ApiConstants.ACCOUNT_TYPE) @Param(description="account type (admin, domain-admin, user)")
+     @SerializedName(ApiConstants.ACCOUNT_TYPE)
+     @Param(description = "account type (admin, domain-admin, user)")
      private Short accountType;
  
-     @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="id of the Domain the account belongs too")
+     @SerializedName(ApiConstants.DOMAIN_ID)
+     @Param(description = "id of the Domain the account belongs too")
      private String domainId;
  
-     @SerializedName(ApiConstants.DOMAIN) @Param(description="name of the Domain the account belongs too")
+     @SerializedName(ApiConstants.DOMAIN)
+     @Param(description = "name of the Domain the account belongs too")
      private String domainName;
  
-     @SerializedName(ApiConstants.DEFAULT_ZONE_ID) @Param(description="the default zone of the account")
+     @SerializedName(ApiConstants.DEFAULT_ZONE_ID)
+     @Param(description = "the default zone of the account")
      private String defaultZoneId;
  
-     @SerializedName(ApiConstants.RECEIVED_BYTES) @Param(description="the total number of network traffic bytes received")
+     @SerializedName(ApiConstants.RECEIVED_BYTES)
+     @Param(description = "the total number of network traffic bytes received")
      private Long bytesReceived;
  
-     @SerializedName(ApiConstants.SENT_BYTES) @Param(description="the total number of network traffic bytes sent")
+     @SerializedName(ApiConstants.SENT_BYTES)
+     @Param(description = "the total number of network traffic bytes sent")
      private Long bytesSent;
  
-     @SerializedName(ApiConstants.VM_LIMIT) @Param(description="the total number of virtual machines that can be deployed by this account")
+     @SerializedName(ApiConstants.VM_LIMIT)
+     @Param(description = "the total number of virtual machines that can be deployed by this account")
      private String vmLimit;
  
-     @SerializedName(ApiConstants.VM_TOTAL) @Param(description="the total number of virtual machines deployed by this account")
+     @SerializedName(ApiConstants.VM_TOTAL)
+     @Param(description = "the total number of virtual machines deployed by this account")
      private Long vmTotal;
  
-     @SerializedName(ApiConstants.VM_AVAILABLE) @Param(description="the total number of virtual machines available for this account to acquire")
+     @SerializedName(ApiConstants.VM_AVAILABLE)
+     @Param(description = "the total number of virtual machines available for this account to acquire")
      private String vmAvailable;
  
-     @SerializedName(ApiConstants.IP_LIMIT) @Param(description="the total number of public ip addresses this account can acquire")
+     @SerializedName(ApiConstants.IP_LIMIT)
+     @Param(description = "the total number of public ip addresses this account can acquire")
      private String ipLimit;
  
-     @SerializedName(ApiConstants.IP_TOTAL) @Param(description="the total number of public ip addresses allocated for this account")
+     @SerializedName(ApiConstants.IP_TOTAL)
+     @Param(description = "the total number of public ip addresses allocated for this account")
      private Long ipTotal;
  
-     @SerializedName(ApiConstants.IP_AVAILABLE) @Param(description="the total number of public ip addresses available for this account to acquire")
+     @SerializedName(ApiConstants.IP_AVAILABLE)
+     @Param(description = "the total number of public ip addresses available for this account to acquire")
      private String ipAvailable;
  
-     @SerializedName("volumelimit") @Param(description="the total volume which can be used by this account")
+     @SerializedName("volumelimit")
+     @Param(description = "the total volume which can be used by this account")
      private String volumeLimit;
  
-     @SerializedName("volumetotal") @Param(description="the total volume being used by this account")
+     @SerializedName("volumetotal")
+     @Param(description = "the total volume being used by this account")
      private Long volumeTotal;
  
-     @SerializedName("volumeavailable") @Param(description="the total volume available for this account")
+     @SerializedName("volumeavailable")
+     @Param(description = "the total volume available for this account")
      private String volumeAvailable;
  
-     @SerializedName("snapshotlimit") @Param(description="the total number of snapshots which can be stored by this account")
+     @SerializedName("snapshotlimit")
+     @Param(description = "the total number of snapshots which can be stored by this account")
      private String snapshotLimit;
  
-     @SerializedName("snapshottotal") @Param(description="the total number of snapshots stored by this account")
+     @SerializedName("snapshottotal")
+     @Param(description = "the total number of snapshots stored by this account")
      private Long snapshotTotal;
  
-     @SerializedName("snapshotavailable") @Param(description="the total number of snapshots available for this account")
+     @SerializedName("snapshotavailable")
+     @Param(description = "the total number of snapshots available for this account")
      private String snapshotAvailable;
  
-     @SerializedName("templatelimit") @Param(description="the total number of templates which can be created by this account")
+     @SerializedName("templatelimit")
+     @Param(description = "the total number of templates which can be created by this account")
      private String templateLimit;
  
-     @SerializedName("templatetotal") @Param(description="the total number of templates which have been created by this account")
+     @SerializedName("templatetotal")
+     @Param(description = "the total number of templates which have been created by this account")
      private Long templateTotal;
  
-     @SerializedName("templateavailable") @Param(description="the total number of templates available to be created by this account")
+     @SerializedName("templateavailable")
+     @Param(description = "the total number of templates available to be created by this account")
      private String templateAvailable;
  
-     @SerializedName("vmstopped") @Param(description="the total number of virtual machines stopped for this account")
+     @SerializedName("vmstopped")
+     @Param(description = "the total number of virtual machines stopped for this account")
      private Integer vmStopped;
  
-     @SerializedName("vmrunning") @Param(description="the total number of virtual machines running for this account")
+     @SerializedName("vmrunning")
+     @Param(description = "the total number of virtual machines running for this account")
      private Integer vmRunning;
  
-     @SerializedName("projectlimit") @Param(description="the total number of projects the account can own", since="3.0.1")
+     @SerializedName("projectlimit")
+     @Param(description = "the total number of projects the account can own", since = "3.0.1")
      private String projectLimit;
  
-     @SerializedName("projecttotal") @Param(description="the total number of projects being administrated by this account", since="3.0.1")
+     @SerializedName("projecttotal")
+     @Param(description = "the total number of projects being administrated by this account", since = "3.0.1")
      private Long projectTotal;
  
-     @SerializedName("projectavailable") @Param(description="the total number of projects available for administration by this account", since="3.0.1")
+     @SerializedName("projectavailable")
+     @Param(description = "the total number of projects available for administration by this account", since = "3.0.1")
      private String projectAvailable;
  
-     @SerializedName("networklimit") @Param(description="the total number of networks the account can own", since="3.0.1")
+     @SerializedName("networklimit")
+     @Param(description = "the total number of networks the account can own", since = "3.0.1")
      private String networkLimit;
  
-     @SerializedName("networktotal") @Param(description="the total number of networks owned by account", since="3.0.1")
+     @SerializedName("networktotal")
+     @Param(description = "the total number of networks owned by account", since = "3.0.1")
      private Long networkTotal;
  
-     @SerializedName("networkavailable") @Param(description="the total number of networks available to be created for this account", since="3.0.1")
+     @SerializedName("networkavailable")
+     @Param(description = "the total number of networks available to be created for this account", since = "3.0.1")
      private String networkAvailable;
  
-     @SerializedName("vpclimit") @Param(description="the total number of vpcs the account can own", since="4.0.0")
+     @SerializedName("vpclimit")
+     @Param(description = "the total number of vpcs the account can own", since = "4.0.0")
      private String vpcLimit;
  
-     @SerializedName("vpctotal") @Param(description="the total number of vpcs owned by account", since="4.0.0")
+     @SerializedName("vpctotal")
+     @Param(description = "the total number of vpcs owned by account", since = "4.0.0")
      private Long vpcTotal;
  
-     @SerializedName("vpcavailable") @Param(description="the total number of vpcs available to be created for this account", since="4.0.0")
+     @SerializedName("vpcavailable")
+     @Param(description = "the total number of vpcs available to be created for this account", since = "4.0.0")
      private String vpcAvailable;
  
-     @SerializedName("cpulimit") @Param(description="the total number of cpu cores the account can own", since="4.2.0")
+     @SerializedName("cpulimit")
+     @Param(description = "the total number of cpu cores the account can own", since = "4.2.0")
      private String cpuLimit;
  
-     @SerializedName("cputotal") @Param(description="the total number of cpu cores owned by account", since="4.2.0")
+     @SerializedName("cputotal")
+     @Param(description = "the total number of cpu cores owned by account", since = "4.2.0")
      private Long cpuTotal;
  
-     @SerializedName("cpuavailable") @Param(description="the total number of cpu cores available to be created for this account", since="4.2.0")
+     @SerializedName("cpuavailable")
+     @Param(description = "the total number of cpu cores available to be created for this account", since = "4.2.0")
      private String cpuAvailable;
  
-     @SerializedName("memorylimit") @Param(description="the total memory (in MB) the account can own", since="4.2.0")
+     @SerializedName("memorylimit")
+     @Param(description = "the total memory (in MB) the account can own", since = "4.2.0")
      private String memoryLimit;
  
-     @SerializedName("memorytotal") @Param(description="the total memory (in MB) owned by account", since="4.2.0")
+     @SerializedName("memorytotal")
+     @Param(description = "the total memory (in MB) owned by account", since = "4.2.0")
      private Long memoryTotal;
  
-     @SerializedName("memoryavailable") @Param(description="the total memory (in MB) available to be created for this account", since="4.2.0")
+     @SerializedName("memoryavailable")
+     @Param(description = "the total memory (in MB) available to be created for this account", since = "4.2.0")
      private String memoryAvailable;
  
-     @SerializedName("primarystoragelimit") @Param(description="the total primary storage space (in GiB) the account can own", since="4.2.0")
+     @SerializedName("primarystoragelimit")
+     @Param(description = "the total primary storage space (in GiB) the account can own", since = "4.2.0")
      private String primaryStorageLimit;
  
-     @SerializedName("primarystoragetotal") @Param(description="the total primary storage space (in GiB) owned by account", since="4.2.0")
+     @SerializedName("primarystoragetotal")
+     @Param(description = "the total primary storage space (in GiB) owned by account", since = "4.2.0")
      private Long primaryStorageTotal;
  
-     @SerializedName("primarystorageavailable") @Param(description="the total primary storage space (in GiB) available to be used for this account", since="4.2.0")
+     @SerializedName("primarystorageavailable")
+     @Param(description = "the total primary storage space (in GiB) available to be used for this account", since = "4.2.0")
      private String primaryStorageAvailable;
  
-     @SerializedName("secondarystoragelimit") @Param(description="the total secondary storage space (in GiB) the account can own", since="4.2.0")
+     @SerializedName("secondarystoragelimit")
+     @Param(description = "the total secondary storage space (in GiB) the account can own", since = "4.2.0")
      private String secondaryStorageLimit;
  
-     @SerializedName("secondarystoragetotal") @Param(description="the total secondary storage space (in GiB) owned by account", since="4.2.0")
+     @SerializedName("secondarystoragetotal")
+     @Param(description = "the total secondary storage space (in GiB) owned by account", since = "4.2.0")
      private Long secondaryStorageTotal;
  
-     @SerializedName("secondarystorageavailable") @Param(description="the total secondary storage space (in GiB) available to be used for this account", since="4.2.0")
+     @SerializedName("secondarystorageavailable")
+     @Param(description = "the total secondary storage space (in GiB) available to be used for this account", since = "4.2.0")
      private String secondaryStorageAvailable;
  
-     @SerializedName(ApiConstants.STATE) @Param(description="the state of the account")
+     @SerializedName(ApiConstants.STATE)
+     @Param(description = "the state of the account")
      private String state;
  
-     @SerializedName(ApiConstants.IS_CLEANUP_REQUIRED) @Param(description="true if the account requires cleanup")
+     @SerializedName(ApiConstants.IS_CLEANUP_REQUIRED)
+     @Param(description = "true if the account requires cleanup")
      private Boolean cleanupRequired;
  
-     @SerializedName("user")  @Param(description="the list of users associated with account", responseObject = UserResponse.class)
+     @SerializedName("user")
+     @Param(description = "the list of users associated with account", responseObject = UserResponse.class)
      private List<UserResponse> users;
  
-     @SerializedName(ApiConstants.NETWORK_DOMAIN) @Param(description="the network domain")
+     @SerializedName(ApiConstants.NETWORK_DOMAIN)
+     @Param(description = "the network domain")
      private String networkDomain;
  
-     @SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account")
+     @SerializedName(ApiConstants.ACCOUNT_DETAILS)
+     @Param(description = "details for the account")
      private Map<String, String> details;
-     
-     @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if account is default, false otherwise", since="4.2.0")
+ 
+     @SerializedName(ApiConstants.IS_DEFAULT)
+     @Param(description = "true if account is default, false otherwise", since = "4.2.0")
      private Boolean isDefault;
  
 +    @SerializedName(ApiConstants.ACL_GROUPS)
 +    @Param(description = "the list of acl groups that account belongs to")
 +    private List<String> groups;
 +
      @Override
      public String getObjectId() {
          return id;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/src/org/apache/cloudstack/query/QueryService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/client/pom.xml
----------------------------------------------------------------------
diff --cc client/pom.xml
index e00651b,5215e0c..290645f
--- a/client/pom.xml
+++ b/client/pom.xml
@@@ -17,8 -17,8 +17,8 @@@
    <parent>
      <groupId>org.apache.cloudstack</groupId>
      <artifactId>cloudstack</artifactId>
-     <version>4.3.0-SNAPSHOT</version>
+     <version>4.4.0-SNAPSHOT</version>
 -  </parent>
 +  </parent> 
    <dependencies>
      <dependency>
        <groupId>org.apache.cloudstack</groupId>
@@@ -172,7 -182,12 +182,12 @@@
        <version>${project.version}</version>
      </dependency>
      <dependency>
 -       <groupId>org.apache.cloudstack</groupId>
 +      <groupId>org.apache.cloudstack</groupId>
+        <artifactId>cloud-plugin-planner-skip-heurestics</artifactId>
+        <version>${project.version}</version>
+     </dependency>
+     <dependency>
+       <groupId>org.apache.cloudstack</groupId>
        <artifactId>cloud-plugin-planner-user-concentrated-pod</artifactId>
        <version>${project.version}</version>
      </dependency>
@@@ -198,14 -213,9 +213,19 @@@
      </dependency>
      <dependency>
        <groupId>org.apache.cloudstack</groupId>
+       <artifactId>cloud-mom-inmemory</artifactId>
+       <version>${project.version}</version>
 -    </dependency>
++    </dependency>    
++    <dependency>
++      <groupId>org.apache.cloudstack</groupId>
 +      <artifactId>cloud-plugin-iam</artifactId>
 +      <version>${project.version}</version>
 +    </dependency>   
 +    <dependency>
 +      <groupId>org.apache.cloudstack</groupId>
 +      <artifactId>cloud-iam</artifactId>
 +      <version>${project.version}</version>
 +    </dependency>         
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/commands.properties.in
index 8829cc5,c5ac7fd..85715fd
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@@ -682,22 -704,6 +704,20 @@@ listLdapUsers=
  ldapCreateAccount=3
  importLdapUsers=3
  
 +### Acl commands
- createAclRole=7
- deleteAclRole=7
- listAclRoles=7
- grantPermissionToAclRole=7
- revokePermissionFromAclRole=7
- createAclGroup=7
- deleteAclGroup=7
- listAclGroups=7
- addAclRoleToAclGroup=7
- removeAclRoleFromAclGroup=7
- addAccountToAclGroup=7
- removeAccountFromAclGroup=7
- grantPermissionToAclGroup=7
- revokePermissionFromAclGroup=7
++createAclPolicy=1
++deleteAclPolicy=1
++listAclPolicies=1
++addAclPermissionToAclPolicy=1
++removeAclPermissionFromAclPolicy=1
++createAclGroup=1
++deleteAclGroup=1
++listAclGroups=1
++addAccountToAclGroup=1
++removeAccountFromAclGroup=1
++attachAclPolicyToAclGroup=1
++removeAclPolicyFromAclGroup=1
 +
  #### juniper-contrail commands
  createServiceInstance=1
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
----------------------------------------------------------------------
diff --cc core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
index aa210bc,5e799c0..f2d2681
--- a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
+++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
@@@ -213,7 -218,17 +218,17 @@@
              </list>
          </property>
      </bean>
 -    
 +
+     <bean id="remoteAccessVPNServiceProviderRegistry"
+         class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+         <property name="excludeKey" value="remote.access.vpn.service.provider.exclude" />
+         <property name="preRegistered">
+             <list>
+                 <ref bean="VpcVirtualRouter" />
+             </list>
+         </property>
+     </bean>
+ 
      <bean id="affinityProcessorsRegistry"
          class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
          <property name="orderConfigKey" value="affinity.processors.order" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/components-api/src/com/cloud/network/addr/PublicIp.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java
----------------------------------------------------------------------
diff --cc engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java
index 8c3d557,1c67047..c7b7fec
--- a/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java
+++ b/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java
@@@ -35,18 -33,18 +35,18 @@@ public class StaticNatRuleImpl implemen
      String destIpAddress;
  
      public StaticNatRuleImpl(FirewallRuleVO rule, String dstIp) {
--        this.id = rule.getId();
--        this.xid = rule.getXid();
--        this.uuid = rule.getUuid();
--        this.protocol = rule.getProtocol();
--        this.portStart = rule.getSourcePortStart();
--        this.portEnd = rule.getSourcePortEnd();
--        this.state = rule.getState();
--        this.accountId = rule.getAccountId();
--        this.domainId = rule.getDomainId();
--        this.networkId = rule.getNetworkId();
--        this.sourceIpAddressId = rule.getSourceIpAddressId();
--        this.destIpAddress = dstIp;
++        id = rule.getId();
++        xid = rule.getXid();
++        uuid = rule.getUuid();
++        protocol = rule.getProtocol();
++        portStart = rule.getSourcePortStart();
++        portEnd = rule.getSourcePortEnd();
++        state = rule.getState();
++        accountId = rule.getAccountId();
++        domainId = rule.getDomainId();
++        networkId = rule.getNetworkId();
++        sourceIpAddressId = rule.getSourceIpAddressId();
++        destIpAddress = dstIp;
      }
  
      @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/event/EventVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/event/EventVO.java
index d422fc1,487ba84..fb4feb9
--- a/engine/schema/src/com/cloud/event/EventVO.java
+++ b/engine/schema/src/com/cloud/event/EventVO.java
@@@ -86,9 -84,10 +86,10 @@@ public class EventVO implements Event 
      public static final String LEVEL_ERROR = "ERROR";
  
      public EventVO() {
--        this.uuid = UUID.randomUUID().toString();
++        uuid = UUID.randomUUID().toString();
      }
  
+     @Override
      public long getId() {
          return id;
      }
@@@ -178,7 -193,7 +195,7 @@@
  
      @Override
      public String getUuid() {
--        return this.uuid;
++        return uuid;
      }
  
      public void setUuid(String uuid) {