Skip to content

list only own zones for resource manager #11087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: 4.20
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@

protected Pair<List<ClusterResponse>, Integer> getClusterResponses() {
Pair<List<? extends Cluster>, Integer> result = _mgr.searchForClusters(this);
List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
List<ClusterResponse> clusterResponses = new ArrayList<>();

Check warning on line 131 in api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java#L131

Added line #L131 was not covered by tests
for (Cluster cluster : result.first()) {
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, showCapacities);
clusterResponse.setObjectName("cluster");
clusterResponses.add(clusterResponse);
}
return new Pair<List<ClusterResponse>, Integer>(clusterResponses, result.second());
return new Pair<>(clusterResponses, result.second());

Check warning on line 137 in api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java#L137

Added line #L137 was not covered by tests
}

@Override
public void execute() {
Pair<List<ClusterResponse>, Integer> clusterResponses = getClusterResponses();
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
ListResponse<ClusterResponse> response = new ListResponse<>();

Check warning on line 143 in api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java#L143

Added line #L143 was not covered by tests
response.setResponses(clusterResponses.first(), clusterResponses.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
@Override
public void execute() {
Pair<List<? extends Pod>, Integer> result = _mgr.searchForPods(this);
ListResponse<PodResponse> response = new ListResponse<PodResponse>();
List<PodResponse> podResponses = new ArrayList<PodResponse>();
ListResponse<PodResponse> response = new ListResponse<>();
List<PodResponse> podResponses = new ArrayList<>();

Check warning on line 90 in api/src/main/java/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java#L89-L90

Added lines #L89 - L90 were not covered by tests
for (Pod pod : result.first()) {
PodResponse podResponse = _responseGenerator.createPodResponse(pod, showCapacities);
podResponse.setObjectName("pod");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ListZonesCmd extends BaseListCmd implements UserCmd {

private static final String s_name = "listzonesresponse";

/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -113,11 +111,6 @@ public Boolean getShowIcon () {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

@Override
public String getCommandName() {
return s_name;
}

@Override
public void execute() {
ListResponse<ZoneResponse> response = _queryService.listDataCenters(this);
Expand Down
Loading
Loading