Search in sources :

Example 1 with BucketRestRep

use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.

the class ObjectStorageUtils method setObjectShareACL.

public static void setObjectShareACL(URI bucketId, ObjectStorageACL acl) {
    Task<BucketRestRep> task = execute(new SetObjectStorageACL(bucketId, acl));
    addAffectedResource(task);
    logInfo("object.bucket.acl", bucketId, task.getOpId());
}
Also used : BucketRestRep(com.emc.storageos.model.object.BucketRestRep) SetObjectStorageACL(com.emc.sa.service.vipr.object.tasks.SetObjectStorageACL)

Example 2 with BucketRestRep

use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.

the class ObjectBuckets method delete.

private static void delete(List<URI> ids, String deleteType) {
    if (ids != null) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        List<Task<BucketRestRep>> tasks = Lists.newArrayList();
        for (URI id : ids) {
            boolean forceDelete = false;
            Task<BucketRestRep> task = client.objectBuckets().deactivate(id, new BucketDeleteParam(forceDelete, deleteType));
            tasks.add(task);
        }
        if (!tasks.isEmpty()) {
            flash.put("info", MessagesUtils.get("resources.buckets.deactivate", tasks.size()));
        }
    }
    buckets(null);
}
Also used : Task(com.emc.vipr.client.Task) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BucketRestRep(com.emc.storageos.model.object.BucketRestRep) BucketDeleteParam(com.emc.storageos.model.object.BucketDeleteParam) URI(java.net.URI)

Example 3 with BucketRestRep

use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.

the class ObjectBuckets method deleteBucket.

@FlashException(referrer = { "bucket" })
public static void deleteBucket(String bucketId, String deleteType) {
    if (StringUtils.isNotBlank(bucketId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        boolean forceDelete = false;
        Task<BucketRestRep> task = client.objectBuckets().deactivate(uri(bucketId), new BucketDeleteParam(forceDelete, deleteType));
        flash.put("info", MessagesUtils.get("resources.bucket.deactivate"));
    }
    bucket(bucketId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BucketRestRep(com.emc.storageos.model.object.BucketRestRep) BucketDeleteParam(com.emc.storageos.model.object.BucketDeleteParam) FlashException(controllers.util.FlashException)

Example 4 with BucketRestRep

use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.

the class ObjectBuckets method listBucketACL.

public static void listBucketACL(String id) {
    renderArgs.put("dataTable", new BucketACLDataTable());
    renderArgs.put("bucketId", uri(id));
    ViPRCoreClient client = BourneUtil.getViprClient();
    BucketRestRep bucket = client.objectBuckets().get(uri(id));
    renderArgs.put("bucketName", bucket.getName());
    BucketACLForm bucketACL = new BucketACLForm();
    render(bucketACL);
}
Also used : BucketACLDataTable(models.datatable.BucketACLDataTable) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BucketRestRep(com.emc.storageos.model.object.BucketRestRep)

Example 5 with BucketRestRep

use of com.emc.storageos.model.object.BucketRestRep in project coprhd-controller by CoprHD.

the class ObjectProvider method createBucketOptions.

protected static List<AssetOption> createBucketOptions(ViPRCoreClient client, URI project, URI hostId, Collection<? extends DataObjectRestRep> bucketObjects) {
    Map<URI, BucketRestRep> bucketNames = getProjectBucketNames(client, project);
    List<AssetOption> options = Lists.newArrayList();
    for (DataObjectRestRep bucketObject : bucketObjects) {
        options.add(createBucketOption(client, hostId, bucketObject, bucketNames));
    }
    AssetOptionsUtils.sortOptionsByLabel(options);
    return options;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) DataObjectRestRep(com.emc.storageos.model.DataObjectRestRep) BucketRestRep(com.emc.storageos.model.object.BucketRestRep) URI(java.net.URI)

Aggregations

BucketRestRep (com.emc.storageos.model.object.BucketRestRep)13 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)7 URI (java.net.URI)4 DeactivateBucket (com.emc.sa.service.vipr.object.tasks.DeactivateBucket)2 BucketDeleteParam (com.emc.storageos.model.object.BucketDeleteParam)2 Task (com.emc.vipr.client.Task)2 CreateBucket (com.emc.sa.service.vipr.object.tasks.CreateBucket)1 SetObjectStorageACL (com.emc.sa.service.vipr.object.tasks.SetObjectStorageACL)1 UpdateBucket (com.emc.sa.service.vipr.object.tasks.UpdateBucket)1 DataObjectRestRep (com.emc.storageos.model.DataObjectRestRep)1 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)1 AssetOption (com.emc.vipr.model.catalog.AssetOption)1 FlashException (controllers.util.FlashException)1 BucketACLDataTable (models.datatable.BucketACLDataTable)1 StringOption (util.StringOption)1