mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Rename @Entity to @EntityReference used in Response classes
- Renames to @EntityReference as @Entity is too general and used in javax's pkg - Remove redundant imports Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
057ac12d23
commit
a18464dbe5
@ -19,10 +19,10 @@ package org.apache.cloudstack.api;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/* There is a one on one mapping between the Entity and the EntityResponse
|
||||
/* There is a one on one mapping between the EntityReference and the EntityResponse
|
||||
* to the OTW layer. Value is the actual entity class it refers to.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Entity {
|
||||
public @interface EntityReference {
|
||||
Class[] value() default {};
|
||||
}
|
||||
@ -20,16 +20,15 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.user.Account;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value = Account.class)
|
||||
@EntityReference(value = Account.class)
|
||||
public class AccountResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the account")
|
||||
private String id;
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Alert.class)
|
||||
@EntityReference(value=Alert.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class AlertResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the alert")
|
||||
|
||||
@ -20,13 +20,13 @@ import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import org.apache.cloudstack.api.ResponseObject;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@Entity(value=AsyncJob.class)
|
||||
@EntityReference(value=AsyncJob.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class AsyncJobResponse extends BaseResponse {
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Entity(value=AutoScalePolicy.class)
|
||||
@EntityReference(value=AutoScalePolicy.class)
|
||||
public class AutoScalePolicyResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -18,15 +18,14 @@ package org.apache.cloudstack.api.response;
|
||||
|
||||
import com.cloud.network.as.AutoScaleVmGroup;
|
||||
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;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Entity(value=AutoScaleVmGroup.class)
|
||||
@EntityReference(value=AutoScaleVmGroup.class)
|
||||
public class AutoScaleVmGroupResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -24,13 +24,13 @@ import com.cloud.network.as.AutoScaleVmProfile;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseCmd.CommandType;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@Entity(value=AutoScaleVmProfile.class)
|
||||
@EntityReference(value=AutoScaleVmProfile.class)
|
||||
public class AutoScaleVmProfileResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -20,16 +20,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
@Entity(value = Cluster.class)
|
||||
@EntityReference(value = Cluster.class)
|
||||
public class ClusterResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the cluster ID")
|
||||
private String id;
|
||||
|
||||
@ -24,9 +24,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Condition.class)
|
||||
@EntityReference(value=Condition.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ConditionResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName("id")
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
package org.apache.cloudstack.api.response;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.network.as.Counter;
|
||||
import com.cloud.serializer.Param;
|
||||
@ -26,7 +26,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value=Counter.class)
|
||||
@EntityReference(value=Counter.class)
|
||||
public class CounterResponse extends BaseResponse {
|
||||
@SerializedName("id")
|
||||
@Param(description = "the id of the Counter")
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=DiskOffering.class)
|
||||
@EntityReference(value=DiskOffering.class)
|
||||
public class DiskOfferingResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="unique ID of the disk offering")
|
||||
private String id;
|
||||
|
||||
@ -18,13 +18,12 @@ package org.apache.cloudstack.api.response;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@Entity(value = Domain.class)
|
||||
@EntityReference(value = Domain.class)
|
||||
public class DomainResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the domain")
|
||||
private String id;
|
||||
|
||||
@ -27,9 +27,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.vm.VirtualMachine.State;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VirtualMachine.class)
|
||||
@EntityReference(value=VirtualMachine.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class DomainRouterResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the router")
|
||||
|
||||
@ -23,9 +23,9 @@ import com.cloud.event.Event;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Event.class)
|
||||
@EntityReference(value=Event.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class EventResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the event")
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=FirewallRule.class)
|
||||
@EntityReference(value=FirewallRule.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class FirewallRuleResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule")
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=GuestOsCategory.class)
|
||||
@EntityReference(value=GuestOsCategory.class)
|
||||
public class GuestOSCategoryResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the OS category")
|
||||
private String id;
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=GuestOS.class)
|
||||
@EntityReference(value=GuestOS.class)
|
||||
public class GuestOSResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the OS type")
|
||||
private String id;
|
||||
|
||||
@ -19,16 +19,15 @@ package org.apache.cloudstack.api.response;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Host.class)
|
||||
@EntityReference(value=Host.class)
|
||||
public class HostResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the host")
|
||||
private String id;
|
||||
|
||||
@ -22,9 +22,9 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=HypervisorCapabilities.class)
|
||||
@EntityReference(value=HypervisorCapabilities.class)
|
||||
public class HypervisorCapabilitiesResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the hypervisor capabilities row")
|
||||
private String id;
|
||||
|
||||
@ -24,9 +24,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=IpAddress.class)
|
||||
@EntityReference(value=IpAddress.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class IPAddressResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="public IP address id")
|
||||
|
||||
@ -20,14 +20,13 @@ import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
import com.cloud.utils.IdentityProxy;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value = InstanceGroup.class)
|
||||
@EntityReference(value = InstanceGroup.class)
|
||||
public class InstanceGroupResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the instance group")
|
||||
private String id;
|
||||
|
||||
@ -21,11 +21,11 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Entity(value=StickinessPolicy.class)
|
||||
@EntityReference(value=StickinessPolicy.class)
|
||||
public class LBStickinessResponse extends BaseResponse {
|
||||
@SerializedName("lbruleid")
|
||||
@Param(description = "the LB rule ID")
|
||||
|
||||
@ -24,9 +24,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=NetworkOffering.class)
|
||||
@EntityReference(value=NetworkOffering.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class NetworkOfferingResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the id of the network offering")
|
||||
|
||||
@ -21,13 +21,13 @@ import java.util.List;
|
||||
import com.cloud.network.Network;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.projects.ProjectAccount;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value = {Network.class, ProjectAccount.class})
|
||||
@EntityReference(value = {Network.class, ProjectAccount.class})
|
||||
public class NetworkResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the network")
|
||||
|
||||
@ -19,14 +19,13 @@ package org.apache.cloudstack.api.response;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.network.PhysicalNetwork;
|
||||
import com.cloud.network.PhysicalNetworkServiceProvider;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=PhysicalNetwork.class)
|
||||
@EntityReference(value=PhysicalNetwork.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class PhysicalNetworkResponse extends BaseResponse {
|
||||
|
||||
|
||||
@ -19,14 +19,14 @@ package org.apache.cloudstack.api.response;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
@Entity(value = Pod.class)
|
||||
@EntityReference(value = Pod.class)
|
||||
public class PodResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the ID of the Pod")
|
||||
private String id;
|
||||
|
||||
@ -20,9 +20,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VpcGateway.class)
|
||||
@EntityReference(value=VpcGateway.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class PrivateGatewayResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
|
||||
|
||||
@ -20,13 +20,12 @@ import java.util.List;
|
||||
|
||||
import com.cloud.projects.ProjectAccount;
|
||||
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;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=ProjectAccount.class)
|
||||
@EntityReference(value=ProjectAccount.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ProjectAccountResponse extends BaseResponse implements ControlledViewEntityResponse {
|
||||
@SerializedName(ApiConstants.PROJECT_ID)
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=ProjectInvitation.class)
|
||||
@EntityReference(value=ProjectInvitation.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ProjectInvitationResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the invitation")
|
||||
|
||||
@ -22,12 +22,11 @@ import java.util.List;
|
||||
import com.cloud.projects.Project;
|
||||
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;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Project.class)
|
||||
@EntityReference(value=Project.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ProjectResponse extends BaseResponse {
|
||||
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=PhysicalNetworkServiceProvider.class)
|
||||
@EntityReference(value=PhysicalNetworkServiceProvider.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ProviderResponse extends BaseResponse {
|
||||
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=RemoteAccessVpn.class)
|
||||
@EntityReference(value=RemoteAccessVpn.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class RemoteAccessVpnResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
|
||||
|
||||
@ -18,13 +18,12 @@ package org.apache.cloudstack.api.response;
|
||||
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
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;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value = ResourceLimit.class)
|
||||
@EntityReference(value = ResourceLimit.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ResourceLimitResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account of the resource limit")
|
||||
|
||||
@ -21,13 +21,13 @@ import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value = SecurityGroup.class)
|
||||
@EntityReference(value = SecurityGroup.class)
|
||||
public class SecurityGroupResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the security group")
|
||||
|
||||
@ -17,13 +17,13 @@
|
||||
package org.apache.cloudstack.api.response;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.network.security.SecurityGroupRules;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
@Entity(value = SecurityGroupRules.class)
|
||||
@EntityReference(value = SecurityGroupRules.class)
|
||||
public class SecurityGroupRuleResponse extends BaseResponse {
|
||||
@SerializedName("ruleid") @Param(description="the id of the security group rule")
|
||||
private String ruleId;
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Site2SiteCustomerGateway.class)
|
||||
@EntityReference(value=Site2SiteCustomerGateway.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class Site2SiteCustomerGatewayResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the vpn gateway ID")
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Site2SiteVpnConnection.class)
|
||||
@EntityReference(value=Site2SiteVpnConnection.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class Site2SiteVpnConnectionResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the vpn gateway ID")
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Site2SiteVpnGateway.class)
|
||||
@EntityReference(value=Site2SiteVpnGateway.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class Site2SiteVpnGatewayResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the vpn gateway ID")
|
||||
|
||||
@ -20,9 +20,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=SnapshotPolicy.class)
|
||||
@EntityReference(value=SnapshotPolicy.class)
|
||||
public class SnapshotPolicyResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the ID of the snapshot policy")
|
||||
private String id;
|
||||
|
||||
@ -24,9 +24,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.Snapshot;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Snapshot.class)
|
||||
@EntityReference(value=Snapshot.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class SnapshotResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=StaticRoute.class)
|
||||
@EntityReference(value=StaticRoute.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class StaticRouteResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of static route")
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=StorageNetworkIpRange.class)
|
||||
@EntityReference(value=StorageNetworkIpRange.class)
|
||||
public class StorageNetworkIpRangeResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the uuid of storage network IP range.")
|
||||
private String uuid;
|
||||
|
||||
@ -24,9 +24,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=StoragePool.class)
|
||||
@EntityReference(value=StoragePool.class)
|
||||
public class StoragePoolResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the ID of the storage pool")
|
||||
private String id;
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VirtualMachine.class)
|
||||
@EntityReference(value=VirtualMachine.class)
|
||||
public class SystemVmResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the ID of the system VM")
|
||||
private String id;
|
||||
|
||||
@ -23,9 +23,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VirtualMachineTemplate.class)
|
||||
@EntityReference(value=VirtualMachineTemplate.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class TemplatePermissionsResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the template ID")
|
||||
|
||||
@ -26,9 +26,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VirtualMachineTemplate.class)
|
||||
@EntityReference(value=VirtualMachineTemplate.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class TemplateResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the template ID")
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=PhysicalNetworkTrafficType.class)
|
||||
@EntityReference(value=PhysicalNetworkTrafficType.class)
|
||||
public class TrafficTypeResponse extends BaseResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="id of the network provider")
|
||||
|
||||
@ -23,9 +23,9 @@ import com.cloud.serializer.Param;
|
||||
import com.cloud.user.User;
|
||||
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value = User.class)
|
||||
@EntityReference(value = User.class)
|
||||
public class UserResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the user ID")
|
||||
private String id;
|
||||
|
||||
@ -24,13 +24,13 @@ import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value={VirtualMachine.class, UserVm.class, VirtualRouter.class})
|
||||
@EntityReference(value={VirtualMachine.class, UserVm.class, VirtualRouter.class})
|
||||
public class UserVmResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the virtual machine")
|
||||
private String id;
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VirtualRouterProvider.class)
|
||||
@EntityReference(value=VirtualRouterProvider.class)
|
||||
public class VirtualRouterProviderResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the id of the router")
|
||||
private String id;
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Vlan.class)
|
||||
@EntityReference(value=Vlan.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class VlanIpRangeResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the VLAN IP range")
|
||||
|
||||
@ -18,7 +18,6 @@ package org.apache.cloudstack.api.response;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.cloud.storage.Volume;
|
||||
@ -26,9 +25,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Volume.class)
|
||||
@EntityReference(value=Volume.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class VolumeResponse extends BaseResponse implements ControlledViewEntityResponse{
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -24,9 +24,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=VpcOffering.class)
|
||||
@EntityReference(value=VpcOffering.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class VpcOfferingResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the id of the vpc offering")
|
||||
|
||||
@ -24,9 +24,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value=Vpc.class)
|
||||
@EntityReference(value=Vpc.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class VpcResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
@SerializedName("id") @Param(description="the id of the VPC")
|
||||
|
||||
@ -21,9 +21,9 @@ import org.apache.cloudstack.api.ApiConstants;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@Entity(value = VpnUser.class)
|
||||
@EntityReference(value = VpnUser.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class VpnUsersResponse extends BaseResponse implements ControlledEntityResponse{
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the vpn userID")
|
||||
|
||||
@ -20,13 +20,13 @@ import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.Entity;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity(value = DataCenter.class)
|
||||
@EntityReference(value = DataCenter.class)
|
||||
public class ZoneResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="Zone id")
|
||||
private String id;
|
||||
|
||||
@ -540,9 +540,9 @@ public class ApiDispatcher {
|
||||
// APITODO: Find and get rid of all hardcoded params in API Cmds and service layer
|
||||
return -1L;
|
||||
}
|
||||
// There may be multiple entities defined on the @Entity of a Response.class
|
||||
// There may be multiple entities defined on the @EntityReference of a Response.class
|
||||
// UUID CommandType would expect only one entityType, so use the first entityType
|
||||
Class<?>[] entities = annotation.entityType()[0].getAnnotation(Entity.class).value();
|
||||
Class<?>[] entities = annotation.entityType()[0].getAnnotation(EntityReference.class).value();
|
||||
Long internalId = null;
|
||||
// Go through each entity which is an interface to a VO class and get a VO object
|
||||
// Try to getId() for the object using reflection, break on first non-null value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user