Search in sources :

Example 1 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 2 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)

Example 3 with StorageSystemRestRep

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

the class StorageSystemService method getStorageSystem.

/**
 * Get information about the registered storage system with the passed id.
 *
 * @param id the URN of a ViPR storage system.
 *
 * @brief Show storage system
 * @return A reference to a StorageSystemRestRep
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public StorageSystemRestRep getStorageSystem(@PathParam("id") URI id) {
    ArgValidator.checkFieldUriType(id, StorageSystem.class, "id");
    StorageSystem system = queryResource(id);
    StorageSystemRestRep restRep = map(system);
    restRep.setNumResources(getNumResources(system, _dbClient));
    return restRep;
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 4 with StorageSystemRestRep

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

the class VirtualDataCenterProvider method getUnexportedIngestionMethod.

@Asset("unexportedIngestionMethod")
@AssetDependencies({ "unmanagedBlockStorageSystem" })
public List<AssetOption> getUnexportedIngestionMethod(AssetOptionsContext ctx, URI storageSystemId) {
    ViPRCoreClient client = api(ctx);
    StorageSystemRestRep storageSystemRestRep = client.storageSystems().get(storageSystemId);
    List<AssetOption> options = Lists.newArrayList();
    options.add(newAssetOption(IngestionMethodEnum.FULL.toString(), "unmanagedVolume.ingestMethod.full"));
    if (BlockProviderUtils.isVplex(storageSystemRestRep)) {
        options.add(newAssetOption(IngestionMethodEnum.VIRTUAL_VOLUMES_ONLY.toString(), "unmanagedVolume.ingestMethod.virtualVolumesOnly"));
    }
    return options;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 5 with StorageSystemRestRep

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

the class CreateExport method isExportForHpuxOnVmax.

private boolean isExportForHpuxOnVmax() {
    // get host list
    List<HostRestRep> hosts = new ArrayList<HostRestRep>();
    if (clusterId != null) {
        hosts = ComputeUtils.getHostsInCluster(clusterId);
    } else {
        Host host = BlockStorageUtils.getHost(hostId);
        HostRestRep hostRestRep = HostMapper.map(host);
        hosts = Lists.newArrayList(hostRestRep);
    }
    // find if its a HPUX host
    boolean hasHPUX = false;
    for (HostRestRep host : hosts) {
        if (host.getType() != null && (host.getType().equalsIgnoreCase(Host.HostType.HPUX.toString()))) {
            hasHPUX = true;
            break;
        }
    }
    if (!hasHPUX) {
        return false;
    }
    // VMAX
    for (URI volumeId : volumeIds) {
        BlockObjectRestRep volume = BlockStorageUtils.getVolume(volumeId);
        URI storageURI = volume.getStorageController();
        StorageSystemRestRep storageSystem = BlockStorageUtils.getStorageSystem(storageURI);
        if (StringUtils.equals(VMAX, storageSystem.getSystemType())) {
            return true;
        }
    }
    return false;
}
Also used : HostRestRep(com.emc.storageos.model.host.HostRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ArrayList(java.util.ArrayList) Host(com.emc.storageos.db.client.model.Host) URI(java.net.URI) BlockObjectRestRep(com.emc.storageos.model.block.BlockObjectRestRep)

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