use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.
the class NetAppApi method modifyCIFSShareAcl.
public Boolean modifyCIFSShareAcl(String shareName, List<CifsAcl> acls) throws NetAppException {
try {
if (netAppFacade == null) {
_logger.warn("Invalid Facade found {} creating now...", netAppFacade);
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
_logger.warn("Facade created : {} ", netAppFacade);
}
for (CifsAcl acl : acls) {
acl.setShareName(shareName);
netAppFacade.setCIFSAcl(acl);
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppException.exceptions.modifyCifsShareAclFailed(shareName, e.getMessage());
}
return true;
}
use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.
the class NetAppApi method listVFilers.
public List<VFilerInfo> listVFilers(String name) {
List<VFilerInfo> vFilers = null;
try {
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
vFilers = netAppFacade.listVFilers();
} catch (Exception e) {
_logger.info("No vFilers discovered.");
}
return vFilers;
}
use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.
the class NetAppApi method systemVer.
public Map<String, String> systemVer() throws NetAppException {
try {
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
Map<String, String> info = netAppFacade.systemVersion();
Map<String, String> versionInfo = new HashMap<String, String>();
String version = info.get("version");
// Sample NetApp Release 8.1.2 7-Mode: Tue Oct 30 19:56:51 PDT 2012
// Sample 8.1.1xsdf
String[] versInfo = version.split(" ");
String[] parseVersion = versInfo[2].split("\\.");
String convertedVers = "";
for (int i = 0; i < parseVersion.length; i++) {
_logger.info(parseVersion[i]);
Number num = ((Number) NumberFormat.getInstance().parse(parseVersion[i])).intValue();
convertedVers = convertedVers + num.toString() + ".";
}
convertedVers = convertedVers.substring(0, convertedVers.length() - 1);
_logger.info("Converted Version info {}", convertedVers);
versionInfo.put("version", convertedVers);
versionInfo.put("mode", versInfo[3]);
versionInfo.put("is-clustered", info.get("is-clustered"));
return versionInfo;
} catch (Exception e) {
throw new NetAppException("Exception listing the system information on NTAP array " + e.getMessage());
}
}
use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.
the class NetAppApi method exportNewFS.
public Boolean exportNewFS(String exportPath, List<ExportRule> exportRules) throws NetAppException {
try {
List<String> fsList = null;
if (netAppFacade == null) {
_logger.warn("Invalid Facade found {} creating now...", netAppFacade);
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
_logger.warn("Facade created : {} ", netAppFacade);
}
_logger.info("NetApp Inputs for exportNewFS exportPath: {} , exportRules size {}", exportPath, exportRules.size());
List<com.iwave.ext.netapp.utils.ExportRule> netAppCompatableRules = new ArrayList<>();
for (ExportRule rule : exportRules) {
com.iwave.ext.netapp.utils.ExportRule netAppRule = new com.iwave.ext.netapp.utils.ExportRule();
copyPropertiesToSave(netAppRule, rule);
netAppCompatableRules.add(netAppRule);
}
fsList = netAppFacade.addNewNFSShare(exportPath, netAppCompatableRules);
if (fsList.isEmpty()) {
return false;
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppException.exceptions.exportFSFailed(exportPath, exportPath, e.getMessage());
}
return true;
}
Aggregations