Search in sources :

Example 21 with NetAppFacade

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;
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade) CifsAcl(com.iwave.ext.netapp.model.CifsAcl)

Example 22 with NetAppFacade

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;
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade) VFilerInfo(com.iwave.ext.netapp.VFilerInfo)

Example 23 with NetAppFacade

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());
    }
}
Also used : HashMap(java.util.HashMap) NetAppFacade(com.iwave.ext.netapp.NetAppFacade)

Example 24 with NetAppFacade

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;
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade) ArrayList(java.util.ArrayList) ExportRule(com.emc.storageos.model.file.ExportRule)

Aggregations

NetAppFacade (com.iwave.ext.netapp.NetAppFacade)24 ArrayList (java.util.ArrayList)5 CifsAcl (com.iwave.ext.netapp.model.CifsAcl)4 ExportRule (com.emc.storageos.model.file.ExportRule)2 QuotaStatus (com.iwave.ext.netapp.QuotaCommands.QuotaStatus)2 HashMap (java.util.HashMap)2 NFSSecurityStyle (com.iwave.ext.netapp.NFSSecurityStyle)1 VFilerInfo (com.iwave.ext.netapp.VFilerInfo)1 VolumeOptionType (com.iwave.ext.netapp.VolumeOptionType)1 Qtree (com.iwave.ext.netapp.model.Qtree)1 List (java.util.List)1 Map (java.util.Map)1