Search in sources :

Example 61 with VNXeBase

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

the class VNXeApiClient method removeCifsShare.

/**
 * Delete cifsShare
 *
 * @param cifsShareId
 *            cifsShare Id
 * @param fsId
 *            file system Id
 * @return VNXeCommandJob
 */
public VNXeCommandJob removeCifsShare(String cifsShareId, String fsId) {
    VNXeCommandJob job = null;
    _logger.info("deleting cifs share" + cifsShareId);
    FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
    VNXeFileSystem fs = fsRequest.get();
    if (fs == null) {
        _logger.info("Could not find file system in the vxne");
        throw VNXeException.exceptions.vnxeCommandFailed("Could not find file system in the vnxe for: " + fsId);
    }
    String resourceId = fs.getStorageResource().getId();
    ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
    // set cifsShare delete parm
    CifsShareDeleteParam deleteParam = new CifsShareDeleteParam();
    VNXeBase share = new VNXeBase();
    share.setId(cifsShareId);
    deleteParam.setCifsShare(share);
    List<CifsShareDeleteParam> deleteList = new ArrayList<CifsShareDeleteParam>();
    deleteList.add(deleteParam);
    modifyFSParm.setCifsShareDelete(deleteList);
    FileSystemActionRequest req = new FileSystemActionRequest(_khClient);
    job = req.modifyFileSystemAsync(modifyFSParm, resourceId);
    return job;
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) FileSystemRequest(com.emc.storageos.vnxe.requests.FileSystemRequest) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) CifsShareDeleteParam(com.emc.storageos.vnxe.models.CifsShareDeleteParam) VNXeFileSystem(com.emc.storageos.vnxe.models.VNXeFileSystem) ArrayList(java.util.ArrayList) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemActionRequest(com.emc.storageos.vnxe.requests.FileSystemActionRequest)

Example 62 with VNXeBase

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

the class VNXeApiClient method createLun.

/**
 * Create standalone lun
 *
 * @param name
 * @param poolId
 * @param size
 * @param isThin
 * @param tieringPolicy
 * @param lunGroupId
 * @return
 */
public VNXeCommandJob createLun(String name, String poolId, Long size, boolean isThin, String tieringPolicy) {
    LunParam lunParam = new LunParam();
    lunParam.setIsThinEnabled(isThin);
    lunParam.setSize(size);
    lunParam.setPool(new VNXeBase(poolId));
    FastVPParam fastVP = new FastVPParam();
    if (tieringPolicy != null && !tieringPolicy.isEmpty()) {
        TieringPolicyEnum tierValue = TieringPolicyEnum.valueOf(tieringPolicy);
        if (tierValue != null) {
            fastVP.setTieringPolicy(tierValue.getValue());
            lunParam.setFastVPParameters(fastVP);
        }
    }
    LunCreateParam createParam = new LunCreateParam();
    createParam.setName(name);
    createParam.setLunParameters(lunParam);
    BlockLunRequests req = new BlockLunRequests(_khClient);
    return req.createLun(createParam);
}
Also used : TieringPolicyEnum(com.emc.storageos.vnxe.models.StorageResource.TieringPolicyEnum) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunParam(com.emc.storageos.vnxe.models.LunParam) FastVPParam(com.emc.storageos.vnxe.models.FastVPParam) BlockLunRequests(com.emc.storageos.vnxe.requests.BlockLunRequests) LunCreateParam(com.emc.storageos.vnxe.models.LunCreateParam)

Example 63 with VNXeBase

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

the class VNXeApiClient method createInitiator.

/**
 * Create host initiator in the array
 *
 * @param inits
 * @param hostId
 */
public void createInitiator(VNXeHostInitiator newInit, String hostId) {
    HostInitiatorCreateParam initCreateParam = new HostInitiatorCreateParam();
    VNXeBase host = new VNXeBase(hostId);
    initCreateParam.setHost(host);
    if (newInit.getType() == HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI) {
        initCreateParam.setInitiatorType(HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI.getValue());
        initCreateParam.setInitiatorWWNorIqn(newInit.getChapUserName());
        initCreateParam.setChapUser(newInit.getChapUserName());
    } else {
        initCreateParam.setInitiatorType(HostInitiatorTypeEnum.INITIATOR_TYPE_FC.getValue());
        initCreateParam.setInitiatorWWNorIqn(newInit.getInitiatorId());
    }
    HostInitiatorRequest req = new HostInitiatorRequest(_khClient);
    req.createHostInitiator(initCreateParam);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) HostInitiatorCreateParam(com.emc.storageos.vnxe.models.HostInitiatorCreateParam) DeleteHostInitiatorRequest(com.emc.storageos.vnxe.requests.DeleteHostInitiatorRequest) HostInitiatorRequest(com.emc.storageos.vnxe.requests.HostInitiatorRequest)

