|
54 | 54 | import org.apache.cloudstack.api.command.admin.user.ListUsersCmd; |
55 | 55 | import org.apache.cloudstack.api.command.admin.vm.ListVMsCmdByAdmin; |
56 | 56 | import org.apache.cloudstack.api.command.admin.volume.ListVolumesCmdByAdmin; |
| 57 | +import org.apache.cloudstack.api.command.admin.zone.ListZonesCmdByAdmin; |
57 | 58 | import org.apache.cloudstack.api.command.user.account.ListAccountsCmd; |
58 | 59 | import org.apache.cloudstack.api.command.user.account.ListProjectAccountsCmd; |
59 | 60 | import org.apache.cloudstack.api.command.user.event.ListEventsCmd; |
|
70 | 71 | import org.apache.cloudstack.api.command.user.vmgroup.ListVMGroupsCmd; |
71 | 72 | import org.apache.cloudstack.api.command.user.volume.ListResourceDetailsCmd; |
72 | 73 | import org.apache.cloudstack.api.command.user.volume.ListVolumesCmd; |
73 | | -import org.apache.cloudstack.api.command.user.zone.ListZonesByCmd; |
| 74 | +import org.apache.cloudstack.api.command.user.zone.ListZonesCmd; |
74 | 75 | import org.apache.cloudstack.api.response.AccountResponse; |
75 | 76 | import org.apache.cloudstack.api.response.AclGroupResponse; |
76 | 77 | import org.apache.cloudstack.api.response.AclPolicyResponse; |
@@ -2510,16 +2511,22 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte |
2510 | 2511 | } |
2511 | 2512 |
|
2512 | 2513 | @Override |
2513 | | - public ListResponse<ZoneResponse> listDataCenters(ListZonesByCmd cmd) { |
| 2514 | + public ListResponse<ZoneResponse> listDataCenters(ListZonesCmd cmd) { |
2514 | 2515 | Pair<List<DataCenterJoinVO>, Integer> result = listDataCentersInternal(cmd); |
2515 | 2516 | ListResponse<ZoneResponse> response = new ListResponse<ZoneResponse>(); |
2516 | | - List<ZoneResponse> dcResponses = ViewResponseHelper.createDataCenterResponse(cmd.getShowCapacities(), result |
| 2517 | + |
| 2518 | + ResponseView respView = ResponseView.Restricted; |
| 2519 | + if (cmd instanceof ListZonesCmdByAdmin) { |
| 2520 | + respView = ResponseView.Full; |
| 2521 | + } |
| 2522 | + |
| 2523 | + List<ZoneResponse> dcResponses = ViewResponseHelper.createDataCenterResponse(respView, cmd.getShowCapacities(), result |
2517 | 2524 | .first().toArray(new DataCenterJoinVO[result.first().size()])); |
2518 | 2525 | response.setResponses(dcResponses, result.second()); |
2519 | 2526 | return response; |
2520 | 2527 | } |
2521 | 2528 |
|
2522 | | - private Pair<List<DataCenterJoinVO>, Integer> listDataCentersInternal(ListZonesByCmd cmd) { |
| 2529 | + private Pair<List<DataCenterJoinVO>, Integer> listDataCentersInternal(ListZonesCmd cmd) { |
2523 | 2530 | Account account = CallContext.current().getCallingAccount(); |
2524 | 2531 | Long domainId = cmd.getDomainId(); |
2525 | 2532 | Long id = cmd.getId(); |
|
0 commit comments