Search in sources :

Example 1 with NamedVolumeGroupsList

use of com.emc.storageos.model.block.NamedVolumeGroupsList in project coprhd-controller by CoprHD.

the class VolumeGroupService method getChildrenVolumeGroups.

/**
 * Get the list of child volume groups
 *
 * @param id
 * @brief List the child volume groups
 * @return
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/volume-groups")
public NamedVolumeGroupsList getChildrenVolumeGroups(@PathParam("id") URI id) {
    ArgValidator.checkFieldUriType(id, VolumeGroup.class, "id");
    VolumeGroup volumeGroup = _dbClient.queryObject(VolumeGroup.class, id);
    NamedVolumeGroupsList result = new NamedVolumeGroupsList();
    List<VolumeGroup> volumeGroups = getVolumeGroupChildren(_dbClient, volumeGroup);
    for (VolumeGroup group : volumeGroups) {
        result.getVolumeGroups().add(toNamedRelatedResource(group));
    }
    return result;
}
Also used : NamedVolumeGroupsList(com.emc.storageos.model.block.NamedVolumeGroupsList) VolumeGroup(com.emc.storageos.db.client.model.VolumeGroup) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

VolumeGroup (com.emc.storageos.db.client.model.VolumeGroup)1 NamedVolumeGroupsList (com.emc.storageos.model.block.NamedVolumeGroupsList)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1