set Objectname to CreateAffinityGroupResponse Object. Also the listAffinityGroups is missing the 'type' property

This commit is contained in:
Prachi Damle 2013-04-17 17:46:06 -07:00
parent 7182a939a8
commit 6dccf63a32
4 changed files with 19 additions and 1 deletions

View File

@ -3664,8 +3664,13 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setName(group.getName());
response.setType(group.getType());
response.setDescription(group.getDescription());
// response.setDomainId(account.)
Domain domain = ApiDBUtils.findDomainById(account.getDomainId());
if (domain != null) {
response.setDomainId(domain.getUuid());
response.setDomainName(domain.getName());
}
response.setObjectName("affinitygroup");
return response;
}

View File

@ -63,6 +63,7 @@ public class AffinityGroupJoinDaoImpl extends GenericDaoBase<AffinityGroupJoinVO
agResponse.setId(vag.getUuid());
agResponse.setName(vag.getName());
agResponse.setDescription(vag.getDescription());
agResponse.setType(vag.getType());
ApiResponseHelper.populateOwner(agResponse, vag);

View File

@ -36,6 +36,9 @@ public class AffinityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
@Column(name="name")
private String name;
@Column(name = "type")
private String type;
@Column(name = "description")
private String description;
@ -114,6 +117,14 @@ public class AffinityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public long getAccountId() {
return accountId;

View File

@ -512,6 +512,7 @@ CREATE VIEW `cloud`.`affinity_group_view` AS
select
affinity_group.id id,
affinity_group.name name,
affinity_group.type type,
affinity_group.description description,
affinity_group.uuid uuid,
account.id account_id,