use of com.emc.storageos.model.file.policy.FilePolicyStorageResources in project coprhd-controller by CoprHD.
the class FilePolicyService method getFilePolicyStorageResources.
/**
* @brief Get the list of policy storage resources of a file policy.
*
* @param id of the file policy.
* @return List of policy storage resource information.
*/
@GET
@Path("/{id}/policy-storage-resources")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR, Role.TENANT_ADMIN })
public FilePolicyStorageResources getFilePolicyStorageResources(@PathParam("id") URI id) {
_log.info("Request recieved to list storage resources for the policy {}", id);
FilePolicy filepolicy = queryResource(id);
ArgValidator.checkEntity(filepolicy, id, true);
FilePolicyStorageResources resources = new FilePolicyStorageResources();
List<FilePolicyStorageResourceRestRep> policyResources = new ArrayList<FilePolicyStorageResourceRestRep>();
for (PolicyStorageResource storageRes : FileOrchestrationUtils.getFilePolicyStorageResources(_dbClient, filepolicy)) {
policyResources.add(FilePolicyMapper.mapPolicyStorageResource(storageRes, filepolicy, _dbClient));
}
resources.setStorageResources(policyResources);
return resources;
}
Aggregations