Search in sources :

Example 31 with VNXeBase

use of com.emc.storageos.vnxe.models.VNXeBase in project coprhd-controller by CoprHD.

the class ApiClientTest method exportLun.

// @Test
public void exportLun() {
    String lunId = "sv_1";
    VNXeHostInitiator init = new VNXeHostInitiator();
    init.setChapUserName("iqn.1998-01.com.vmware:lgly6193-7ae20d76");
    init.setType(HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI);
    init.setName("lgly6193.lss.emc.com");
    List<VNXeHostInitiator> inits = new ArrayList<VNXeHostInitiator>();
    inits.add(init);
    VNXeBase vnxehost = apiClient.prepareHostsForExport(inits);
    VNXeExportResult result = apiClient.exportLun(vnxehost, lunId, null);
    System.out.println(result.getHlu());
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ArrayList(java.util.ArrayList) VNXeHostInitiator(com.emc.storageos.vnxe.models.VNXeHostInitiator) VNXeExportResult(com.emc.storageos.vnxe.models.VNXeExportResult)

Example 32 with VNXeBase

use of com.emc.storageos.vnxe.models.VNXeBase in project coprhd-controller by CoprHD.

the class ApiClientTest method unexportLun.

// @Test
public void unexportLun() {
    String lunId = "sv_26";
    VNXeHostInitiator init = new VNXeHostInitiator();
    init.setChapUserName("iqn.1998-01.com.vmware:lgly6193-7ae20d76");
    init.setType(HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI);
    init.setName("lgly6193.lss.emc.com");
    List<VNXeHostInitiator> inits = new ArrayList<VNXeHostInitiator>();
    inits.add(init);
    VNXeBase vnxehost = apiClient.prepareHostsForExport(inits);
    apiClient.unexportLun(vnxehost.getId(), lunId);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ArrayList(java.util.ArrayList) VNXeHostInitiator(com.emc.storageos.vnxe.models.VNXeHostInitiator)

Example 33 with VNXeBase

use of com.emc.storageos.vnxe.models.VNXeBase in project coprhd-controller by CoprHD.

the class FileSystemActionRequestTest method createFileSystem.

@Test
public void createFileSystem() {
    CreateFileSystemParam parm = new CreateFileSystemParam();
    parm.setName("test-file-03");
    FileSystemParam fsParm = new FileSystemParam();
    fsParm.setIsThinEnabled(true);
    VNXeBase nasServer = new VNXeBase();
    nasServer.setId("nas_1");
    fsParm.setNasServer(nasServer);
    VNXeBase pool = new VNXeBase();
    pool.setId("pool_1");
    fsParm.setPool(pool);
    fsParm.setSize(2200000000L);
    fsParm.setSupportedProtocols(0);
    fsParm.setIsCacheDisabled(true);
    fsParm.setSupportedProtocols(VNXeFSSupportedProtocolEnum.NFS_CIFS.getValue());
    parm.setFsParameters(fsParm);
    FileSystemActionRequest req = new FileSystemActionRequest(_client);
    VNXeCommandJob response = null;
    try {
        response = req.createFileSystemAsync(parm);
    } catch (VNXeException e) {
        // TODO Auto-generated catch block
        logger.error("VNXeException occured", e);
    }
    System.out.println(response.getId() + "state: " + response.getState());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemParam(com.emc.storageos.vnxe.models.FileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) VNXeException(com.emc.storageos.vnxe.VNXeException) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) Test(org.junit.Test)

Example 34 with VNXeBase

use of com.emc.storageos.vnxe.models.VNXeBase in project coprhd-controller by CoprHD.

the class FileSystemActionRequestTest method removeNfsShare.

// @Test
public void removeNfsShare() {
    ModifyFileSystemParam parm = new ModifyFileSystemParam();
    NfsShareDeleteParam nfsShareParm = new NfsShareDeleteParam();
    VNXeBase nfs = new VNXeBase();
    nfs.setId("NFSShare_1");
    nfsShareParm.setNfsShare(nfs);
    List<NfsShareDeleteParam> shares = new ArrayList<NfsShareDeleteParam>();
    shares.add(nfsShareParm);
    parm.setNfsShareDelete(shares);
    FileSystemActionRequest req = new FileSystemActionRequest(_client);
    VNXeCommandJob job = req.modifyFileSystemAsync(parm, "res_4");
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) NfsShareDeleteParam(com.emc.storageos.vnxe.models.NfsShareDeleteParam) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ArrayList(java.util.ArrayList) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam)

Example 35 with VNXeBase

use of com.emc.storageos.vnxe.models.VNXeBase in project coprhd-controller by CoprHD.

the class VNXUnityUnManagedObjectDiscoverer method createExportRules.

private UnManagedFileExportRule createExportRules(URI umfsId, VNXeApiClient apiClient, VNXeNfsShare export, UnManagedFileExportRule unManagedExpRule, String mountPath, String mountPoint, String nfsShareId, String storagePort) {
    StringSet roHosts = new StringSet();
    if (export.getReadOnlyHosts() != null && !export.getReadOnlyHosts().isEmpty()) {
        for (VNXeBase roHost : export.getReadOnlyHosts()) {
            roHosts.add(apiClient.getHostById(roHost.getId()).getName());
        }
        unManagedExpRule.setReadOnlyHosts(roHosts);
    }
    StringSet rwHosts = new StringSet();
    if (export.getReadWriteHosts() != null && !export.getReadWriteHosts().isEmpty()) {
        for (VNXeBase rwHost : export.getReadWriteHosts()) {
            rwHosts.add(apiClient.getHostById(rwHost.getId()).getName());
        }
        unManagedExpRule.setReadWriteHosts(rwHosts);
    }
    StringSet rootHosts = new StringSet();
    if (export.getRootAccessHosts() != null && !export.getRootAccessHosts().isEmpty()) {
        for (VNXeBase rootHost : export.getRootAccessHosts()) {
            rootHosts.add(apiClient.getHostById(rootHost.getId()).getName());
        }
        unManagedExpRule.setRootHosts(rootHosts);
    }
    unManagedExpRule.setAnon(ROOT_USER_ACCESS);
    unManagedExpRule.setExportPath(export.getPath());
    unManagedExpRule.setFileSystemId(umfsId);
    unManagedExpRule.setSecFlavor(SECURITY_FLAVOR);
    unManagedExpRule.setMountPoint(mountPoint);
    unManagedExpRule.setExportPath(mountPath);
    unManagedExpRule.setDeviceExportId(nfsShareId);
    unManagedExpRule.setLabel(export.getName());
    return unManagedExpRule;
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) StringSet(com.emc.storageos.db.client.model.StringSet)

Aggregations

VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)71 ArrayList (java.util.ArrayList)39 URI (java.net.URI)17 HashMap (java.util.HashMap)14 LunGroupModifyParam (com.emc.storageos.vnxe.models.LunGroupModifyParam)13 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)12 VNXeHostInitiator (com.emc.storageos.vnxe.models.VNXeHostInitiator)11 HashSet (java.util.HashSet)11 List (java.util.List)11 StoragePort (com.emc.storageos.db.client.model.StoragePort)9 VNXeException (com.emc.storageos.vnxe.VNXeException)9 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)9 ConsistencyGroupRequests (com.emc.storageos.vnxe.requests.ConsistencyGroupRequests)9 LunGroupRequests (com.emc.storageos.vnxe.requests.LunGroupRequests)9 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)8 BlockHostAccess (com.emc.storageos.vnxe.models.BlockHostAccess)8 LunParam (com.emc.storageos.vnxe.models.LunParam)8 ModifyFileSystemParam (com.emc.storageos.vnxe.models.ModifyFileSystemParam)8 Initiator (com.emc.storageos.db.client.model.Initiator)7 VNXeHost (com.emc.storageos.vnxe.models.VNXeHost)7