VPC: CS-15812 - fixed listVPCs by projectId

This commit is contained in:
Alena Prokharchyk 2012-08-03 14:07:18 -07:00
parent 1a212b3b05
commit 0b2b021f18
3 changed files with 5 additions and 4 deletions

View File

@ -137,7 +137,7 @@ public class ListVPCsCmd extends BaseListTaggedResourcesCmd{
List<? extends Vpc> vpcs = _vpcService.listVpcs(getId(), getVpcName(), getDisplayText(),
getSupportedServices(), getCidr(), getVpcOffId(), getState(), getAccountName(), getDomainId(),
this.getKeyword(), this.getStartIndex(), this.getPageSizeVal(), getZoneId(), this.isRecursive(),
this.listAll(), getRestartRequired(), getTags());
this.listAll(), getRestartRequired(), getTags(), getProjectId());
ListResponse<VpcResponse> response = new ListResponse<VpcResponse>();
List<VpcResponse> offeringResponses = new ArrayList<VpcResponse>();
for (Vpc vpc : vpcs) {

View File

@ -113,13 +113,14 @@ public interface VpcService {
* @param listAll TODO
* @param restartRequired TODO
* @param tags TODO
* @param projectId TODO
* @param vpc
* @return
*/
public List<? extends Vpc> listVpcs(Long id, String vpcName, String displayText,
List<String> supportedServicesStr, String cidr, Long vpcOffId, String state, String accountName, Long domainId,
String keyword, Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll,
Boolean restartRequired, Map<String, String> tags);
Boolean restartRequired, Map<String, String> tags, Long projectId);
/**
* @param vpcId

View File

@ -714,13 +714,13 @@ public class VpcManagerImpl implements VpcManager, Manager{
@Override
public List<? extends Vpc> listVpcs(Long id, String vpcName, String displayText, List<String> supportedServicesStr,
String cidr, Long vpcOffId, String state, String accountName, Long domainId, String keyword,
Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll, Boolean restartRequired, Map<String, String> tags) {
Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll, Boolean restartRequired, Map<String, String> tags, Long projectId) {
Account caller = UserContext.current().getCaller();
List<Long> permittedAccounts = new ArrayList<Long>();
Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean,
ListProjectResourcesCriteria>(domainId, isRecursive, null);
_accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject,
_accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject,
listAll, false);
domainId = domainIdRecursiveListProject.first();
isRecursive = domainIdRecursiveListProject.second();