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());
}
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);
}
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());
}
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());
}
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;
}
Aggregations