cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [19/57] api: Refactor command and response classes to org.apache.cloudstack.api.*
Date Sat, 08 Dec 2012 03:29:51 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
new file mode 100644
index 0000000..8085e69
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
@@ -0,0 +1,305 @@
+// 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.response;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.cloudstack.api.ApiConstants;
+import com.cloud.serializer.Param;
+import com.cloud.utils.IdentityProxy;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+@SuppressWarnings("unused")
+public class VolumeResponse extends BaseResponse implements ControlledEntityResponse{
+    @SerializedName(ApiConstants.ID)
+    @Param(description = "ID of the disk volume")
+    private IdentityProxy id = new IdentityProxy("volumes");
+
+    @SerializedName(ApiConstants.NAME)
+    @Param(description = "name of the disk volume")
+    private String name;
+
+    @SerializedName(ApiConstants.ZONE_ID)
+    @Param(description = "ID of the availability zone")
+    private IdentityProxy zoneId = new IdentityProxy("data_center");
+
+    @SerializedName(ApiConstants.ZONE_NAME)
+    @Param(description = "name of the availability zone")
+    private String zoneName;
+
+    @SerializedName(ApiConstants.TYPE)
+    @Param(description = "type of the disk volume (ROOT or DATADISK)")
+    private String volumeType;
+
+    @SerializedName(ApiConstants.DEVICE_ID)
+    @Param(description = "the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.")
+    private Long deviceId;
+
+    @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID)
+    @Param(description = "id of the virtual machine")
+    private IdentityProxy virtualMachineId = new IdentityProxy("vm_instance");
+
+    @SerializedName("vmname")
+    @Param(description = "name of the virtual machine")
+    private String virtualMachineName;
+
+    @SerializedName("vmdisplayname")
+    @Param(description = "display name of the virtual machine")
+    private String virtualMachineDisplayName;
+
+    @SerializedName("vmstate")
+    @Param(description = "state of the virtual machine")
+    private String virtualMachineState;
+
+    @SerializedName(ApiConstants.SIZE)
+    @Param(description = "size of the disk volume")
+    private Long size;
+
+    @SerializedName(ApiConstants.CREATED)
+    @Param(description = "the date the disk volume was created")
+    private Date created;
+
+    @SerializedName(ApiConstants.STATE)
+    @Param(description = "the state of the disk volume")
+    private String state;
+
+    @SerializedName(ApiConstants.ACCOUNT)
+    @Param(description = "the account associated with the disk volume")
+    private String accountName;
+
+    @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
+    private IdentityProxy projectId = new IdentityProxy("projects");
+
+    @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
+    private String projectName;
+
+    @SerializedName(ApiConstants.DOMAIN_ID)
+    @Param(description = "the ID of the domain associated with the disk volume")
+    private IdentityProxy domainId = new IdentityProxy("domain");
+
+    @SerializedName(ApiConstants.DOMAIN)
+    @Param(description = "the domain associated with the disk volume")
+    private String domainName;
+
+    @SerializedName("storagetype")
+    @Param(description = "shared or local storage")
+    private String storageType;
+
+    @SerializedName(ApiConstants.HYPERVISOR)
+    @Param(description = "Hypervisor the volume belongs to")
+    private String hypervisor;
+
+    @SerializedName(ApiConstants.DISK_OFFERING_ID)
+    @Param(description = "ID of the disk offering")
+    private IdentityProxy diskOfferingId = new IdentityProxy("disk_offering");
+
+    @SerializedName("diskofferingname")
+    @Param(description = "name of the disk offering")
+    private String diskOfferingName;
+
+    @SerializedName("diskofferingdisplaytext")
+    @Param(description = "the display text of the disk offering")
+    private String diskOfferingDisplayText;
+
+    @SerializedName("storage")
+    @Param(description = "name of the primary storage hosting the disk volume")
+    private String storagePoolName;
+
+    @SerializedName(ApiConstants.SNAPSHOT_ID)
+    @Param(description = "ID of the snapshot from which this volume was created")
+    private IdentityProxy snapshotId = new IdentityProxy("snapshots");
+
+    @SerializedName("attached")
+    @Param(description = "the date the volume was attached to a VM instance")
+    private Date attached;
+
+    @SerializedName("destroyed")
+    @Param(description = "the boolean state of whether the volume is destroyed or not")
+    private Boolean destroyed;
+
+    @SerializedName(ApiConstants.SERVICE_OFFERING_ID)
+    @Param(description = "ID of the service offering for root disk")
+    private IdentityProxy serviceOfferingId = new IdentityProxy("disk_offering");
+
+    @SerializedName("serviceofferingname")
+    @Param(description = "name of the service offering for root disk")
+    private String serviceOfferingName;
+
+    @SerializedName("serviceofferingdisplaytext")
+    @Param(description = "the display text of the service offering for root disk")
+    private String serviceOfferingDisplayText;
+
+    @SerializedName("isextractable")
+    @Param(description = "true if the volume is extractable, false otherwise")
+    private Boolean extractable;
+
+    @SerializedName(ApiConstants.STATUS)
+    @Param(description="the status of the volume")
+    private String status;
+
+    @SerializedName(ApiConstants.TAGS)  @Param(description="the list of resource tags associated with volume", responseObject = ResourceTagResponse.class)
+    private List<ResourceTagResponse> tags;
+
+    @Override
+    public Long getObjectId() {
+        return getId();
+    }
+
+    public Boolean getDestroyed() {
+        return destroyed;
+    }
+
+    public void setDestroyed(Boolean destroyed) {
+        this.destroyed = destroyed;
+    }
+
+    public Long getId() {
+        return id.getValue();
+    }
+
+    public void setId(Long id) {
+        this.id.setValue(id);
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setZoneId(Long zoneId) {
+        this.zoneId.setValue(zoneId);
+    }
+
+    public void setZoneName(String zoneName) {
+        this.zoneName = zoneName;
+    }
+
+    public void setVolumeType(String volumeType) {
+        this.volumeType = volumeType;
+    }
+
+    public void setDeviceId(Long deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public void setVirtualMachineId(Long virtualMachineId) {
+        this.virtualMachineId.setValue(virtualMachineId);
+    }
+
+    public void setVirtualMachineName(String virtualMachineName) {
+        this.virtualMachineName = virtualMachineName;
+    }
+
+    public void setVirtualMachineDisplayName(String virtualMachineDisplayName) {
+        this.virtualMachineDisplayName = virtualMachineDisplayName;
+    }
+
+    public void setVirtualMachineState(String virtualMachineState) {
+        this.virtualMachineState = virtualMachineState;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    public void setDomainId(Long domainId) {
+        this.domainId.setValue(domainId);
+    }
+
+    public void setDomainName(String domainName) {
+        this.domainName = domainName;
+    }
+
+    public void setStorageType(String storageType) {
+        this.storageType = storageType;
+    }
+
+    public void setHypervisor(String hypervisor) {
+        this.hypervisor = hypervisor;
+    }
+
+    public void setDiskOfferingId(Long diskOfferingId) {
+        this.diskOfferingId.setValue(diskOfferingId);
+    }
+
+    public void setDiskOfferingName(String diskOfferingName) {
+        this.diskOfferingName = diskOfferingName;
+    }
+
+    public void setDiskOfferingDisplayText(String diskOfferingDisplayText) {
+        this.diskOfferingDisplayText = diskOfferingDisplayText;
+    }
+
+    public void setStoragePoolName(String storagePoolName) {
+        this.storagePoolName = storagePoolName;
+    }
+
+    public void setSnapshotId(Long snapshotId) {
+        this.snapshotId.setValue(snapshotId);
+    }
+
+    public void setAttached(Date attached) {
+        this.attached = attached;
+    }
+
+    public void setServiceOfferingId(Long serviceOfferingId) {
+        this.serviceOfferingId.setValue(serviceOfferingId);
+    }
+
+    public void setServiceOfferingName(String serviceOfferingName) {
+        this.serviceOfferingName = serviceOfferingName;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public void setServiceOfferingDisplayText(String serviceOfferingDisplayText) {
+        this.serviceOfferingDisplayText = serviceOfferingDisplayText;
+    }
+
+    public void setExtractable(Boolean extractable) {
+        this.extractable = extractable;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    @Override
+    public void setProjectId(Long projectId) {
+        this.projectId.setValue(projectId);
+    }
+
+    @Override
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public void setTags(List<ResourceTagResponse> tags) {
+        this.tags = tags;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
new file mode 100644
index 0000000..f8c1351
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
@@ -0,0 +1,79 @@
+// 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.response;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.cloudstack.api.ApiConstants;
+import com.cloud.serializer.Param;
+import com.cloud.utils.IdentityProxy;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+@SuppressWarnings("unused")
+public class VpcOfferingResponse extends BaseResponse {
+    @SerializedName("id") @Param(description="the id of the vpc offering")
+    private final IdentityProxy id = new IdentityProxy("vpc_offerings");
+
+    @SerializedName(ApiConstants.NAME) @Param(description="the name of the vpc offering")
+    private String name;
+
+    @SerializedName(ApiConstants.DISPLAY_TEXT) @Param(description="an alternate display text of the vpc offering.")
+    private String displayText;
+
+    @SerializedName(ApiConstants.CREATED) @Param(description="the date this vpc offering was created")
+    private Date created;
+
+    @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if vpc offering is default, false otherwise")
+    private Boolean isDefault;
+
+    @SerializedName(ApiConstants.STATE) @Param(description="state of the vpc offering. Can be Disabled/Enabled")
+    private String state;
+
+    @SerializedName(ApiConstants.SERVICE) @Param(description="the list of supported services", responseObject = ServiceResponse.class)
+    private List<ServiceResponse> services;
+
+
+    public void setId(Long id) {
+        this.id.setValue(id);
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setDisplayText(String displayText) {
+        this.displayText = displayText;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public void setIsDefault(Boolean isDefault) {
+        this.isDefault = isDefault;
+    }
+
+    public void setServices(List<ServiceResponse> services) {
+        this.services = services;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/response/VpcResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
new file mode 100644
index 0000000..0c5f02a
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
@@ -0,0 +1,171 @@
+// 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.response;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.cloudstack.api.ApiConstants;
+import com.cloud.serializer.Param;
+import com.cloud.utils.IdentityProxy;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+@SuppressWarnings("unused")
+public class VpcResponse extends BaseResponse implements ControlledEntityResponse{
+    @SerializedName("id") @Param(description="the id of the VPC")
+    private final IdentityProxy id = new IdentityProxy("vpc");
+
+    @SerializedName(ApiConstants.NAME) @Param(description="the name of the VPC")
+    private String name;
+
+    @SerializedName(ApiConstants.DISPLAY_TEXT) @Param(description="an alternate display text of the VPC.")
+    private String displayText;
+
+    @SerializedName(ApiConstants.STATE) @Param(description="state of the VPC. Can be Inactive/Enabled")
+    private String state;
+
+    @SerializedName(ApiConstants.ZONE_ID) @Param(description="zone id of the vpc")
+    private IdentityProxy zoneId = new IdentityProxy("data_center");
+
+    @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the zone the VPC belongs to")
+    private String zoneName;
+
+    @SerializedName(ApiConstants.SERVICE) @Param(description="the list of supported services", responseObject = ServiceResponse.class)
+    private List<ServiceResponse> services;
+
+    @SerializedName(ApiConstants.CIDR) @Param(description="the cidr the VPC")
+    private String cidr;
+
+    @SerializedName(ApiConstants.VPC_OFF_ID) @Param(description="vpc offering id the VPC is created from")
+    private IdentityProxy vpcOfferingId = new IdentityProxy("vpc_offerings");
+
+    @SerializedName(ApiConstants.CREATED) @Param(description="the date this VPC was created")
+    private Date created;
+
+    @SerializedName(ApiConstants.ACCOUNT) @Param(description="the owner of the VPC")
+    private String accountName;
+
+    @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the VPC")
+    private IdentityProxy projectId = new IdentityProxy("projects");
+
+    @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the VPC")
+    private String projectName;
+
+    @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the VPC owner")
+    private IdentityProxy domainId = new IdentityProxy("domain");
+
+    @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the owner")
+    private String domain;
+
+    @SerializedName(ApiConstants.NETWORK) @Param(description="the list of networks belongign to the VPC", responseObject = NetworkResponse.class)
+    private List<NetworkResponse> networks;
+
+    @SerializedName(ApiConstants.RESTART_REQUIRED) @Param(description="true VPC requires restart")
+    private Boolean restartRequired;
+
+    @SerializedName(ApiConstants.NETWORK_DOMAIN) @Param(description="the network domain of the VPC")
+    private String networkDomain;
+
+    @SerializedName(ApiConstants.TAGS)  @Param(description="the list of resource tags associated with the project", responseObject = ResourceTagResponse.class)
+    private List<ResourceTagResponse> tags;
+
+    public void setId(Long id) {
+        this.id.setValue(id);
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setDisplayText(String displayText) {
+        this.displayText = displayText;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public void setServices(List<ServiceResponse> services) {
+        this.services = services;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    @Override
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    @Override
+    public void setProjectId(Long projectId) {
+        this.projectId.setValue(projectId);
+    }
+
+    @Override
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    @Override
+    public void setDomainId(Long domainId) {
+        this.domainId.setValue(domainId);
+    }
+
+    @Override
+    public void setDomainName(String domainName) {
+        this.domain = domainName;
+    }
+
+    public void setZoneId(Long zoneId) {
+        this.zoneId.setValue(zoneId);
+    }
+
+    public void setCidr(String cidr) {
+        this.cidr = cidr;
+    }
+
+    public void setVpcOfferingId(Long vpcOfferingId) {
+        this.vpcOfferingId.setValue(vpcOfferingId);
+    }
+
+    public List<NetworkResponse> getNetworks() {
+        return networks;
+    }
+
+    public void setNetworks(List<NetworkResponse> networks) {
+        this.networks = networks;
+    }
+
+    public void setRestartRequired(Boolean restartRequired) {
+        this.restartRequired = restartRequired;
+    }
+
+    public void setNetworkDomain(String networkDomain) {
+        this.networkDomain = networkDomain;
+    }
+
+    public void setZoneName(String zoneName) {
+        this.zoneName = zoneName;
+    }
+
+    public void setTags(List<ResourceTagResponse> tags) {
+        this.tags = tags;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
new file mode 100644
index 0000000..d1f45de
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
@@ -0,0 +1,79 @@
+// 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.response;
+
+import org.apache.cloudstack.api.ApiConstants;
+import com.cloud.utils.IdentityProxy;
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+@SuppressWarnings("unused")
+public class VpnUsersResponse extends BaseResponse implements ControlledEntityResponse{
+    @SerializedName(ApiConstants.ID) @Param(description="the vpn userID")
+    private IdentityProxy id = new IdentityProxy("vpn_users");
+
+    @SerializedName(ApiConstants.USERNAME) @Param(description="the username of the vpn user")
+    private String userName;
+
+    @SerializedName(ApiConstants.ACCOUNT) @Param(description="the account of the remote access vpn")
+    private String accountName;
+
+    @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the account of the remote access vpn")
+    private IdentityProxy domainId = new IdentityProxy("domain");
+
+    @SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the account of the remote access vpn")
+    private String domainName;
+
+    @SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
+    private IdentityProxy projectId = new IdentityProxy("projects");
+
+    @SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
+    private String projectName;
+
+
+    public void setId(Long id) {
+        this.id.setValue(id);
+    }
+
+    public void setUserName(String name) {
+        this.userName = name;
+    }
+
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    public void setDomainId(Long domainId) {
+        this.domainId.setValue(domainId);
+    }
+
+    public void setDomainName(String name) {
+        this.domainName = name;
+    }
+
+    @Override
+    public void setProjectId(Long projectId) {
+        this.projectId.setValue(projectId);
+    }
+
+    @Override
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ZoneResponse.java b/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
new file mode 100644
index 0000000..22ab827
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
@@ -0,0 +1,179 @@
+// 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.response;
+
+import java.util.List;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.Entity;
+import com.cloud.dc.DataCenter;
+import com.cloud.utils.IdentityProxy;
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+
+@SuppressWarnings("unused")
+@Entity(value = DataCenter.class)
+public class ZoneResponse extends BaseResponse {
+    @SerializedName(ApiConstants.ID) @Param(description="Zone id")
+    private IdentityProxy id = new IdentityProxy("data_center");
+
+    @SerializedName(ApiConstants.NAME) @Param(description="Zone name")
+    private String name;
+
+    @SerializedName(ApiConstants.DESCRIPTION) @Param(description="Zone description")
+    private String description;
+
+    @SerializedName(ApiConstants.DNS1) @Param(description="the first DNS for the Zone")
+    private String dns1;
+
+    @SerializedName(ApiConstants.DNS2) @Param(description="the second DNS for the Zone")
+    private String dns2;
+
+    @SerializedName(ApiConstants.INTERNAL_DNS1) @Param(description="the first internal DNS for the Zone")
+    private String internalDns1;
+
+    @SerializedName(ApiConstants.INTERNAL_DNS2) @Param(description="the second internal DNS for the Zone")
+    private String internalDns2;
+
+    @SerializedName(ApiConstants.VLAN) @Param(description="the vlan range of the zone")
+    private String vlan;
+
+    @SerializedName(ApiConstants.GUEST_CIDR_ADDRESS) @Param(description="the guest CIDR address for the Zone")
+    private String guestCidrAddress;
+
+    //TODO - generate description
+    @SerializedName("status")
+    private String status;
+
+    @SerializedName(ApiConstants.DISPLAY_TEXT) @Param(description="the display text of the zone")
+    private String displayText;
+
+    @SerializedName(ApiConstants.DOMAIN) @Param(description="Network domain name for the networks in the zone")
+    private String domain;
+
+    @SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the containing domain, null for public zones")
+    private Long domainId;
+
+    @SerializedName("domainname") @Param(description="the name of the containing domain, null for public zones")
+    private String domainName;
+
+    @SerializedName(ApiConstants.NETWORK_TYPE) @Param(description="the network type of the zone; can be Basic or Advanced")
+    private String networkType;
+
+    @SerializedName("securitygroupsenabled") @Param(description="true if security groups support is enabled, false otherwise")
+    private boolean securityGroupsEnabled;
+
+    @SerializedName("allocationstate") @Param(description="the allocation state of the cluster")
+    private String allocationState;
+
+    @SerializedName(ApiConstants.ZONE_TOKEN) @Param(description="Zone Token")
+    private String zoneToken;
+
+    @SerializedName(ApiConstants.DHCP_PROVIDER) @Param(description="the dhcp Provider for the Zone")
+    private String dhcpProvider;
+
+    @SerializedName("capacity")  @Param(description="the capacity of the Zone", responseObject = CapacityResponse.class)
+    private List<CapacityResponse> capacitites;
+
+    @SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
+    private boolean localStorageEnabled;
+
+    public void setId(Long id) {
+        this.id.setValue(id);
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public void setDns1(String dns1) {
+        this.dns1 = dns1;
+    }
+
+    public void setDns2(String dns2) {
+        this.dns2 = dns2;
+    }
+
+    public void setInternalDns1(String internalDns1) {
+        this.internalDns1 = internalDns1;
+    }
+
+    public void setInternalDns2(String internalDns2) {
+        this.internalDns2 = internalDns2;
+    }
+
+    public void setVlan(String vlan) {
+        this.vlan = vlan;
+    }
+
+    public void setGuestCidrAddress(String guestCidrAddress) {
+        this.guestCidrAddress = guestCidrAddress;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public void setDisplayText(String displayText) {
+        this.displayText = displayText;
+    }
+
+    public void setDomain(String domain) {
+        this.domain = domain;
+    }
+
+    public void setDomainId(Long domainId) {
+        this.domainId = domainId;
+    }
+
+    public void setType(String networkType) {
+        this.networkType = networkType;
+    }
+
+    public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {
+        this.securityGroupsEnabled = securityGroupsEnabled;
+    }
+
+    public void setAllocationState(String allocationState) {
+        this.allocationState = allocationState;
+    }
+
+    public void setZoneToken(String zoneToken) {
+        this.zoneToken = zoneToken;
+    }
+
+    public void setDhcpProvider(String dhcpProvider) {
+        this.dhcpProvider = dhcpProvider;
+    }
+
+    public void setCapacitites(List<CapacityResponse> capacitites) {
+        this.capacitites = capacitites;
+    }
+
+    public void setDomainName(String domainName) {
+        this.domainName = domainName;
+    }
+
+    public void setLocalStorageEnabled(boolean localStorageEnabled) {
+        this.localStorageEnabled = localStorageEnabled;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
deleted file mode 100644
index 2cf9e8c..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
+++ /dev/null
@@ -1,462 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ACL;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCreateCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-
-import com.cloud.api.response.DiskOfferingResponse;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.NetworkResponse;
-import com.cloud.api.response.ProjectAccountResponse;
-import com.cloud.api.response.SecurityGroupResponse;
-import com.cloud.api.response.ServiceOfferingResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.api.response.ZoneResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.dc.DataCenter;
-import com.cloud.dc.DataCenter.NetworkType;
-import com.cloud.domain.Domain;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.network.IpAddress;
-import com.cloud.network.Network;
-import com.cloud.network.security.SecurityGroup;
-import com.cloud.offering.DiskOffering;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-
-@Implementation(description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject=UserVmResponse.class)
-public class DeployVMCmd extends BaseAsyncCreateCmd {
-    public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName());
-
-    private static final String s_name = "deployvirtualmachineresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    //@IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine", entityType=ZoneResponse.class)
-    private Long zoneId;
-
-    @ACL
-    //@IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine", resourceType=ServiceOffering.class, entityType=ServiceOfferingResponse.class)
-    private Long serviceOfferingId;
-
-    @ACL
-    //@IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine", entityType=TemplateResponse.class)
-    private Long templateId;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="host name for the virtual machine")
-    private String name;
-
-    @Parameter(name=ApiConstants.DISPLAY_NAME, type=CommandType.STRING, description="an optional user generated name for the virtual machine")
-    private String displayName;
-
-    //Owner information
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.")
-    private String accountName;
-
-    //@IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.", entityType=DomainResponse.class)
-    private Long domainId;
-
-    //Network information
-    @ACL
-    //@IdentityMapper(entityTableName="networks")
-    @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter", entityType=NetworkResponse.class)
-    private List<Long> networkIds;
-
-    //DataDisk information
-    @ACL
-    //@IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.", entityType=DiskOfferingResponse.class)
-    private Long diskOfferingId;
-
-    @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId")
-    private Long size;
-
-    @Parameter(name=ApiConstants.GROUP, type=CommandType.STRING, description="an optional group for the virtual machine")
-    private String group;
-
-    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine")
-    private String hypervisor;
-
-    @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. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.", length=2048)
-    private String userData;
-
-    @Parameter(name=ApiConstants.SSH_KEYPAIR, type=CommandType.STRING, description="name of the ssh key pair used to login to the virtual machine")
-    private String sshKeyPairName;
-
-
-    //@IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", entityType=HostResponse.class)
-    private Long hostId;
-
-    @ACL
-    //@IdentityMapper(entityTableName="security_group")
-    @Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter", resourceType=SecurityGroup.class, entityType=SecurityGroupResponse.class)
-    private List<Long> securityGroupIdList;
-
-    @ACL
-    @Parameter(name=ApiConstants.SECURITY_GROUP_NAMES, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of security groups names that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter", resourceType=SecurityGroup.class)
-    private List<String> securityGroupNameList;
-
-    @ACL(checkKeyAccess=true)
-    @Parameter(name = ApiConstants.IP_NETWORK_LIST, type = CommandType.MAP, description = "ip to network mapping. Can't be specified with networkIds parameter. Example: iptonetworklist[0].ip=10.10.10.11&iptonetworklist[0].networkid=204 - requests to use ip 10.10.10.11 in network id=204",resourceType={Network.class,IpAddress.class})
-    private Map ipToNetworkList;
-
-    @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="the ip address for default vm's network")
-    private String ipAddress;
-
-    @Parameter(name=ApiConstants.KEYBOARD, type=CommandType.STRING, description="an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us")
-    private String keyboard;
-
-    //@IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project", entityType=ProjectAccountResponse.class)
-    private Long projectId;
-
-    @Parameter(name=ApiConstants.START_VM, type=CommandType.BOOLEAN, description="true if network offering supports specifying ip ranges; defaulted to true if not specified")
-    private Boolean startVm;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getEntityTable() {
-        return "vm_instance";
-    }
-
-    public String getAccountName() {
-        if (accountName == null) {
-            return UserContext.current().getCaller().getAccountName();
-        }
-        return accountName;
-    }
-
-    public Long getDiskOfferingId() {
-        return diskOfferingId;
-    }
-
-    public String getDisplayName() {
-        return displayName;
-    }
-
-    public Long getDomainId() {
-        if (domainId == null) {
-            return UserContext.current().getCaller().getDomainId();
-        }
-        return domainId;
-    }
-
-    public String getGroup() {
-        return group;
-    }
-
-    public HypervisorType getHypervisor() {
-        return HypervisorType.getType(hypervisor);
-    }
-
-    public List<Long> getSecurityGroupIdList() {
-        if (securityGroupNameList != null && securityGroupIdList != null) {
-            throw new InvalidParameterValueException("securitygroupids parameter is mutually exclusive with securitygroupnames parameter");
-        }
-
-       //transform group names to ids here
-       if (securityGroupNameList != null) {
-            List<Long> securityGroupIds = new ArrayList<Long>();
-            for (String groupName : securityGroupNameList) {
-                Long groupId = _responseGenerator.getSecurityGroupId(groupName, getEntityOwnerId());
-                if (groupId == null) {
-                    throw new InvalidParameterValueException("Unable to find group by name " + groupName + " for account " + getEntityOwnerId());
-                } else {
-                    securityGroupIds.add(groupId);
-                }
-            }
-            return securityGroupIds;
-        } else {
-            return securityGroupIdList;
-        }
-    }
-
-    public Long getServiceOfferingId() {
-        return serviceOfferingId;
-    }
-
-    public Long getSize() {
-        return size;
-    }
-
-    public Long getTemplateId() {
-        return templateId;
-    }
-
-    public String getUserData() {
-        return userData;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public List<Long> getNetworkIds() {
-       if (ipToNetworkList != null) {
-           if (networkIds != null || ipAddress != null) {
-               throw new InvalidParameterValueException("ipToNetworkMap can't be specified along with networkIds or ipAddress");
-           } else {
-               List<Long> networks = new ArrayList<Long>();
-               networks.addAll(getIpToNetworkMap().keySet());
-               return networks;
-           }
-       }
-        return networkIds;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getSSHKeyPairName() {
-        return sshKeyPairName;
-    }
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public boolean getStartVm() {
-        return startVm == null ? true : startVm;
-    }
-
-    private Map<Long, String> getIpToNetworkMap() {
-        if ((networkIds != null || ipAddress != null) && ipToNetworkList != null) {
-            throw new InvalidParameterValueException("NetworkIds and ipAddress can't be specified along with ipToNetworkMap parameter");
-        }
-        LinkedHashMap<Long, String> ipToNetworkMap = null;
-        if (ipToNetworkList != null && !ipToNetworkList.isEmpty()) {
-            ipToNetworkMap = new LinkedHashMap<Long, String>();
-            Collection ipsCollection = ipToNetworkList.values();
-            Iterator iter = ipsCollection.iterator();
-            while (iter.hasNext()) {
-                HashMap<String, String> ips = (HashMap<String, String>) iter.next();
-                Long networkId = Long.valueOf(_responseGenerator.getIdentiyId("networks", ips.get("networkid")));
-                String requestedIp = (String) ips.get("ip");
-                ipToNetworkMap.put(networkId, requestedIp);
-            }
-        }
-
-        return ipToNetworkMap;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public static String getResultObjectName() {
-        return "virtualmachine";
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
-        if (accountId == null) {
-            return UserContext.current().getCaller().getId();
-        }
-
-        return accountId;
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_CREATE;
-    }
-
-    @Override
-    public String getCreateEventType() {
-        return EventTypes.EVENT_VM_CREATE;
-    }
-
-    @Override
-    public String getCreateEventDescription() {
-        return "creating Vm";
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "starting Vm. Vm Id: "+getEntityId();
-    }
-
-    @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.VirtualMachine;
-    }
-
-    @Override
-    public void execute(){
-        UserVm result;
-
-        if (getStartVm()) {
-            try {
-                UserContext.current().setEventDetails("Vm Id: "+getEntityId());
-                if (getHypervisor() == HypervisorType.BareMetal) {
-                    result = _bareMetalVmService.startVirtualMachine(this);
-                } else {
-                    result = _userVmService.startVirtualMachine(this);
-                }
-            } catch (ResourceUnavailableException ex) {
-                s_logger.warn("Exception: ", ex);
-                throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
-            } catch (ConcurrentOperationException ex) {
-                s_logger.warn("Exception: ", ex);
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-            } catch (InsufficientCapacityException ex) {
-                s_logger.info(ex);
-                s_logger.trace(ex);
-                throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
-            }
-        } else {
-            result = _userVmService.getUserVm(getEntityId());
-        }
-
-        if (result != null) {
-            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to deploy vm");
-        }
-    }
-
-    @Override
-    public void create() throws ResourceAllocationException{
-        try {
-            //Verify that all objects exist before passing them to the service
-            Account owner = _accountService.getActiveAccountById(getEntityOwnerId());
-
-            DataCenter zone = _configService.getZone(zoneId);
-            if (zone == null) {
-                throw new InvalidParameterValueException("Unable to find zone by id=" + zoneId);
-            }
-
-            ServiceOffering serviceOffering = _configService.getServiceOffering(serviceOfferingId);
-            if (serviceOffering == null) {
-                throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
-            }
-
-            VirtualMachineTemplate template = _templateService.getTemplate(templateId);
-            // Make sure a valid template ID was specified
-            if (template == null) {
-                throw new InvalidParameterValueException("Unable to use template " + templateId);
-            }
-
-            DiskOffering diskOffering = null;
-            if (diskOfferingId != null) {
-                diskOffering = _configService.getDiskOffering(diskOfferingId);
-                if (diskOffering == null) {
-                    throw new InvalidParameterValueException("Unable to find disk offering " + diskOfferingId);
-                }
-            }
-
-            if (!zone.isLocalStorageEnabled()) {
-                if (serviceOffering.getUseLocalStorage()) {
-                    throw new InvalidParameterValueException("Zone is not configured to use local storage but service offering " + serviceOffering.getName() + " uses it");
-                }
-                if (diskOffering != null && diskOffering.getUseLocalStorage()) {
-                    throw new InvalidParameterValueException("Zone is not configured to use local storage but disk offering " + diskOffering.getName() + " uses it");
-                }
-            }
-
-            UserVm vm = null;
-            if (getHypervisor() == HypervisorType.BareMetal) {
-                vm = _bareMetalVmService.createVirtualMachine(this);
-            } else {
-                if (zone.getNetworkType() == NetworkType.Basic) {
-                    if (getNetworkIds() != null) {
-                        throw new InvalidParameterValueException("Can't specify network Ids in Basic zone");
-                    } else {
-                        vm = _userVmService.createBasicSecurityGroupVirtualMachine(zone, serviceOffering, template, getSecurityGroupIdList(), owner, name,
-                                displayName, diskOfferingId, size, group, getHypervisor(), userData, sshKeyPairName, getIpToNetworkMap(), ipAddress, keyboard);
-                    }
-                } else {
-                    if (zone.isSecurityGroupEnabled())  {
-                        vm = _userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, template, getNetworkIds(), getSecurityGroupIdList(),
-                                owner, name, displayName, diskOfferingId, size, group, getHypervisor(), userData, sshKeyPairName, getIpToNetworkMap(), ipAddress, keyboard);
-                    } else {
-                        if (getSecurityGroupIdList() != null && !getSecurityGroupIdList().isEmpty()) {
-                            throw new InvalidParameterValueException("Can't create vm with security groups; security group feature is not enabled per zone");
-                        }
-                        vm = _userVmService.createAdvancedVirtualMachine(zone, serviceOffering, template, getNetworkIds(), owner, name, displayName,
-                                diskOfferingId, size, group, getHypervisor(), userData, sshKeyPairName, getIpToNetworkMap(), ipAddress, keyboard);
-                    }
-                }
-            }
-
-            if (vm != null) {
-                setEntityId(vm.getId());
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to deploy vm");
-            }
-        } catch (InsufficientCapacityException ex) {
-            s_logger.info(ex);
-            s_logger.trace(ex);
-            throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
-        } catch (ResourceUnavailableException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
-        }  catch (ConcurrentOperationException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
deleted file mode 100644
index 06c3c0d..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
+++ /dev/null
@@ -1,115 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-@Implementation(description="Destroys a virtual machine. Once destroyed, only the administrator can recover it.", responseObject=UserVmResponse.class)
-public class DestroyVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(DestroyVMCmd.class.getName());
-
-    private static final String s_name = "destroyvirtualmachineresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    //@IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        UserVm vm = _responseGenerator.findUserVmById(getId());
-        if (vm != null) {
-            return vm.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_DESTROY;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "destroying vm: " + getId();
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.VirtualMachine;
-    }
-
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, ConcurrentOperationException{
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        UserVm result;
-        if (_userVmService.getHypervisorTypeOfUserVM(getId()) == HypervisorType.BareMetal) {
-            result = _bareMetalVmService.destroyVm(this);
-        } else {
-            result = _userVmService.destroyVm(this);
-        }
-
-        if (result != null) {
-            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
-            response.setResponseName("virtualmachine");
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy vm");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
deleted file mode 100644
index ee8eee4..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import java.security.InvalidParameterException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import com.cloud.api.response.GetVMPasswordResponse;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.user.Account;
-import com.cloud.uservm.UserVm;
-
-@Implementation(responseObject=GetVMPasswordResponse.class, description="Returns an encrypted password for the VM")
-public class GetVMPasswordCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(GetVMPasswordCmd.class.getName());
-    private static final String s_name = "getvmpasswordresponse";
-
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    //@IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
-    private Long id;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute() {
-        String passwd = _mgr.getVMPassword(this);
-        if (passwd == null || passwd.equals(""))
-            throw new InvalidParameterException("No password for VM with id '" + getId() + "' found.");
-
-        this.setResponseObject(new GetVMPasswordResponse(getCommandName(), passwd));
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        UserVm userVm = _entityMgr.findById(UserVm.class, getId());
-        if (userVm != null) {
-            return userVm.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
deleted file mode 100644
index 335a326..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
+++ /dev/null
@@ -1,221 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiConstants.VMDetails;
-import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.InstanceGroupResponse;
-import com.cloud.api.response.IsoVmResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.NetworkResponse;
-import com.cloud.api.response.PodResponse;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.api.response.VpcResponse;
-import com.cloud.api.response.ZoneResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.utils.Pair;
-import com.cloud.api.view.vo.UserVmJoinVO;
-
-
-@Implementation(description="List the virtual machines owned by the account.", responseObject=UserVmResponse.class)
-public class ListVMsCmd extends BaseListTaggedResourcesCmd {
-    public static final Logger s_logger = Logger.getLogger(ListVMsCmd.class.getName());
-
-    private static final String s_name = "listvirtualmachinesresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    //@IdentityMapper(entityTableName="instance_group")
-    @Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID", entityType=InstanceGroupResponse.class)
-    private Long groupId;
-
-    //@IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID", entityType=HostResponse.class)
-    private Long hostId;
-
-    //@IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine", entityType=UserVmResponse.class)
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the virtual machine")
-    private String instanceName;
-
-    //@IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID", entityType=PodResponse.class)
-    private Long podId;
-
-    @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="state of the virtual machine")
-    private String state;
-
-    //@IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID", entityType=ZoneResponse.class)
-    private Long zoneId;
-
-    @Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="list by network type; true if need to list vms using Virtual Network, false otherwise")
-    private Boolean forVirtualNetwork;
-
-    //@IdentityMapper(entityTableName="networks")
-    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="list by network id", entityType=NetworkResponse.class)
-    private Long networkId;
-
-    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the target hypervisor for the template")
-    private String hypervisor;
-
-    //@IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to", entityType=StoragePoolResponse.class)
-    private Long storageId;
-
-    @Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, " +
-            "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]. If no parameter is passed in, the details will be defaulted to all" )
-    private List<String> viewDetails;
-
-    //@IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="list vms by template", entityType=TemplateResponse.class)
-    private Long templateId;
-
-    //@IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso", entityType=IsoVmResponse.class)
-    private Long isoId;
-
-    //@IdentityMapper(entityTableName="vpc")
-    @Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc", entityType=VpcResponse.class)
-    private Long vpcId;
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getGroupId() {
-        return groupId;
-    }
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getInstanceName() {
-        return instanceName;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getState() {
-        return state;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-
-    public Boolean getForVirtualNetwork() {
-        return forVirtualNetwork;
-    }
-
-    public void setForVirtualNetwork(Boolean forVirtualNetwork) {
-        this.forVirtualNetwork = forVirtualNetwork;
-    }
-
-    public Long getNetworkId() {
-        return networkId;
-    }
-
-    public String getHypervisor() {
-        return hypervisor;
-    }
-
-    public Long getStorageId() {
-        return storageId;
-    }
-
-    public Long getTemplateId() {
-        return templateId;
-    }
-
-    public Long getIsoId() {
-        return isoId;
-    }
-
-    public Long getVpcId(){
-        return vpcId;
-    }
-
-    public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
-        EnumSet<VMDetails> dv;
-        if (viewDetails==null || viewDetails.size() <=0){
-            dv = EnumSet.of(VMDetails.all);
-        }
-        else {
-            try {
-                ArrayList<VMDetails> dc = new ArrayList<VMDetails>();
-                for (String detail: viewDetails){
-                    dc.add(VMDetails.valueOf(detail));
-                }
-                dv = EnumSet.copyOf(dc);
-            }
-            catch (IllegalArgumentException e){
-                throw new InvalidParameterValueException("The details parameter contains a non permitted value. The allowed values are " + EnumSet.allOf(VMDetails.class));
-            }
-        }
-        return dv;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.VirtualMachine;
-    }
-
-    @Override
-    public void execute(){
-        Pair<List<UserVmJoinVO>, Integer> result = _userVmService.searchForUserVMs(this);
-        ListResponse<UserVmResponse> response = new ListResponse<UserVmResponse>();
-        EnumSet<VMDetails> details = getDetails();
-        List<UserVmResponse> vmResponses = _responseGenerator.createUserVmResponse("virtualmachine", getDetails(), result.first().toArray(new UserVmJoinVO[result.first().size()]));
-        response.setResponses(vmResponses, result.second());
-        response.setResponseName(getCommandName());
-        this.setResponseObject(response);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
deleted file mode 100644
index 45ed4ee..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-@Implementation(description="Reboots a virtual machine.", responseObject=UserVmResponse.class)
-public class RebootVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RebootVMCmd.class.getName());
-    private static final String s_name = "rebootvirtualmachineresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        UserVm vm = _responseGenerator.findUserVmById(getId());
-        if (vm != null) {
-            return vm.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_REBOOT;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "rebooting user vm: " + getId();
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.VirtualMachine;
-    }
-
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        UserVm result;
-        if (_userVmService.getHypervisorTypeOfUserVM(getId()) == HypervisorType.BareMetal) {
-            result = _bareMetalVmService.rebootVirtualMachine(this);
-        } else {
-            result = _userVmService.rebootVirtualMachine(this);
-        }
-
-        if (result !=null){
-            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reboot vm instance");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
deleted file mode 100644
index c41c51f..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
+++ /dev/null
@@ -1,123 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-@Implementation(responseObject=UserVmResponse.class, description="Resets the password for virtual machine. " +
-                                                                                    "The virtual machine must be in a \"Stopped\" state and the template must already " +
-                                                                                    "support this feature for this command to take effect. [async]")
-public class ResetVMPasswordCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ResetVMPasswordCmd.class.getName());
-
-    private static final String s_name = "resetpasswordforvirtualmachineresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
-    private Long id;
-
-    // unexposed parameter needed for serializing/deserializing the command
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, expose=false)
-    private String password;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        UserVm vm = _responseGenerator.findUserVmById(getId());
-        if (vm != null) {
-            return vm.getAccountId();
-        }
-
-        return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_RESETPASSWORD;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return  "resetting password for vm: " + getId();
-    }
-
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.VirtualMachine;
-    }
-
-    public Long getInstanceId() {
-        return getId();
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
-        password = _mgr.generateRandomPassword();
-        UserContext.current().setEventDetails("Vm Id: "+getId());
-        UserVm result = _userVmService.resetVMPassword(this, password);
-        if (result != null){
-            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to reset vm password");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e398b1e4/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
deleted file mode 100644
index 926362f..0000000
--- a/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
+++ /dev/null
@@ -1,90 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.user.vm.command;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-@Implementation(description="Restore a VM to original template or specific snapshot", responseObject=UserVmResponse.class, since="3.0.0")
-public class RestoreVMCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(RestoreVMCmd.class);
-    private static final String s_name = "restorevmresponse";
-
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID", entityType=UserVmResponse.class)
-    private Long vmId;
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_VM_RESTORE;
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "Restore a VM to orignal template or specific snapshot";
-    }
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
-            ResourceAllocationException {
-        UserVm result;
-        UserContext.current().setEventDetails("Vm Id: " + getVmId());
-        result = _userVmService.restoreVM(this);
-        if (result != null) {
-            UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to restore vm " + getVmId());
-        }
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        UserVm vm = _responseGenerator.findUserVmById(getVmId());
-        if (vm == null) {
-             return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked
-        }
-        return vm.getAccountId();
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-}


Mime
View raw message