Search in sources :

Example 31 with StringOption

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

the class FileProtectionPolicies method getAllVarrays.

private static List<StringOption> getAllVarrays() {
    List<StringOption> varrayList = Lists.newArrayList();
    List<NamedRelatedResourceRep> allVarrays = getViprClient().varrays().list();
    for (NamedRelatedResourceRep varray : allVarrays) {
        varrayList.add(new StringOption(varray.getId().toString(), varray.getName()));
    }
    return varrayList;
}
Also used : StringOption(util.StringOption) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 32 with StringOption

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

the class FileVirtualPools method listReplicationVirtualArraysJson.

public static void listReplicationVirtualArraysJson(FileVirtualPoolForm vpool) {
    if (vpool == null) {
        renderJSON(Collections.emptyList());
    }
    vpool.deserialize();
    List<StringOption> actualOptions = Lists.newArrayList();
    List<VirtualArrayRestRep> virtualArrays = VirtualArrayUtils.getVirtualArrays();
    for (StringOption option : dataObjectOptions(virtualArrays)) {
        actualOptions.add(option);
    }
    renderJSON(actualOptions);
}
Also used : StringOption(util.StringOption) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 33 with StringOption

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

the class WorkflowBuilder method setAnsibleResources.

private static void setAnsibleResources() {
    final CustomServicesPrimitiveResourceList customServicesPrimitiveResourceList = getCatalogClient().customServicesPrimitives().getPrimitiveResourcesByType(StepType.LOCAL_ANSIBLE.toString(), null);
    final List<StringOption> ansibleResourceNames = new ArrayList<StringOption>();
    if (null != customServicesPrimitiveResourceList.getResources()) {
        for (final NamedRelatedResourceRep resourceRep : customServicesPrimitiveResourceList.getResources()) {
            ansibleResourceNames.add(new StringOption(resourceRep.getId().toString(), resourceRep.getName()));
        }
    }
    renderArgs.put("ansibleResourceNames", ansibleResourceNames);
}
Also used : CustomServicesPrimitiveResourceList(com.emc.storageos.model.customservices.CustomServicesPrimitiveResourceList) StringOption(util.StringOption) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 34 with StringOption

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

the class ComputeSystems method edit.

public static void edit(String id) {
    try {
        addReferenceData();
        ComputeSystemRestRep computeSystem = ComputeSystemUtils.getComputeSystem(id);
        if (computeSystem != null) {
            if (computeSystem.getVlans() != null) {
                List<StringOption> vlanOptions = new ArrayList<StringOption>();
                vlanOptions.add(VlanListTypes.option(VlanListTypes.NO_OSINSTALL_NONE));
                List<String> vlanList = new ArrayList<String>(Arrays.asList(computeSystem.getVlans().split(",")));
                for (String vlan : vlanList) {
                    vlanOptions.add(VlanListTypes.option(vlan));
                }
                renderArgs.put("computeSystemVlanList", vlanOptions);
            }
            List<StringOption> computeImageServerOptions = new ArrayList<StringOption>();
            computeImageServerOptions.add(ComputeImageServerListTypes.option(ComputeImageServerListTypes.NO_COMPUTE_IMAGE_SERVER_NONE));
            List<ComputeImageServerRestRep> computeImageServersList = ComputeImageServerUtils.getComputeImageServers();
            if (computeImageServersList != null) {
                List<String> computeImageServersArrayList = new ArrayList<String>();
                for (ComputeImageServerRestRep cisrr : computeImageServersList) {
                    if (cisrr.getComputeImageServerStatus().equalsIgnoreCase(AVAILABLE)) {
                        computeImageServersArrayList.add(cisrr.getName());
                    }
                }
                for (String imageServerId : computeImageServersArrayList) {
                    computeImageServerOptions.add(ComputeImageServerListTypes.option(imageServerId));
                }
                renderArgs.put("availableComputeImageServersList", computeImageServerOptions);
            }
            ComputeSystemForm computeSystems = new ComputeSystemForm(computeSystem);
            render("@edit", computeSystems);
        } else {
            flash.error(MessagesUtils.get(UNKNOWN, id));
            list();
        }
    } catch (Exception e) {
        flashException(e);
        list();
    }
}
Also used : StringOption(util.StringOption) ArrayList(java.util.ArrayList) ComputeSystemRestRep(com.emc.storageos.model.compute.ComputeSystemRestRep) Common.flashException(controllers.Common.flashException) URISyntaxException(java.net.URISyntaxException) FlashException(controllers.util.FlashException) ComputeImageServerRestRep(com.emc.storageos.model.compute.ComputeImageServerRestRep)

Example 35 with StringOption

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

the class ComputeSystems method create.

public static void create() {
    addReferenceData();
    ComputeSystemForm computeSystems = new ComputeSystemForm();
    // put all "initial create only" defaults here rather than field
    // initializers
    List<ComputeImageServerRestRep> computeImageServersList = ComputeImageServerUtils.getComputeImageServers();
    if (computeImageServersList != null) {
        List<StringOption> computeImageServerOptions = new ArrayList<StringOption>();
        List<String> computeImageServersArrayList = new ArrayList<String>();
        computeImageServerOptions.add(ComputeImageServerListTypes.option(ComputeImageServerListTypes.NO_COMPUTE_IMAGE_SERVER_NONE));
        for (ComputeImageServerRestRep cisrr : computeImageServersList) {
            if (cisrr.getComputeImageServerStatus().equalsIgnoreCase(AVAILABLE)) {
                computeImageServersArrayList.add(cisrr.getName());
            }
        }
        for (String imageServerId : computeImageServersArrayList) {
            computeImageServerOptions.add(ComputeImageServerListTypes.option(imageServerId));
        }
        renderArgs.put("availableComputeImageServersList", computeImageServerOptions);
    }
    computeSystems.portNumber = getDefaultPort(DefaultComputeSystemPortMap.port443);
    computeSystems.useSSL = true;
    render("@edit", computeSystems);
}
Also used : StringOption(util.StringOption) ArrayList(java.util.ArrayList) ComputeImageServerRestRep(com.emc.storageos.model.compute.ComputeImageServerRestRep)

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