api: Annotate admin apis related to traffic type for usage

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-22 17:19:56 -08:00
parent 9a3deaf807
commit f3f0962df2
5 changed files with 14 additions and 13 deletions

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
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;
@ -43,8 +43,8 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_network")
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
required=true, description="the Physical Network ID")
private Long physicalNetworkId;
@Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, required=true, description="the trafficType to be added to the physical network")

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
import org.apache.cloudstack.api.response.TrafficTypeResponse;
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;
@ -39,8 +39,8 @@ public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_network_traffic_types")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="traffic type id")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TrafficTypeResponse.class,
required=true, description="traffic type id")
private Long id;

View File

@ -19,11 +19,11 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.ArrayList;
import java.util.List;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.IdentityMapper;
import org.apache.cloudstack.api.Implementation;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
@ -33,7 +33,6 @@ import com.cloud.network.PhysicalNetworkTrafficType;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
@Implementation(description="Lists traffic types of a given physical network.", responseObject=ProviderResponse.class, since="3.0.0")
public class ListTrafficTypesCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListTrafficTypesCmd.class.getName());
@ -42,8 +41,8 @@ public class ListTrafficTypesCmd extends BaseListCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_network")
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
required=true, description="the Physical Network ID")
private Long physicalNetworkId;
/////////////////////////////////////////////////////

View File

@ -21,7 +21,6 @@ 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;
@ -41,8 +40,8 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_network_traffic_types")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="traffic type id")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TrafficTypeResponse.class,
required=true, description="traffic type id")
private Long id;
@Parameter(name=ApiConstants.XEN_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a XenServer host")

View File

@ -16,11 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
import com.cloud.network.PhysicalNetworkTrafficType;
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;
@Entity(value=PhysicalNetworkTrafficType.class)
public class TrafficTypeResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="id of the network provider")