Пример #1
0
 // Get bucket notification configuration Task<BucketNotification> GetBucketNotificationAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
 public Task <BucketNotification> GetBucketNotificAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
 {
     try
     {
         var notifications = minio.GetBucketNotificationsAsync(bucketName, cancellationToken);
         return(notifications);
     }
     catch (MinioException e)
     {
         throw;
     }
 }
Пример #2
0
        // Get bucket notifications - this works only with AWS endpoint
        public async static Task Run(MinioClient minio,
                                     string bucketName = "my-bucket-name")
        {
            try
            {
                Console.WriteLine("Running example for API: GetBucketNotificationsAsync");
                BucketNotification notifications = await minio.GetBucketNotificationsAsync(bucketName);

                Console.WriteLine($"Notifications is {notifications.ToXML()} for bucket {bucketName}");
                Console.WriteLine();
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error parsing bucket notifications - make sure that you are running this call against AWS end point: {e.Message}");
            }
        }