api: Annotate Network device,offering,service apis

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-18 14:56:27 -08:00
parent 275208e175
commit a6ce3b5450
5 changed files with 14 additions and 14 deletions

View File

@ -20,11 +20,11 @@ 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 org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@ -44,11 +44,10 @@ public class DeleteNetworkDeviceCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="host")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required=true, description = "Id of network device to delete")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = HostResponse.class,
required=true, description = "Id of network device to delete")
private Long id;
public Long getId() {
return id;
}

View File

@ -20,10 +20,10 @@ 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 org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.user.Account;
@ -36,11 +36,10 @@ public class DeleteNetworkOfferingCmd extends BaseCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="network_offerings")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the network offering")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = NetworkOfferingResponse.class,
required=true, description="the ID of the network offering")
private Long id;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////

View File

@ -21,10 +21,10 @@ 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 org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
@ -42,11 +42,10 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_network_service_providers")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the network service provider")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=PhysicalNetworkResponse.class,
required=true, description="the ID of the network service provider")
private Long id;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -55,7 +54,6 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
return id;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

View File

@ -19,12 +19,15 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import java.util.List;
import com.cloud.offering.NetworkOffering;
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;
@Entity(value=NetworkOffering.class)
@SuppressWarnings("unused")
public class NetworkOfferingResponse extends BaseResponse {
@SerializedName("id") @Param(description="the id of the network offering")

View File

@ -19,6 +19,7 @@ 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.utils.IdentityProxy;
import com.cloud.serializer.Param;
@ -26,7 +27,7 @@ import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
@Entity(value=PhysicalNetwork.class)
@Entity(value={PhysicalNetwork.class, PhysicalNetworkServiceProvider.class})
@SuppressWarnings("unused")
public class PhysicalNetworkResponse extends BaseResponse {