Search in sources :

Example 1 with SMISProviderRestRep

use of com.emc.storageos.model.smis.SMISProviderRestRep 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 SMISProviderRestRep

use of com.emc.storageos.model.smis.SMISProviderRestRep in project coprhd-controller by CoprHD.

the class ApiTest method createSMISProvider.

/**
 * Create a VNXBlock SMISProvider.
 *
 * @return SMISProviderRestRep : provider.
 * @throws InterruptedException
 */
private SMISProviderRestRep createSMISProvider() throws InterruptedException {
    // vnxblock
    SMISProviderCreateParam providerParam = new SMISProviderCreateParam();
    providerParam.setName("VNXBlock_Provider");
    providerParam.setIpAddress(EnvConfig.get("sanity", "smis.ip"));
    providerParam.setPortNumber(5988);
    providerParam.setUserName("admin");
    providerParam.setPassword("#1Password");
    providerParam.setUseSSL(false);
    TaskResourceRep task = rZAdmin.path("/vdc/smis-providers").post(TaskResourceRep.class, providerParam);
    String opId = task.getOpId();
    Assert.assertNotNull(opId);
    NamedRelatedResourceRep providerLink = task.getResource();
    Assert.assertNotNull(providerLink);
    // wait upto ~3 minute for SMIS provider scan
    int checkCount = 18;
    String status;
    do {
        Thread.sleep(10000);
        TaskResourceRep taskResp = rZAdmin.path(String.format("/vdc/smis-providers/%s/tasks/%s", providerLink.getId(), opId)).get(TaskResourceRep.class);
        status = taskResp.getState();
    } while (status.equals("pending") && checkCount-- > 0);
    if (!status.equals("ready")) {
        Assert.assertTrue("Failed to create SMIS provider: time out", false);
    }
    SMISProviderRestRep provider = rZAdmin.path(String.format("/vdc/smis-providers/%s", providerLink.getId())).get(SMISProviderRestRep.class);
    Assert.assertNotNull(provider);
    _log.info("Scanned SMI-S Provider : " + providerLink.getId());
    // Discover SMIS Provider:
    TaskList tasks = rZAdmin.path("/vdc/storage-systems/discover").post(TaskList.class, providerParam);
    // wait upto ~10 minute for discover
    checkCount = 60;
    for (TaskResourceRep taskRep : tasks.getTaskList()) {
        opId = taskRep.getOpId();
        Assert.assertNotNull(opId);
        providerLink = taskRep.getResource();
        Assert.assertNotNull(providerLink);
        boolean success = monitorDiscoveredObjectTask(StorageSystemRestRep.class, taskRep);
        if (!success) {
            Assert.assertTrue("Failed to discover system : " + providerLink.getId().toString(), false);
        }
    }
    _log.info(" Discover for all devices is completed");
    return provider;
}
Also used : SMISProviderCreateParam(com.emc.storageos.model.smis.SMISProviderCreateParam) SMISProviderRestRep(com.emc.storageos.model.smis.SMISProviderRestRep) TaskList(com.emc.storageos.model.TaskList) TaskResourceRep(com.emc.storageos.model.TaskResourceRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 3 with SMISProviderRestRep

use of com.emc.storageos.model.smis.SMISProviderRestRep in project coprhd-controller by CoprHD.

the class SystemsMapper method mapStorageProviderToSMISRep.

@Deprecated
public static SMISProviderRestRep mapStorageProviderToSMISRep(StorageProvider from) {
    if (from == null) {
        return null;
    }
    SMISProviderRestRep to = new SMISProviderRestRep();
    mapDataObjectFields(from, to);
    // of type base URI generation.
    try {
        to.setLink(new RestLinkRep("self", RestLinkFactory.simpleServiceLink(ResourceTypeEnum.SMIS_PROVIDER, from.getId())));
    } catch (URISyntaxException e) {
    // impossible to get exception here.
    }
    to.setIPAddress(from.getIPAddress());
    to.setPortNumber(from.getPortNumber());
    if (from.getStorageSystems() != null) {
        for (String system : from.getStorageSystems()) {
            to.getStorageSystems().add(toRelatedResource(ResourceTypeEnum.STORAGE_SYSTEM, URI.create(system)));
        }
    }
    to.setDescription(from.getDescription());
    to.setManufacturer(from.getManufacturer());
    to.setVersionString(from.getVersionString());
    to.setProviderID(from.getProviderID());
    to.setConnectionStatus(from.getConnectionStatus());
    to.setUserName(from.getUserName());
    to.setUseSSL(from.getUseSSL());
    to.setScanStatus(from.getScanStatus());
    to.setLastScanStatusMessage(from.getLastScanStatusMessage());
    to.setLastScanTime(from.getLastScanTime());
    to.setNextScanTime(from.getNextScanTime());
    to.setSuccessScanTime(from.getSuccessScanTime());
    to.setCompatibilityStatus(from.getCompatibilityStatus());
    to.setRegistrationStatus(from.getRegistrationStatus());
    return to;
}
Also used : SMISProviderRestRep(com.emc.storageos.model.smis.SMISProviderRestRep) RestLinkRep(com.emc.storageos.model.RestLinkRep) URISyntaxException(java.net.URISyntaxException)

Aggregations

SMISProviderRestRep (com.emc.storageos.model.smis.SMISProviderRestRep)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 RestLinkRep (com.emc.storageos.model.RestLinkRep)1 TaskList (com.emc.storageos.model.TaskList)1 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)1 SMISProviderCreateParam (com.emc.storageos.model.smis.SMISProviderCreateParam)1 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)1 URISyntaxException (java.net.URISyntaxException)1