Skip to content

Commit 924e556

Browse files
author
Kelven Yang
committed
bug 6745: Using UUID instead of integers - for all commands
1 parent 8d8775b commit 924e556

270 files changed

Lines changed: 1965 additions & 647 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/src/com/cloud/api/BaseAsyncCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
5757
public ResponseObject getResponse(long jobId) {
5858
AsyncJobResponse response = new AsyncJobResponse();
5959

60-
response.setId(_identityService.getIdentityUuid("async_job", String.valueOf(jobId)));
60+
response.setId(jobId);
6161
response.setResponseName(getCommandName());
6262
return response;
6363
}

api/src/com/cloud/api/commands/ActivateProjectCmd.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.cloud.api.ApiConstants;
2424
import com.cloud.api.BaseAsyncCmd;
2525
import com.cloud.api.BaseCmd;
26+
import com.cloud.api.IdentityMapper;
2627
import com.cloud.api.BaseCmd.CommandType;
2728
import com.cloud.api.Implementation;
2829
import com.cloud.api.Parameter;
@@ -43,6 +44,7 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
4344
//////////////// API parameters /////////////////////
4445
/////////////////////////////////////////////////////
4546

47+
@IdentityMapper(entityTableName="projects")
4648
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
4749
private Long id;
4850

api/src/com/cloud/api/commands/AddAccountToProjectCmd.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.cloud.api.ApiConstants;
2424
import com.cloud.api.BaseAsyncCmd;
2525
import com.cloud.api.BaseCmd;
26+
import com.cloud.api.IdentityMapper;
2627
import com.cloud.api.Implementation;
2728
import com.cloud.api.Parameter;
2829
import com.cloud.api.ServerApiException;
@@ -42,6 +43,7 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
4243
//////////////// API parameters /////////////////////
4344
/////////////////////////////////////////////////////
4445

46+
@IdentityMapper(entityTableName="projects")
4547
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, required=true, description="id of the project to add the account to")
4648
private Long projectId;
4749

