Search in sources :

Example 6 with ClusterResponse

use of org.apache.cloudstack.api.response.ClusterResponse in project cloudstack by apache.

the class ListClustersCmd method getClusterResponses.

protected Pair<List<ClusterResponse>, Integer> getClusterResponses() {
    Pair<List<? extends Cluster>, Integer> result = _mgr.searchForClusters(this);
    List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
    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());
}
Also used : ArrayList(java.util.ArrayList) Cluster(com.cloud.org.Cluster) ClusterResponse(org.apache.cloudstack.api.response.ClusterResponse) ArrayList(java.util.ArrayList) List(java.util.List) Pair(com.cloud.utils.Pair)

Aggregations

ClusterResponse (org.apache.cloudstack.api.response.ClusterResponse)6 Cluster (com.cloud.org.Cluster)5 ArrayList (java.util.ArrayList)4 ServerApiException (org.apache.cloudstack.api.ServerApiException)4 CapacityDaoImpl (com.cloud.capacity.dao.CapacityDaoImpl)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ClusterMetricsResponse (org.apache.cloudstack.response.ClusterMetricsResponse)2 HostJoinVO (com.cloud.api.query.vo.HostJoinVO)1 SummedCapacity (com.cloud.capacity.dao.CapacityDaoImpl.SummedCapacity)1 DataCenter (com.cloud.dc.DataCenter)1 HostPodVO (com.cloud.dc.HostPodVO)1 DiscoveryException (com.cloud.exception.DiscoveryException)1 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 ResourceInUseException (com.cloud.exception.ResourceInUseException)1 Host (com.cloud.host.Host)1 Pair (com.cloud.utils.Pair)1 HashSet (java.util.HashSet)1 List (java.util.List)1 CapacityResponse (org.apache.cloudstack.api.response.CapacityResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1