bug 7448: add domain parameter in returned objects from listNetworks API. (changed by Alena)

This commit is contained in:
Jessica Wang 2010-12-09 09:57:23 -08:00
parent 2f39796392
commit d2bd6e522e
2 changed files with 15 additions and 2 deletions

View File

@ -95,7 +95,8 @@ public class NetworkResponse extends BaseResponse{
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id associated with the network")
private Long domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain associated with the network")
private String domain;
public Long getId() {
return id;
@ -288,4 +289,14 @@ public class NetworkResponse extends BaseResponse{
public void setIsSystem(Boolean isSystem) {
this.isSystem = isSystem;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
}

View File

@ -2412,7 +2412,9 @@ public class ApiResponseHelper implements ResponseGenerator {
Account account = ApiDBUtils.findAccountById(network.getAccountId());
if (account != null) {
response.setAccountName(account.getAccountName());
response.setDomainId(account.getDomainId());
Domain domain = ApiDBUtils.findDomainById(account.getDomainId());
response.setDomainId(domain.getId());
response.setDomain(domain.getName());
}
response.setObjectName("network");
return response;