Exemple #1
0
    public Task <ListBucketsResponse> ListBucketsAsync(Action <ListBucketsRequest>?config = null, CancellationToken token = default)
    {
        ListBucketsRequest request = new ListBucketsRequest();

        config?.Invoke(request);

        return(_bucketOperations.ListBucketsAsync(request, token));
    }
        public void ListBuckets()
        {
            var task = minio.ListBucketsAsync();

            task.Wait();

            if (!string.IsNullOrEmpty(task.Result.Owner))
            {
                logger.Information(string.Format("Bucket Owner: {0}", task.Result.Owner));
            }
            if (task.Result.Buckets.Count == 0)
            {
                logger.Warning("No bucket found!");
            }
            foreach (Bucket bucket in task.Result.Buckets)
            {
                logger.Information(string.Format("Bucket Name: {0}, Creation Date: {1}", bucket.Name, bucket.CreationDate));
            }
        }