Search in sources :

Example 6 with Query

use of com.emc.nas.vnxfile.xmlapi.Query in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method fetchDataMoverInfo.

public InputStream fetchDataMoverInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating data mover info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        MoverQueryParams moverQuery = new MoverQueryParams();
        MoverQueryParams.AspectSelection selection = new MoverQueryParams.AspectSelection();
        selection.setMovers(true);
        moverQuery.setAspectSelection(selection);
        query.getQueryRequestChoice().add(moverQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(moverQuery, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for datamover info", jaxbException.getCause());
    }
    return iStream;
}
Also used : MoverQueryParams(com.emc.nas.vnxfile.xmlapi.MoverQueryParams) Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) AspectSelection(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection) JAXBException(javax.xml.bind.JAXBException)

Example 7 with Query

use of com.emc.nas.vnxfile.xmlapi.Query in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method fetchStoragePoolInfo.

/**
 * Create VNX Information input request xml and return its stream after
 * marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchStoragePoolInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating VNX StorgePool Query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        StoragePoolQueryParams spParams = new StoragePoolQueryParams();
        query.getQueryRequestChoice().add(spParams);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(spParams, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for celerra system info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) StoragePoolQueryParams(com.emc.nas.vnxfile.xmlapi.StoragePoolQueryParams) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException)

Example 8 with Query

use of com.emc.nas.vnxfile.xmlapi.Query in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method fetchSelectedFileSystemInfoWithoutSize.

/**
 * Create Filesystem information input XML request and returns stream after marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchSelectedFileSystemInfoWithoutSize(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating filesystem info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        FileSystemQueryParams fsQueryParam = new FileSystemQueryParams();
        AspectSelection selection = new AspectSelection();
        selection.setFileSystems(true);
        fsQueryParam.setAspectSelection(selection);
        FileSystemAlias fsAlias = new FileSystemAlias();
        fsAlias.setName((String) keyMap.get(VNXFileConstants.FILESYSTEM_NAME));
        _logger.info("Querying mount info for file system {}", fsAlias.getName());
        fsQueryParam.setAlias(fsAlias);
        query.getQueryRequestChoice().add(fsQueryParam);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(fsQueryParam, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for fileSystem info", jaxbException.getCause());
    }
    return iStream;
}
Also used : FileSystemQueryParams(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams) Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) AspectSelection(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection) FileSystemAlias(com.emc.nas.vnxfile.xmlapi.FileSystemAlias) JAXBException(javax.xml.bind.JAXBException)

Example 9 with Query

use of com.emc.nas.vnxfile.xmlapi.Query in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method fetchCifsServerInfo.

/**
 * Create CIFS Config XML request and return stream after marhalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @throws com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException
 */
public InputStream fetchCifsServerInfo(final Argument argument, final Map<String, Object> keyMap, // final Boolean moverOrVdm,
int index) throws VNXFilePluginException {
    _logger.info("Creating CIFS Server info Query");
    InputStream iStream = null;
    try {
        _logger.info("Creating CIFS Server info Query for Mover {} {} isVDM? {}", (String) keyMap.get(VNXFileConstants.MOVER_ID) + ":" + (String) keyMap.get(VNXFileConstants.DATAMOVER_NAME), keyMap.get(VNXFileConstants.ISVDM));
        MoverOrVdmRef mover = new MoverOrVdmRef();
        mover.setMover((String) keyMap.get(VNXFileConstants.MOVER_ID));
        mover.setMoverIdIsVdm(Boolean.valueOf((String) keyMap.get(VNXFileConstants.ISVDM)));
        CifsServerQueryParams cifsQuery = new CifsServerQueryParams();
        cifsQuery.setMoverOrVdm(mover);
        Query query = new Query();
        query.getQueryRequestChoice().add(cifsQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(cifsQuery, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for file export info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException) MoverOrVdmRef(com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef) CifsServerQueryParams(com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)

Example 10 with Query

use of com.emc.nas.vnxfile.xmlapi.Query in project coprhd-controller by CoprHD.

the class VNXFileArgsCreator method fetchSelectedFileSystemInfo.

/**
 * Create Filesystem information and FileSystem capcacity input XML request and returns stream after marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchSelectedFileSystemInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating filesystem info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        FileSystemQueryParams fsQueryParam = new FileSystemQueryParams();
        AspectSelection selection = new AspectSelection();
        selection.setFileSystems(true);
        selection.setFileSystemCapacityInfos(true);
        fsQueryParam.setAspectSelection(selection);
        FileSystemAlias fsAlias = new FileSystemAlias();
        fsAlias.setName((String) keyMap.get(VNXFileConstants.FILESYSTEM_NAME));
        fsQueryParam.setAlias(fsAlias);
        query.getQueryRequestChoice().add(fsQueryParam);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(fsQueryParam, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for fileSystem info", jaxbException.getCause());
    }
    return iStream;
}
Also used : FileSystemQueryParams(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams) Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) AspectSelection(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection) FileSystemAlias(com.emc.nas.vnxfile.xmlapi.FileSystemAlias) JAXBException(javax.xml.bind.JAXBException)

Aggregations

Query (com.emc.nas.vnxfile.xmlapi.Query)20 InputStream (java.io.InputStream)20 JAXBException (javax.xml.bind.JAXBException)19 AspectSelection (com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection)10 FileSystemQueryParams (com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams)5 MoverQueryParams (com.emc.nas.vnxfile.xmlapi.MoverQueryParams)4 FileSystemAlias (com.emc.nas.vnxfile.xmlapi.FileSystemAlias)3 CifsServerQueryParams (com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)2 MoverOrVdmRef (com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef)2 APIVersion (com.emc.nas.vnxfile.xmlapi.APIVersion)1 CelerraSystemQueryParams (com.emc.nas.vnxfile.xmlapi.CelerraSystemQueryParams)1 CheckpointQueryParams (com.emc.nas.vnxfile.xmlapi.CheckpointQueryParams)1 MountQueryParams (com.emc.nas.vnxfile.xmlapi.MountQueryParams)1 NfsExportQueryParams (com.emc.nas.vnxfile.xmlapi.NfsExportQueryParams)1 Request (com.emc.nas.vnxfile.xmlapi.Request)1 RequestPacket (com.emc.nas.vnxfile.xmlapi.RequestPacket)1 StoragePoolQueryParams (com.emc.nas.vnxfile.xmlapi.StoragePoolQueryParams)1 TreeQuotaQueryParams (com.emc.nas.vnxfile.xmlapi.TreeQuotaQueryParams)1 UserAccountQueryParams (com.emc.nas.vnxfile.xmlapi.UserAccountQueryParams)1 VdmQueryParams (com.emc.nas.vnxfile.xmlapi.VdmQueryParams)1