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>
This commit is contained in:
Rohit Yadav 2012-12-21 17:04:17 -08:00
parent f548099d08
commit 08892c51a3
4 changed files with 6 additions and 16 deletions

View File

@ -50,11 +50,8 @@ public abstract class BaseResponse implements ResponseObject {
return null;
}
// For use by list commands with pending async jobs
protected String jobId;
@SerializedName(ApiConstants.JOB_ID) @Param(description="the UUID of the latest async job acting on this object")
protected String jobUuid;
protected String jobId;
@SerializedName(ApiConstants.JOB_STATUS) @Param(description="the current status of the latest async job acting on this object")
private Integer jobStatus;
@ -67,14 +64,6 @@ public abstract class BaseResponse implements ResponseObject {
this.jobId = jobId;
}
public String getJobUuid() {
return jobUuid;
}
public void setJobUuid(String jobUuid) {
this.jobUuid = jobUuid;
}
public Integer getJobStatus() {
return jobStatus;
}

View File

@ -20,7 +20,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
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.response.AsyncJobResponse;
@ -36,8 +35,8 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="async_job")
@Parameter(name=ApiConstants.JOB_ID, type=CommandType.LONG, required=true, description="the ID of the asychronous job")
@Parameter(name=ApiConstants.JOB_ID, type=CommandType.UUID, entityType=AsyncJobResponse.class,
required=true, description="the ID of the asychronous job")
private Long id;
/////////////////////////////////////////////////////

View File

@ -20,11 +20,13 @@ import java.util.Date;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.Entity;
import org.apache.cloudstack.api.ResponseObject;
import com.cloud.async.AsyncJob;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
@Entity(value=AsyncJob.class)
@SuppressWarnings("unused")
public class AsyncJobResponse extends BaseResponse {

View File

@ -124,7 +124,7 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO, Long> implem
}
}
userVmResponse.setPassword(userVm.getPassword());
userVmResponse.setJobUuid(userVm.getJobUuid());
userVmResponse.setJobId(userVm.getJobUuid());
userVmResponse.setJobStatus(userVm.getJobStatus());
//userVmResponse.setForVirtualNetwork(userVm.getForVirtualNetwork());