Search in sources :

Example 16 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method addAllFlashVirtualArray.

private static void addAllFlashVirtualArray() {
    VirtualArrayForm virtualArray = new VirtualArrayForm();
    virtualArray.name = ALL_FLASH_VARRAY;
    virtualArray.validate("virtualArray");
    if (Validation.hasErrors()) {
        flash.error(MessagesUtils.get(SAVED_ERROR, virtualArray.name));
        list();
    }
    VirtualArrayRestRep varray = virtualArray.save();
    virtualArray.load(varray);
    List<String> ids = Lists.newArrayList();
    for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystems()) {
        // Check if storage system is of type UNITY, VMAX or XtremIO
        if (StringUtils.equals(XTREMIO, storageSystem.getSystemType())) {
            ids.add(storageSystem.getId().toString());
        }
        if (StringUtils.equals(VMAX, storageSystem.getSystemType()) || StringUtils.equals(UNITY, storageSystem.getSystemType())) {
            String modelType = storageSystem.getModel();
            if (modelType != null && (modelType.contains(SUFFIX_ALL_FLASH) || modelType.contains(POWERMAX) || modelType.contains(PMAX))) {
                ids.add(storageSystem.getId().toString());
            }
        }
    }
    addStorageSysVarray(virtualArray.id, ids);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

Example 17 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method availableStoragePoolsJson.

/**
 * Renders the list of storage pools available for the given virtual array as JSON.
 *
 * @param id
 *            the virtual array ID.
 */
public static void availableStoragePoolsJson(String id) {
    List<StoragePoolInfo> items = Lists.newArrayList();
    CachedResources<StorageSystemRestRep> storageSystems = StorageSystemUtils.createCache();
    for (StoragePoolRestRep storagePool : StoragePoolUtils.getStoragePoolsAssignableToVirtualArray(id)) {
        items.add(new StoragePoolInfo(storagePool, storageSystems));
    }
    renderJSON(DataTablesSupport.createJSON(items, params));
}
Also used : StoragePoolInfo(models.datatable.StoragePoolDataTable.StoragePoolInfo) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep)

Example 18 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class FileSystems method getStorageSystemJson.

/**
 * GEt StorageSystem for given fileSystem
 *
 * @param fileSystemId
 */
public static void getStorageSystemJson(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    FileShareRestRep fs = client.fileSystems().get(uri(fileSystemId));
    StorageSystemRestRep sys = client.storageSystems().get(fs.getStorageSystem());
    renderJSON(sys);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep)

Example 19 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class ApiTest method deviceSetup.

private void deviceSetup() throws InterruptedException {
    // Create a isilon device - file
    StorageSystemRestRep isilonDevice = createIsilonDevice();
    // Update the discovered Isilon storage ports to set the transport zone.
    updateAllIsilonPorts(isilonDevice);
    // Create a VNXBlock SMISProvider
    SMISProviderRestRep provider = createSMISProvider();
    // Update the discovered VNX/VMAX storage ports to set the transport zone.
    updateAllVnxAndVmaxPorts(provider);
}
Also used : SMISProviderRestRep(com.emc.storageos.model.smis.SMISProviderRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

Example 20 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class SystemsMapper method map.

public static StorageSystemRestRep map(StorageSystem from) {
    if (from == null) {
        return null;
    }
    StorageSystemRestRep to = new StorageSystemRestRep();
    mapDiscoveredSystemObjectFields(from, to);
    to.setSerialNumber(from.getSerialNumber());
    to.setMajorVersion(from.getMajorVersion());
    to.setMinorVersion(from.getMinorVersion());
    to.setIpAddress(from.getIpAddress());
    to.setSecondaryIPs(from.getSecondaryIPs());
    to.setPortNumber(from.getPortNumber());
    to.setSmisProviderIP(from.getSmisProviderIP());
    to.setSmisPortNumber(from.getSmisPortNumber());
    to.setSmisUseSSL(from.getSmisUseSSL());
    to.setSmisUserName(from.getSmisUserName());
    to.setExportMasks(new StringMapAdapter().marshal(from.getExportMasks()));
    to.setProtocols(from.getProtocols());
    to.setReachableStatus(from.getReachableStatus());
    to.setFirmwareVersion(from.getFirmwareVersion());
    to.setSupportsSoftLimit(from.getSupportSoftLimit());
    to.setSupportsNotificationLimit(from.getSupportNotificationLimit());
    to.setActiveProvider(toRelatedResource(ResourceTypeEnum.SMIS_PROVIDER, from.getActiveProviderURI()));
    if (from.getProviders() != null) {
        for (String provider : from.getProviders()) {
            to.getProviders().add(toRelatedResource(ResourceTypeEnum.SMIS_PROVIDER, URI.create(provider)));
        }
    }
    to.setUsername(from.getUsername());
    to.setModel(from.getModel());
    to.setSupportedProvisioningType(from.getSupportedProvisioningType());
    to.setSupportedAsynchronousActions(from.getSupportedAsynchronousActions());
    to.setMaxResources(from.getMaxResources());
    to.setRemotelyConnectedTo(from.getRemotelyConnectedTo());
    to.setSupportedReplicationTypes(from.getSupportedReplicationTypes());
    to.setAveragePortMetrics(from.getAveragePortMetrics());
    to.setArrayAffinityJobStatus(from.getArrayAffinityStatus());
    to.setLastArrayAffinityStatusMessage(from.getLastArrayAffinityStatusMessage());
    to.setLastArrayAffinityRunTime(from.getLastArrayAffinityRunTime());
    to.setNextArrayAffinityRunTime(from.getNextArrayAffinityRunTime());
    to.setSuccessArrayAffinityTime(from.getSuccessArrayAffinityTime());
    return to;
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StringMapAdapter(com.emc.storageos.model.adapters.StringMapAdapter)

Aggregations

StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)44 URI (java.net.URI)11 ArrayList (java.util.ArrayList)10 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)7 HashSet (java.util.HashSet)7 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)6 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)6 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)5 StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)5 Asset (com.emc.sa.asset.annotation.Asset)4 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)4 AssetOption (com.emc.vipr.model.catalog.AssetOption)4 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)3 StorageProviderRestRep (com.emc.storageos.model.smis.StorageProviderRestRep)3 JsonArray (com.google.gson.JsonArray)3 JsonObject (com.google.gson.JsonObject)3 HashMap (java.util.HashMap)3 GetStorageSystems (com.emc.sa.service.vipr.tasks.GetStorageSystems)2 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)2 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)2