Search in sources :

Example 16 with StorageSystemTypeList

use of com.emc.storageos.model.storagesystem.type.StorageSystemTypeList in project coprhd-controller by CoprHD.

the class StorageSystemTypes method getObjectStorageOptions.

public static List<StringOption> getObjectStorageOptions() {
    List<StringOption> options = new ArrayList<StringOption>(Arrays.asList(StringOption.NONE_OPTION));
    StorageSystemTypeList typeList = StorageSystemTypeUtils.getAllStorageSystemTypes(StorageSystemTypeUtils.ALL_TYPE);
    for (StorageSystemTypeRestRep type : typeList.getStorageSystemTypes()) {
        if (!StorageSystemTypeUtils.OBJECT_TYPE.equalsIgnoreCase(type.getMetaType())) {
            continue;
        }
        options.add(new StringOption(type.getStorageTypeName(), type.getStorageTypeDispName()));
    }
    return options;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 17 with StorageSystemTypeList

use of com.emc.storageos.model.storagesystem.type.StorageSystemTypeList in project coprhd-controller by CoprHD.

the class StorageSystemTypes method getProvidersWithSecretKey.

public static List<StringOption> getProvidersWithSecretKey() {
    String alltypes = "all";
    List<StringOption> allproviders = new ArrayList<StringOption>();
    StorageSystemTypeList storagetypelist = StorageSystemTypeUtils.getAllStorageSystemTypes(alltypes);
    for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
        if (storagetypeRest.getIsSecretKey()) {
            allproviders.add(new StringOption(storagetypeRest.getStorageTypeName(), storagetypeRest.getStorageTypeDispName()));
        }
    }
    return allproviders;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) StringOption(util.StringOption) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 18 with StorageSystemTypeList

use of com.emc.storageos.model.storagesystem.type.StorageSystemTypeList in project coprhd-controller by CoprHD.

the class VirtualDataCenterProvider method getStorageSystemType.

private List<String> getStorageSystemType(AssetOptionsContext ctx, String storagetype) {
    List<String> storagesystemtypes = new ArrayList<String>();
    StorageSystemTypeList storagetypelist = api(ctx).storageSystemType().listStorageSystemTypes("all");
    for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
        if (storagetypeRest.getMetaType().equals(storagetype) || storagetypeRest.getMetaType().contains(storagetype)) {
            storagesystemtypes.add(storagetypeRest.getStorageTypeName());
        }
    }
    return storagesystemtypes;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Example 19 with StorageSystemTypeList

use of com.emc.storageos.model.storagesystem.type.StorageSystemTypeList in project coprhd-controller by CoprHD.

the class StorageSystemTypeService method getStorageSystemTypes.

/**
 * Returns a list of all Storage System Types requested for like block,
 * file, object or all. Valid input parameters are block, file, object and
 * all
 *
 * @brief List storage system types
 * @return List of all storage system types.
 */
@GET
@Path("/type/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemTypeList getStorageSystemTypes(@PathParam("type") String type) {
    log.info("GET getStorageSystemType on type: " + type);
    if (type != null) {
        ArgValidator.checkFieldValueFromEnum(type.toUpperCase(), "metaType", StorageSystemType.META_TYPE.class);
    }
    List<URI> ids = _dbClient.queryByType(StorageSystemType.class, true);
    StorageSystemTypeList list = new StorageSystemTypeList();
    Iterator<StorageSystemType> iter = _dbClient.queryIterativeObjects(StorageSystemType.class, ids);
    while (iter.hasNext()) {
        StorageSystemType ssType = iter.next();
        if (ssType.getStorageTypeId() == null) {
            ssType.setStorageTypeId(ssType.getId().toString());
        }
        if (StringUtils.equals(ALL_TYPE, type) || StringUtils.equals(type, ssType.getMetaType())) {
            list.getStorageSystemTypes().add(map(ssType));
        }
    }
    return list;
}
Also used : StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList) StorageSystemType(com.emc.storageos.db.client.model.StorageSystemType) URI(java.net.URI) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 20 with StorageSystemTypeList

use of com.emc.storageos.model.storagesystem.type.StorageSystemTypeList in project coprhd-controller by CoprHD.

the class BlockVirtualPools method getSupportAutoTierTypes.

private static List<String> getSupportAutoTierTypes() {
    List<String> result = new ArrayList<String>();
    StorageSystemTypeList types = StorageSystemTypeUtils.getAllStorageSystemTypes(StorageSystemTypeUtils.ALL_TYPE);
    for (StorageSystemTypeRestRep type : types.getStorageSystemTypes()) {
        if (type.isNative() || type.getIsSmiProvider() || !type.isSupportAutoTierPolicy()) {
            continue;
        }
        result.add(type.getStorageTypeName());
    }
    return result;
}
Also used : StorageSystemTypeRestRep(com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep) ArrayList(java.util.ArrayList) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)

Aggregations

StorageSystemTypeList (com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)24 StorageSystemTypeRestRep (com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep)23 ArrayList (java.util.ArrayList)22 StringOption (util.StringOption)19 StorageSystemType (com.emc.storageos.db.client.model.StorageSystemType)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 URI (java.net.URI)1 HashMap (java.util.HashMap)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 EnumOption (util.EnumOption)1