use of com.emc.storageos.ecs.api.ECSException in project coprhd-controller by CoprHD.
the class ECSObjectStorageDevice method doUpdateBucket.
@Override
public BiosCommandResult doUpdateBucket(StorageSystem storageObj, Bucket bucket, Long softQuota, Long hardQuota, Integer retention, String taskId) {
// Update Quota
ECSApi objectAPI = getAPI(storageObj);
try {
objectAPI.updateBucketQuota(bucket.getName(), bucket.getNamespace(), softQuota, hardQuota);
bucket.setHardQuota(hardQuota);
bucket.setSoftQuota(softQuota);
} catch (ECSException e) {
_log.error("Quota Update for Bucket : {} failed.", bucket.getName(), e);
completeTask(bucket.getId(), taskId, e);
return BiosCommandResult.createErrorResult(e);
}
// Update Retention
try {
objectAPI.updateBucketRetention(bucket.getName(), bucket.getNamespace(), retention);
bucket.setRetention(retention);
} catch (ECSException e) {
_log.error("Retention Update for Bucket : {} failed.", bucket.getName(), e);
completeTask(bucket.getId(), taskId, e);
return BiosCommandResult.createErrorResult(e);
}
_dbClient.persistObject(bucket);
completeTask(bucket.getId(), taskId, "Successfully updated Bucket.");
return BiosCommandResult.createSuccessfulResult();
}
Aggregations