mirror of https://github.com/apache/cloudstack.git
api: Fix BaseList Cmd classes to use UUID CommandType and entityType appropriately
- Get rid of IdentityMapper - Use entityType which is an array of Response.class - Use UUID CommandType for params which will receive UUID string from over the wire requests Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
b008f31fd5
commit
dc33a8d145
|
|
@ -16,15 +16,16 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
|
||||
public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
|
||||
|
||||
@Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, description = "If set to false, " +
|
||||
"list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
|
||||
private Boolean listAll;
|
||||
|
||||
@IdentityMapper(entityTableName = "domain")
|
||||
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "list only resources" +
|
||||
" belonging to the domain specified")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
|
||||
description="list only resources belonging to the domain specified")
|
||||
private Long domainId;
|
||||
|
||||
@Parameter(name = ApiConstants.IS_RECURSIVE, type = CommandType.BOOLEAN, description = "defaults to false," +
|
||||
|
|
|
|||
|
|
@ -16,10 +16,12 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api;
|
||||
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
|
||||
public abstract class BaseListProjectAndAccountResourcesCmd extends BaseListAccountResourcesCmd {
|
||||
|
||||
@IdentityMapper(entityTableName = "projects")
|
||||
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.LONG, description = "list objects by project")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType=ProjectResponse.class,
|
||||
description="list objects by project")
|
||||
private Long projectId;
|
||||
|
||||
public Long getProjectId() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue