Skip to content

Commit 4dd5f14

Browse files
committed
f5: Annotate f5 cmd classes, remove IdentityMapper
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 4cf0b05 commit 4dd5f14

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

plugins/network-elements/f5/src/com/cloud/api/commands/ConfigureF5LoadBalancerCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class ConfigureF5LoadBalancerCmd extends BaseAsyncCmd {
4444
//////////////// API parameters /////////////////////
4545
/////////////////////////////////////////////////////
4646

47-
@IdentityMapper(entityTableName="external_load_balancer_devices")
48-
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required=true, description="F5 load balancer device ID")
47+
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
48+
required=true, description="F5 load balancer device ID")
4949
private Long lbDeviceId;
5050

5151
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_CAPACITY, type=CommandType.LONG, required=false, description="capacity of the device, Capacity will be interpreted as number of networks device can handle")

plugins/network-elements/f5/src/com/cloud/api/commands/DeleteF5LoadBalancerCmd.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.cloudstack.api.PlugService;
3030
import org.apache.cloudstack.api.ServerApiException;
3131
import org.apache.cloudstack.api.response.SuccessResponse;
32+
import com.cloud.api.response.F5LoadBalancerResponse;
3233
import com.cloud.event.EventTypes;
3334
import com.cloud.exception.ConcurrentOperationException;
3435
import com.cloud.exception.InsufficientCapacityException;
@@ -49,8 +50,8 @@ public class DeleteF5LoadBalancerCmd extends BaseAsyncCmd {
4950
//////////////// API parameters /////////////////////
5051
/////////////////////////////////////////////////////
5152

52-
@IdentityMapper(entityTableName="external_load_balancer_devices")
53-
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required=true, description="netscaler load balancer device ID")
53+
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
54+
required=true, description="netscaler load balancer device ID")
5455
private Long lbDeviceId;
5556

5657
/////////////////////////////////////////////////////

plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancerNetworksCmd.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.cloudstack.api.ApiConstants;
2626
import org.apache.cloudstack.api.BaseCmd;
2727
import org.apache.cloudstack.api.BaseListCmd;
28-
import org.apache.cloudstack.api.IdentityMapper;
2928
import org.apache.cloudstack.api.APICommand;
3029
import org.apache.cloudstack.api.Parameter;
3130
import org.apache.cloudstack.api.PlugService;
@@ -52,8 +51,8 @@ public class ListF5LoadBalancerNetworksCmd extends BaseListCmd {
5251
//////////////// API parameters /////////////////////
5352
/////////////////////////////////////////////////////
5453

55-
@IdentityMapper(entityTableName="external_load_balancer_devices")
56-
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, required = true, description="f5 load balancer device ID")
54+
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
55+
required = true, description="f5 load balancer device ID")
5756
private Long lbDeviceId;
5857

5958
/////////////////////////////////////////////////////

plugins/network-elements/f5/src/com/cloud/api/commands/ListF5LoadBalancersCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public class ListF5LoadBalancersCmd extends BaseListCmd {
5050
description="the Physical Network ID")
5151
private Long physicalNetworkId;
5252

53-
@IdentityMapper(entityTableName="external_load_balancer_devices")
54-
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.LONG, description="f5 load balancer device ID")
53+
@Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = F5LoadBalancerResponse.class,
54+
description="f5 load balancer device ID")
5555
private Long lbDeviceId;
5656

5757
/////////////////////////////////////////////////////

plugins/network-elements/f5/src/com/cloud/api/response/F5LoadBalancerResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
// under the License.
1717
package com.cloud.api.response;
1818

19+
import org.apache.cloudstack.api.EntityReference;
1920
import org.apache.cloudstack.api.ApiConstants;
2021
import com.cloud.serializer.Param;
2122
import com.google.gson.annotations.SerializedName;
2223
import org.apache.cloudstack.api.BaseResponse;
24+
import com.cloud.network.ExternalLoadBalancerDeviceVO;
2325

26+
@EntityReference(value=ExternalLoadBalancerDeviceVO.class)
2427
public class F5LoadBalancerResponse extends BaseResponse {
2528
@SerializedName(ApiConstants.LOAD_BALANCER_DEVICE_ID) @Param(description="device id of the F5 load balancer")
2629
private String id;

server/src/com/cloud/network/ExternalLoadBalancerDeviceVO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package com.cloud.network;
1818

19+
import org.apache.cloudstack.api.Identity;
1920
import org.apache.cloudstack.api.InternalIdentity;
2021
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
2122

@@ -36,7 +37,7 @@
3637

3738
@Entity
3839
@Table(name="external_load_balancer_devices")
39-
public class ExternalLoadBalancerDeviceVO implements InternalIdentity {
40+
public class ExternalLoadBalancerDeviceVO implements InternalIdentity, Identity {
4041

4142
@Id
4243
@GeneratedValue(strategy = GenerationType.IDENTITY)

0 commit comments

Comments
 (0)