Search in sources :

Example 16 with StorageTier

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;
}
Also used : MapStorageTier(com.emc.storageos.api.mapper.functions.MapStorageTier) StorageTier(com.emc.storageos.db.client.model.StorageTier) StorageTierList(com.emc.storageos.model.block.tier.StorageTierList) URI(java.net.URI) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 17 with StorageTier

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);
}
Also used : MapStorageTier(com.emc.storageos.api.mapper.functions.MapStorageTier) StorageTier(com.emc.storageos.db.client.model.StorageTier) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

StorageTier (com.emc.storageos.db.client.model.StorageTier)17 URI (java.net.URI)7 ArrayList (java.util.ArrayList)5 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)4 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)4 MapStorageTier (com.emc.storageos.api.mapper.functions.MapStorageTier)3 AutoTieringPolicy (com.emc.storageos.db.client.model.AutoTieringPolicy)3 StoragePool (com.emc.storageos.db.client.model.StoragePool)3 StorageTierList (com.emc.storageos.model.block.tier.StorageTierList)3 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)3 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 List (java.util.List)3 CIMInstance (javax.cim.CIMInstance)3 CIMObjectPath (javax.cim.CIMObjectPath)3 VNXeStorageTier (com.emc.storageos.vnxe.models.VNXeStorageTier)2 IOException (java.io.IOException)2 Iterator (java.util.Iterator)2 StringSet (com.emc.storageos.db.client.model.StringSet)1 StoragePoolTier (com.emc.storageos.hds.model.StoragePoolTier)1