api/src/com/cloud/api/commands/AddClusterCmd.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import com.cloud.api.ApiConstants;
2727
import com.cloud.api.BaseCmd;
28+
import com.cloud.api.IdentityMapper;
2829
import com.cloud.api.Implementation;
2930
import com.cloud.api.Parameter;
3031
import com.cloud.api.ServerApiException;
@@ -46,6 +47,7 @@ public class AddClusterCmd extends BaseCmd {
4647
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
4748
private String password;
4849

50+
@IdentityMapper(entityTableName="host_pod_ref")
4951
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host")
5052
private Long podId;
5153

@@ -55,6 +57,7 @@ public class AddClusterCmd extends BaseCmd {
5557
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
5658
private String username;
5759

60+
@IdentityMapper(entityTableName="data_center")
5861
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
5962
private Long zoneId;
6063

api/src/com/cloud/api/commands/AddHostCmd.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import com.cloud.api.ApiConstants;
2626
import com.cloud.api.BaseCmd;
27+
import com.cloud.api.IdentityMapper;
2728
import com.cloud.api.Implementation;
2829
import com.cloud.api.Parameter;
2930
import com.cloud.api.ServerApiException;
@@ -44,6 +45,7 @@ public class AddHostCmd extends BaseCmd {
4445
//////////////// API parameters /////////////////////
4546
/////////////////////////////////////////////////////
4647

48+
@IdentityMapper(entityTableName="cluster")
4749
@Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="the cluster ID for the host")
4850
private Long clusterId;
4951

@@ -53,6 +55,7 @@ public class AddHostCmd extends BaseCmd {
5355
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the password for the host")
5456
private String password;
5557

58+
@IdentityMapper(entityTableName="host_pod_ref")
5659
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host")
5760
private Long podId;
5861

@@ -62,6 +65,7 @@ public class AddHostCmd extends BaseCmd {
6265
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host")
6366
private String username;
6467

68+
@IdentityMapper(entityTableName="data_center")
6569
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host")
6670
private Long zoneId;
6771

api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import com.cloud.api.ApiConstants;
2626
import com.cloud.api.BaseCmd;
27+
import com.cloud.api.IdentityMapper;
2728
import com.cloud.api.Implementation;
2829
import com.cloud.api.Parameter;
2930
import com.cloud.api.ServerApiException;
@@ -44,6 +45,7 @@ public class AddSecondaryStorageCmd extends BaseCmd {
4445
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the secondary storage")
4546
private String url;
4647

48+
@IdentityMapper(entityTableName="data_center")
4749
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the secondary storage")
4850
private Long zoneId;
4951

api/src/com/cloud/api/commands/AddVpnUserCmd.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.cloud.api.ApiConstants;
2424
import com.cloud.api.BaseAsyncCreateCmd;
2525
import com.cloud.api.BaseCmd;
26+
import com.cloud.api.IdentityMapper;
2627
import com.cloud.api.Implementation;
2728
import com.cloud.api.Parameter;
2829
import com.cloud.api.ServerApiException;
@@ -51,9 +52,11 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
5152
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the vpn user. Must be used with domainId.")
5253
private String accountName;
5354

55+
@IdentityMapper(entityTableName="projects")
5456
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="add vpn user to the specific project")
5557
private Long projectId;
5658

59+
@IdentityMapper(entityTableName="domain")
5760
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.")
5861
private Long domainId;
5962

api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.cloud.api.ApiConstants;
2525
import com.cloud.api.BaseAsyncCmd;
2626
import com.cloud.api.BaseCmd;
27+
import com.cloud.api.IdentityMapper;
2728
import com.cloud.api.Implementation;
2829
import com.cloud.api.Parameter;
2930
import com.cloud.api.ServerApiException;
@@ -45,9 +46,11 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
4546
//////////////// API parameters /////////////////////
4647
/////////////////////////////////////////////////////
4748

49+
@IdentityMapper(entityTableName="firewall_rules")
4850
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the load balancer rule")
4951
private Long id;
5052

53+
@IdentityMapper(entityTableName="vm_instance")
5154
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, required=true, description="the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)")
5255
private List<Long> virtualMachineIds;
5356

api/src/com/cloud/api/commands/AssociateIPAddrCmd.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.cloud.api.BaseAsyncCmd;
2626
import com.cloud.api.BaseAsyncCreateCmd;
2727
import com.cloud.api.BaseCmd;
28+
import com.cloud.api.IdentityMapper;
2829
import com.cloud.api.Implementation;
2930
import com.cloud.api.Parameter;
3031
import com.cloud.api.ServerApiException;
@@ -56,15 +57,19 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
5657
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account to associate with this IP address")
5758
private String accountName;
5859

60+
@IdentityMapper(entityTableName="domain")
5961
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the domain to associate with this IP address")
6062
private Long domainId;
6163

64+
@IdentityMapper(entityTableName="data_center")
6265
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the ID of the availability zone you want to acquire an public IP address from")
6366
private Long zoneId;
6467

68+
@IdentityMapper(entityTableName="networks")
6569
@Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="The network this ip address should be associated to.")
6670
private Long networkId;
6771

72+
@IdentityMapper(entityTableName="projects")
6873
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project")
6974
private Long projectId;
7075

api/src/com/cloud/api/commands/AttachIsoCmd.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.cloud.api.ApiConstants;
2323
import com.cloud.api.BaseAsyncCmd;
2424
import com.cloud.api.BaseCmd;
25+
import com.cloud.api.IdentityMapper;
2526
import com.cloud.api.Implementation;
2627
import com.cloud.api.Parameter;
2728
import com.cloud.api.ServerApiException;
@@ -41,9 +42,11 @@ public class AttachIsoCmd extends BaseAsyncCmd {
4142
//////////////// API parameters /////////////////////
4243
/////////////////////////////////////////////////////
4344

45+
@IdentityMapper(entityTableName="vm_template")
4446
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the ISO file")
4547
private Long id;
4648

49+
@IdentityMapper(entityTableName="vm_instance")
4750
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine")
4851
private Long virtualMachineId;
4952

0 commit comments

Comments
 (0)