use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.
the class ObjectBucketsDataTable method fetch.
public static List<Bucket> fetch(URI projectId) {
if (projectId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<BucketRestRep> buckets = client.objectBuckets().findByProject(projectId);
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.objectVpools().list());
List<Bucket> results = Lists.newArrayList();
for (BucketRestRep bucket : buckets) {
results.add(new Bucket(bucket, virtualArrays, virtualPools));
}
return results;
}
use of com.emc.storageos.model.object.BucketRestRep 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;
}
use of com.emc.storageos.model.object.BucketRestRep 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);
}
use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.
the class ObjectStorageUtils method editBucketResource.
public static void editBucketResource(URI bucketResourceId, Double softQuota, Double hardQuota, String retention) {
String softQuotaSize = gbToQuotaSize(softQuota);
String hardQuotaSize = gbToQuotaSize(hardQuota);
Task<BucketRestRep> task = execute(new UpdateBucket(bucketResourceId, softQuotaSize, hardQuotaSize, retention));
addAffectedResource(task);
}
use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.
the class GetBucketResource method executeTask.
@Override
public DataObjectRestRep executeTask() throws Exception {
ViPRCoreClient client = getClient();
BucketRestRep bucket = client.objectBuckets().get(resourceId);
if (bucket != null) {
return bucket;
}
throw stateException("GetBucketResource.illegalState.notFound", resourceId);
}
Aggregations