Search in sources :

Example 1 with DeactivateBucket

use of com.emc.sa.service.vipr.object.tasks.DeactivateBucket 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)

Example 2 with DeactivateBucket

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

the class ObjectStorageUtils method removeBucketResource.

public static void removeBucketResource(URI bucketResourceId) {
    Task<BucketRestRep> task = execute(new DeactivateBucket(bucketResourceId));
    addAffectedResource(task);
}
Also used : DeactivateBucket(com.emc.sa.service.vipr.object.tasks.DeactivateBucket) BucketRestRep(com.emc.storageos.model.object.BucketRestRep)

Aggregations

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