Example 64 with VNXeBase

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

the class VNXeApiClient method createLunSnap.

/**
 * Create lun snapshot
 *
 * @param lunID
 *            lun id
 * @param name
 *            snapshot name
 * @return VNXeCommandJob
 */
public VNXeCommandJob createLunSnap(String lunID, String name) {
    _logger.info("creating lun snap:" + lunID);
    LunSnapCreateParam parm = new LunSnapCreateParam();
    parm.setStorageResource(new VNXeBase(lunID));
    parm.setName(name);
    LunSnapRequests req = new LunSnapRequests(_khClient);
    return req.createLunSnap(parm);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) LunSnapRequests(com.emc.storageos.vnxe.requests.LunSnapRequests) LunSnapCreateParam(com.emc.storageos.vnxe.models.LunSnapCreateParam)

Example 65 with VNXeBase

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

the class VNXeApiClient method createCIFSShare.

/**
 * create cifsShare
 */
public VNXeCommandJob createCIFSShare(String fsId, String cifsName, String permission, String path) throws VNXeException {
    _logger.info("creating CIFS share:" + fsId);
    FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
    VNXeFileSystem fs = fsRequest.get();
    if (fs == null) {
        _logger.info("Could not find file system in the vxne");
        throw VNXeException.exceptions.vnxeCommandFailed("Could not find file system in the vnxe for: " + fsId);
    }
    String resourceId = fs.getStorageResource().getId();
    ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
    CifsShareParam cifsParam = new CifsShareParam();
    /*
         * CifsShareACE ace = new CifsShareACE();
         * ace.setAccessLevel(4);
         * ace.setAccessType(1);
         * ace.setSid("S-1-5-21-3623811015-3361044348-30300820-1014");
         * List<CifsShareACE> aceList = new ArrayList<CifsShareACE>();
         * aceList.add(ace);
         * cifsParam.setAddACE(aceList);
         */
    cifsParam.setIsACEEnabled(false);
    if (permission != null && !permission.isEmpty() && permission.equalsIgnoreCase(AccessEnum.READ.name())) {
        cifsParam.setIsReadOnly(true);
    } else {
        cifsParam.setIsReadOnly(false);
    }
    CifsShareCreateParam cifsCreate = new CifsShareCreateParam();
    cifsCreate.setName(cifsName);
    cifsCreate.setPath(path);
    _logger.info("Creating VNXe CIFS share by name: {} for path: {}", cifsName, path);
    List<VNXeCifsServer> cifsServers = getCifsServers(fs.getNasServer().getId());
    if (cifsServers == null || cifsServers.isEmpty()) {
        throw VNXeException.exceptions.vnxeCommandFailed("The nasServer is not configured to support CIFS");
    }
    VNXeBase cifsServer = new VNXeBase();
    cifsServer.setId(cifsServers.get(0).getId());
    cifsCreate.setCifsServer(cifsServer);
    cifsCreate.setCifsShareParameters(cifsParam);
    netBios = cifsServers.get(0).getNetbiosName();
    List<CifsShareCreateParam> cifsCreateList = new ArrayList<CifsShareCreateParam>();
    cifsCreateList.add(cifsCreate);
    modifyFSParm.setCifsShareCreate(cifsCreateList);
    FileSystemActionRequest req = new FileSystemActionRequest(_khClient);
    return req.modifyFileSystemAsync(modifyFSParm, resourceId);
}
Also used : CifsShareParam(com.emc.storageos.vnxe.models.CifsShareParam) CifsShareCreateParam(com.emc.storageos.vnxe.models.CifsShareCreateParam) FileSystemRequest(com.emc.storageos.vnxe.requests.FileSystemRequest) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) VNXeFileSystem(com.emc.storageos.vnxe.models.VNXeFileSystem) VNXeCifsServer(com.emc.storageos.vnxe.models.VNXeCifsServer) ArrayList(java.util.ArrayList) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemActionRequest(com.emc.storageos.vnxe.requests.FileSystemActionRequest)

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