Search in sources :

Example 41 with StringOption

use of util.StringOption in project coprhd-controller by CoprHD.

the class StorageSystemTypes method getProvidersWithOnlyMDM.

public static List<StringOption> getProvidersWithOnlyMDM() {
    String alltypes = "all";
    List<StringOption> allproviders = new ArrayList<StringOption>();
    StorageSystemTypeList storagetypelist = StorageSystemTypeUtils.getAllStorageSystemTypes(alltypes);
    for (StorageSystemTypeRestRep storagetypeRest : storagetypelist.getStorageSystemTypes()) {
        if (storagetypeRest.getIsOnlyMDM()) {
            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 42 with StringOption

use of util.StringOption in project coprhd-controller by CoprHD.

the class StorageSystems method edit.

@FlashException("list")
public static void edit(String id) {
    addReferenceData();
    StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
    if (storageSystem != null) {
        StorageSystemForm storageArray = new StorageSystemForm(storageSystem);
        if (storageArray.type.equals(SCALEIO)) {
            renderArgs.put("storageArrayTypeList", StorageProviderTypes.getProviderOption());
        }
        if (storageArray.type.equals("xtremio")) {
            renderArgs.put("storageArrayTypeList", StorageProviderTypes.getProviderOption());
        }
        if (storageArray.unregistered) {
            flash.put("warning", MessagesUtils.get(NOT_REGISTERED, storageArray.name));
        }
        if (storageArray.type.equals(VMAX)) {
            @SuppressWarnings("unchecked") List<StringOption> options = (List<StringOption>) renderArgs.get("storageArrayTypeList");
            options.add(new StringOption(VMAX, MessagesUtils.get(SMIS_VMAX)));
            @SuppressWarnings("unchecked") List<StringOption> smisOptions = (List<StringOption>) renderArgs.get("smisStorageSystemTypeList");
            smisOptions.add(new StringOption(VMAX, MessagesUtils.get(SMIS_VMAX)));
        }
        render(storageArray);
    } else {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
}
Also used : StringOption(util.StringOption) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) List(java.util.List) ArrayList(java.util.ArrayList) FlashException(controllers.util.FlashException)

Example 43 with StringOption

use of util.StringOption in project coprhd-controller by CoprHD.

the class StorageSystems method getProjectsForNas.

public static void getProjectsForNas() {
    List<URI> tenants = Lists.newArrayList();
    List<StringOption> allTenants = TenantUtils.getUserSubTenantOptions();
    Iterator<StringOption> tenantsIterator = allTenants.iterator();
    while (tenantsIterator.hasNext()) {
        StringOption tenant = tenantsIterator.next();
        if (tenant == null) {
            continue;
        }
        tenants.add(uri(tenant.id));
    }
    List<StringOption> projectTenantOptions = Lists.newArrayList();
    for (URI tenantId : tenants) {
        String tenantName = getViprClient().tenants().get(tenantId).getName();
        List<String> projectOptions = Lists.newArrayList();
        List<ProjectRestRep> projects = getViprClient().projects().getByTenant(tenantId);
        for (ProjectRestRep project : projects) {
            projectOptions.add(project.getId().toString() + "~~~" + project.getName());
        }
        projectTenantOptions.add(new StringOption(projectOptions.toString(), tenantName));
    }
    renderJSON(projectTenantOptions);
}
Also used : StringOption(util.StringOption) ProjectRestRep(com.emc.storageos.model.project.ProjectRestRep) URI(java.net.URI)

Example 44 with StringOption

use of util.StringOption in project coprhd-controller by CoprHD.

the class Orders method addMaxDaysRenderArgs.

private static void addMaxDaysRenderArgs() {
    Integer maxDays = params.get("maxDays", Integer.class);
    if (maxDays == null) {
        if (StringUtils.isNotEmpty(params.get("startDate")) && StringUtils.isNotEmpty(params.get("endDate"))) {
            renderArgs.put("startDate", params.get("startDate"));
            renderArgs.put("endDate", params.get("endDate"));
            maxDays = 0;
        } else {
            maxDays = 1;
        }
    }
    int[] days = { 1, 7, 14, 30, 90, 0 };
    List<StringOption> options = Lists.newArrayList();
    options.add(new StringOption(String.valueOf(maxDays), MessagesUtils.get("orders.nDays", maxDays)));
    for (int day : days) {
        if (day == maxDays) {
            options.remove(0);
        }
        options.add(new StringOption(String.valueOf(day), MessagesUtils.get("orders." + day + "days")));
    }
    renderArgs.put("offsetInMinutes", params.get("offsetInMinutes"));
    renderArgs.put("maxDays", maxDays);
    renderArgs.put("dateDaysAgo", OrderDataTable.getDateDaysAgo(maxDays));
    renderArgs.put("maxDaysOptions", options);
}
Also used : StringOption(util.StringOption)

Aggregations

StringOption (util.StringOption)44 ArrayList (java.util.ArrayList)26 StorageSystemTypeRestRep (com.emc.storageos.model.storagesystem.type.StorageSystemTypeRestRep)20 StorageSystemTypeList (com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)19 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)4 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)3 FlashException (controllers.util.FlashException)3 ComputeImageServerRestRep (com.emc.storageos.model.compute.ComputeImageServerRestRep)2 ComputeSystemRestRep (com.emc.storageos.model.compute.ComputeSystemRestRep)2 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 URI (java.net.URI)2 DataObjectRestRep (com.emc.storageos.model.DataObjectRestRep)1 AuthnProviderRestRep (com.emc.storageos.model.auth.AuthnProviderRestRep)1 CustomServicesPrimitiveResourceList (com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList)1 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)1 BucketRestRep (com.emc.storageos.model.object.BucketRestRep)1 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 ComputeVirtualPoolRestRep (com.emc.storageos.model.vpool.ComputeVirtualPoolRestRep)1 TruststoreSettings (com.emc.vipr.model.keystore.TruststoreSettings)1