Search in sources :

Example 6 with ClusterList

use of com.emc.storageos.model.host.cluster.ClusterList in project coprhd-controller by CoprHD.

the class VolumeGroupService method getClusters.

/**
 * Get application clusters
 *
 * @param id Application Id
 * @brief List clusters for an application
 * @return ClusterList
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/clusters")
public ClusterList getClusters(@PathParam("id") URI id) {
    ArgValidator.checkFieldUriType(id, VolumeGroup.class, "id");
    VolumeGroup volumeGroup = _dbClient.queryObject(VolumeGroup.class, id);
    ClusterList result = new ClusterList();
    List<Cluster> clusters = getVolumeGroupClusters(_dbClient, volumeGroup);
    for (Cluster cluster : clusters) {
        result.getClusters().add(toNamedRelatedResource(cluster));
    }
    return result;
}
Also used : ClusterList(com.emc.storageos.model.host.cluster.ClusterList) VolumeGroup(com.emc.storageos.db.client.model.VolumeGroup) Cluster(com.emc.storageos.db.client.model.Cluster) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

ClusterList (com.emc.storageos.model.host.cluster.ClusterList)6 GET (javax.ws.rs.GET)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 ClientResponse (com.sun.jersey.api.client.ClientResponse)2 MapVcenter (com.emc.storageos.api.mapper.functions.MapVcenter)1 MapVcenterDataCenter (com.emc.storageos.api.mapper.functions.MapVcenterDataCenter)1 NamedElementQueryResultList (com.emc.storageos.db.client.constraint.NamedElementQueryResultList)1 Cluster (com.emc.storageos.db.client.model.Cluster)1 VolumeGroup (com.emc.storageos.db.client.model.VolumeGroup)1 URI (java.net.URI)1