Skip to content

Commit 08892c5

Browse files
committed
api: Fix jobid and entitytype for BaseResponse and QueryAsyncJob*
- Fix jobid serialization issue that broke the UI - Fix AsyncJob Result and Response - Get rid of getUuid(), setUuid(), just use getId, setId for uuid... - All uuids from over the wire are UUIDs Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent f548099 commit 08892c5

4 files changed

Lines changed: 6 additions & 16 deletions

File tree

‎api/src/org/apache/cloudstack/api/BaseResponse.java‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ public String getObjectId() {
5050
return null;
5151
}
5252

53-
// For use by list commands with pending async jobs
54-
protected String jobId;
55-
5653
@SerializedName(ApiConstants.JOB_ID) @Param(description="the UUID of the latest async job acting on this object")
57-
protected String jobUuid;
54+
protected String jobId;
5855

5956
@SerializedName(ApiConstants.JOB_STATUS) @Param(description="the current status of the latest async job acting on this object")
6057
private Integer jobStatus;
@@ -67,14 +64,6 @@ public void setJobId(String jobId) {
6764
this.jobId = jobId;
6865
}
6966

70-
public String getJobUuid() {
71-
return jobUuid;
72-
}
73-
74-
public void setJobUuid(String jobUuid) {
75-
this.jobUuid = jobUuid;
76-
}
77-
7867
public Integer getJobStatus() {
7968
return jobStatus;
8069
}

‎api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.BaseCmd;
23-
import org.apache.cloudstack.api.IdentityMapper;
2423
import org.apache.cloudstack.api.Implementation;
2524
import org.apache.cloudstack.api.Parameter;
2625
import org.apache.cloudstack.api.response.AsyncJobResponse;
@@ -36,8 +35,8 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
3635
//////////////// API parameters /////////////////////
3736
/////////////////////////////////////////////////////
3837

39-
@IdentityMapper(entityTableName="async_job")
40-
@Parameter(name=ApiConstants.JOB_ID, type=CommandType.LONG, required=true, description="the ID of the asychronous job")
38+
@Parameter(name=ApiConstants.JOB_ID, type=CommandType.UUID, entityType=AsyncJobResponse.class,
39+
required=true, description="the ID of the asychronous job")
4140
private Long id;
4241

4342
/////////////////////////////////////////////////////

‎api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020

2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.BaseResponse;
23+
import org.apache.cloudstack.api.Entity;
2324
import org.apache.cloudstack.api.ResponseObject;
2425
import com.cloud.async.AsyncJob;
2526
import com.cloud.serializer.Param;
2627
import com.google.gson.annotations.SerializedName;
2728

29+
@Entity(value=AsyncJob.class)
2830
@SuppressWarnings("unused")
2931
public class AsyncJobResponse extends BaseResponse {
3032

‎server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public UserVmResponse newUserVmResponse(String objectName, UserVmJoinVO userVm,
124124
}
125125
}
126126
userVmResponse.setPassword(userVm.getPassword());
127-
userVmResponse.setJobUuid(userVm.getJobUuid());
127+
userVmResponse.setJobId(userVm.getJobUuid());
128128
userVmResponse.setJobStatus(userVm.getJobStatus());
129129
//userVmResponse.setForVirtualNetwork(userVm.getForVirtualNetwork());
130130

0 commit comments

Comments
 (0)