Search in sources :

Example 1 with CreateBucket

use of com.emc.sa.service.vipr.object.tasks.CreateBucket in project coprhd-controller by CoprHD.

the class ObjectStorageUtils method createBucket.

public static URI createBucket(String bucketName, URI virtualArray, URI virtualPoolId, URI projectId, Double softQuota, Double hardQuota, String retention, String owner) {
    String softQuotaSize = gbToQuotaSize(softQuota);
    String hardQuotaSize = gbToQuotaSize(hardQuota);
    Task<BucketRestRep> task = execute(new CreateBucket(bucketName, virtualArray, virtualPoolId, projectId, softQuotaSize, hardQuotaSize, retention, owner));
    addAffectedResource(task);
    URI bucketId = task.getResourceId();
    addRollback(new DeactivateBucket(bucketId));
    logInfo("object.bucket.task", bucketId, task.getOpId());
    return bucketId;
}
Also used : DeactivateBucket(com.emc.sa.service.vipr.object.tasks.DeactivateBucket) BucketRestRep(com.emc.storageos.model.object.BucketRestRep) CreateBucket(com.emc.sa.service.vipr.object.tasks.CreateBucket) URI(java.net.URI)

Aggregations

CreateBucket (com.emc.sa.service.vipr.object.tasks.CreateBucket)1 DeactivateBucket (com.emc.sa.service.vipr.object.tasks.DeactivateBucket)1 BucketRestRep (com.emc.storageos.model.object.BucketRestRep)1 URI (java.net.URI)1