use of com.iwave.ext.netapp.model.ExportsRuleInfo in project coprhd-controller by CoprHD.
the class MiscTests method test2.
@Test
public void test2() {
// NaElement result = server.invoke("nfs-exportfs-list-rules");
// NetAppUtils.output(result);
List<ExportsRuleInfo> bla = netAppFacade.listNFSExportRules(null);
for (ExportsRuleInfo exportsRuleInfo : bla) {
System.out.println("Pathname: " + exportsRuleInfo.getPathname());
System.out.println("Actual Pathname: " + exportsRuleInfo.getActualPathname());
for (SecurityRuleInfo securityRuleInfo : exportsRuleInfo.getSecurityRuleInfos()) {
System.out.println(" -- anon: " + securityRuleInfo.getAnon());
System.out.println(" -- nosuid: " + securityRuleInfo.getNosuid());
System.out.println(" -- sec-flavor: " + securityRuleInfo.getSecFlavor());
for (ExportsHostnameInfo exportsHostnameInfo : securityRuleInfo.getReadOnly()) {
System.out.println(" ---- ReadOnly: " + exportsHostnameInfo.getAllHosts() + " " + exportsHostnameInfo.getName() + " " + exportsHostnameInfo.getNegate());
}
for (ExportsHostnameInfo exportsHostnameInfo : securityRuleInfo.getReadWrite()) {
System.out.println(" ---- ReadWrite: " + exportsHostnameInfo.getAllHosts() + " " + exportsHostnameInfo.getName() + " " + exportsHostnameInfo.getNegate());
}
for (ExportsHostnameInfo exportsHostnameInfo : securityRuleInfo.getRoot()) {
System.out.println(" ---- Root: " + exportsHostnameInfo.getAllHosts() + " " + exportsHostnameInfo.getName() + " " + exportsHostnameInfo.getNegate());
}
}
}
}
use of com.iwave.ext.netapp.model.ExportsRuleInfo in project coprhd-controller by CoprHD.
the class NetAppClusterApi method deleteNFS.
public Boolean deleteNFS(String volName) throws NetAppCException {
String exportPath = volName;
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
if (volName != null && !volName.isEmpty() && !volName.startsWith("/")) {
exportPath = "/" + volName;
}
List<ExportsRuleInfo> exportRules = listNFSExportRules(volName);
if (exportRules.isEmpty()) {
_logger.info("Export doesn't exist on the array to delete {}", exportPath);
return true;
}
List<String> deletedPaths = netAppClusterFacade.deleteNFSShare(exportPath, false);
if ((deletedPaths == null) || (1 >= deletedPaths.size())) {
_logger.error("exportPath deletion failed");
return false;
}
return true;
} catch (Exception e) {
throw NetAppCException.exceptions.deleteNFSFailed(volName, _ipAddress, e.getMessage());
}
}
Aggregations