Search in sources :

Example 1 with ObjectDeviceInputOutput

use of com.emc.storageos.volumecontroller.ObjectDeviceInputOutput in project coprhd-controller by CoprHD.

the class ObjectDeviceController method updateBucketACL.

@Override
public void updateBucketACL(URI storage, URI bucket, BucketACLUpdateParams param, String opId) throws InternalException {
    ControllerUtils.setThreadLocalLogData(bucket, opId);
    _log.info("ObjectDeviceController:updateBucketACL Bucket URI : {} ", bucket);
    Bucket bucketObj = _dbClient.queryObject(Bucket.class, bucket);
    StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
    ObjectDeviceInputOutput objectArgs = new ObjectDeviceInputOutput();
    objectArgs.setAllBuckectAcl(param);
    objectArgs.setName(bucketObj.getName());
    objectArgs.setNamespace(bucketObj.getNamespace());
    // Query for existing ACL and setting it.
    objectArgs.setExistingBucketAcl(queryExistingBucketAcl(objectArgs, bucket));
    BiosCommandResult result = getDevice(storageObj.getSystemType()).doUpdateBucketACL(storageObj, bucketObj, objectArgs, param, opId);
    if (result.getCommandPending()) {
        return;
    }
    bucketObj.getOpStatus().updateTaskStatus(opId, result.toOperation());
}
Also used : Bucket(com.emc.storageos.db.client.model.Bucket) ObjectDeviceInputOutput(com.emc.storageos.volumecontroller.ObjectDeviceInputOutput) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 2 with ObjectDeviceInputOutput

use of com.emc.storageos.volumecontroller.ObjectDeviceInputOutput in project coprhd-controller by CoprHD.

the class ObjectDeviceController method deleteBucketACL.

@Override
public void deleteBucketACL(URI storage, URI bucket, String opId) throws InternalException {
    ControllerUtils.setThreadLocalLogData(bucket, opId);
    _log.info("ObjectDeviceController:updateBucketACL Bucket URI : {} ", bucket);
    Bucket bucketObj = _dbClient.queryObject(Bucket.class, bucket);
    StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
    ObjectDeviceInputOutput objectArgs = new ObjectDeviceInputOutput();
    objectArgs.setName(bucketObj.getName());
    objectArgs.setNamespace(bucketObj.getNamespace());
    // Query for existing ACL and setting it for deletion.
    objectArgs.setBucketAclToDelete(queryExistingBucketAcl(objectArgs, bucket));
    BiosCommandResult result = getDevice(storageObj.getSystemType()).doDeleteBucketACL(storageObj, bucketObj, objectArgs, opId);
    if (result.getCommandPending()) {
        return;
    }
    bucketObj.getOpStatus().updateTaskStatus(opId, result.toOperation());
}
Also used : Bucket(com.emc.storageos.db.client.model.Bucket) ObjectDeviceInputOutput(com.emc.storageos.volumecontroller.ObjectDeviceInputOutput) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 3 with ObjectDeviceInputOutput

use of com.emc.storageos.volumecontroller.ObjectDeviceInputOutput in project coprhd-controller by CoprHD.

the class ObjectDeviceController method createBucket.

@Override
public void createBucket(URI storage, URI uriPool, URI bkt, String label, String namespace, Integer retention, Long hardQuota, Long softQuota, String owner, String task) throws ControllerException {
    _log.info("ObjectDeviceController:createBucket Bucket URI : {} ", bkt);
    StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
    Bucket bucketObj = _dbClient.queryObject(Bucket.class, bkt);
    StoragePool stPool = _dbClient.queryObject(StoragePool.class, uriPool);
    ObjectDeviceInputOutput args = new ObjectDeviceInputOutput();
    args.setName(label);
    args.setNamespace(namespace);
    // recommended storage pool
    args.setDevStoragePool(stPool.getNativeId());
    args.setRetentionPeriod(retention);
    args.setBlkSizeHQ(hardQuota);
    args.setNotSizeSQ(softQuota);
    args.setOwner(owner);
    _log.info("ObjectDeviceController:createBucket URI and Type: " + storage.toString() + "   " + storageObj.getSystemType());
    BiosCommandResult result = getDevice(storageObj.getSystemType()).doCreateBucket(storageObj, bucketObj, args, task);
    if (result.getCommandPending()) {
        return;
    }
    bucketObj.getOpStatus().updateTaskStatus(task, result.toOperation());
}
Also used : StoragePool(com.emc.storageos.db.client.model.StoragePool) Bucket(com.emc.storageos.db.client.model.Bucket) ObjectDeviceInputOutput(com.emc.storageos.volumecontroller.ObjectDeviceInputOutput) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 4 with ObjectDeviceInputOutput

use of com.emc.storageos.volumecontroller.ObjectDeviceInputOutput in project coprhd-controller by CoprHD.

the class ObjectDeviceController method syncBucketACL.

@Override
public void syncBucketACL(URI storage, URI bucketId, String opId) throws InternalException {
    ControllerUtils.setThreadLocalLogData(bucketId, opId);
    _log.info("ObjectDeviceController:updateBucketACL Bucket URI : {} ", bucketId);
    Bucket bucketObj = _dbClient.queryObject(Bucket.class, bucketId);
    StorageSystem storageObj = _dbClient.queryObject(StorageSystem.class, storage);
    ObjectDeviceInputOutput objectArgs = new ObjectDeviceInputOutput();
    objectArgs.setName(bucketObj.getName());
    objectArgs.setNamespace(bucketObj.getNamespace());
    BiosCommandResult result = getDevice(storageObj.getSystemType()).doSyncBucketACL(storageObj, bucketObj, objectArgs, opId);
    if (result.getCommandPending()) {
        return;
    }
    bucketObj.getOpStatus().updateTaskStatus(opId, result.toOperation());
}
Also used : Bucket(com.emc.storageos.db.client.model.Bucket) ObjectDeviceInputOutput(com.emc.storageos.volumecontroller.ObjectDeviceInputOutput) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Aggregations

Bucket (com.emc.storageos.db.client.model.Bucket)4 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)4 ObjectDeviceInputOutput (com.emc.storageos.volumecontroller.ObjectDeviceInputOutput)4 StoragePool (com.emc.storageos.db.client.model.StoragePool)1