use of com.emc.storageos.db.client.model.StorageTier in project coprhd-controller by CoprHD.
the class StorageTierService method getStorageTiers.
/**
* List all storage tiers
*
* @prereq none
* @brief List all storage tiers.
* @return StorageTierList
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageTierList getStorageTiers() {
StorageTierList tierList = new StorageTierList();
List<URI> tierUris = _dbClient.queryByType(StorageTier.class, true);
List<StorageTier> tiers = _dbClient.queryObject(StorageTier.class, tierUris);
for (StorageTier tier : tiers) {
tierList.getStorageTiers().add(DbObjectMapper.toNamedRelatedResource(ResourceTypeEnum.STORAGE_TIER, tier.getId(), tier.getLabel()));
}
return tierList;
}
use of com.emc.storageos.db.client.model.StorageTier in project coprhd-controller by CoprHD.
the class StorageTierService method getStorageTier.
/**
* get Storage Tier associated with id.
*
* @param id the URN of a ViPR storage tier
* @brief Show storage tier
* @return Policy Object
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
@Path("/{id}")
public StorageTierRestRep getStorageTier(@PathParam("id") URI id) {
// CQECC00606330
ArgValidator.checkFieldUriType(id, StorageTier.class, "id");
StorageTier tier = queryResource(id);
return map(tier);
}
Aggregations