Skip to content

Commit eb2a7de

Browse files
committed
api: Annotate start,stop router cmds
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 98b022a commit eb2a7de

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.BaseAsyncCmd;
2323
import org.apache.cloudstack.api.BaseCmd;
24-
import org.apache.cloudstack.api.IdentityMapper;
2524
import org.apache.cloudstack.api.Implementation;
2625
import org.apache.cloudstack.api.Parameter;
2726
import org.apache.cloudstack.api.ServerApiException;
@@ -35,7 +34,6 @@
3534
import com.cloud.user.Account;
3635
import com.cloud.user.UserContext;
3736

38-
3937
@Implementation(responseObject=DomainRouterResponse.class, description="Starts a router.")
4038
public class StartRouterCmd extends BaseAsyncCmd {
4139
public static final Logger s_logger = Logger.getLogger(StartRouterCmd.class.getName());
@@ -46,8 +44,8 @@ public class StartRouterCmd extends BaseAsyncCmd {
4644
//////////////// API parameters /////////////////////
4745
/////////////////////////////////////////////////////
4846

49-
@IdentityMapper(entityTableName="vm_instance")
50-
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the router")
47+
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=DomainRouterResponse.class,
48+
required=true, description="the ID of the router")
5149
private Long id;
5250

5351
/////////////////////////////////////////////////////

api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.BaseAsyncCmd;
2323
import org.apache.cloudstack.api.BaseCmd;
24-
import org.apache.cloudstack.api.IdentityMapper;
2524
import org.apache.cloudstack.api.Implementation;
2625
import org.apache.cloudstack.api.Parameter;
2726
import org.apache.cloudstack.api.ServerApiException;
@@ -43,8 +42,8 @@ public class StopRouterCmd extends BaseAsyncCmd {
4342
// ////////////// API parameters /////////////////////
4443
// ///////////////////////////////////////////////////
4544

46-
@IdentityMapper(entityTableName="vm_instance")
47-
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the router")
45+
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DomainRouterResponse.class,
46+
required = true, description = "the ID of the router")
4847
private Long id;
4948

5049
@Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.")

api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
import java.util.Set;
2222

2323

24+
import com.cloud.vm.VirtualMachine;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import com.cloud.serializer.Param;
2627
import com.cloud.vm.VirtualMachine.State;
2728
import com.google.gson.annotations.SerializedName;
2829
import org.apache.cloudstack.api.BaseResponse;
30+
import org.apache.cloudstack.api.Entity;
2931

32+
@Entity(value=VirtualMachine.class)
3033
@SuppressWarnings("unused")
3134
public class DomainRouterResponse extends BaseResponse implements ControlledViewEntityResponse{
3235
@SerializedName(ApiConstants.ID) @Param(description="the id of the router")

0 commit comments

Comments
 (0)