Search in sources :

Example 1 with BucketDeleteParam

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

the class DeactivateBucket method doExecute.

@Override
protected Task<BucketRestRep> doExecute() throws Exception {
    BucketDeleteParam param = new BucketDeleteParam();
    param.setForceDelete(true);
    return getClient().objectBuckets().deactivate(bucketId, param);
}
Also used : BucketDeleteParam(com.emc.storageos.model.object.BucketDeleteParam)

Example 2 with BucketDeleteParam

use of com.emc.storageos.model.object.BucketDeleteParam 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 BucketDeleteParam

use of com.emc.storageos.model.object.BucketDeleteParam 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)

Aggregations

BucketDeleteParam (com.emc.storageos.model.object.BucketDeleteParam)3 BucketRestRep (com.emc.storageos.model.object.BucketRestRep)2 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)2 Task (com.emc.vipr.client.Task)1 FlashException (controllers.util.FlashException)1 URI (java.net.URI)1