To run the following example, click on and start the project using System This example program connects to an object storage server, creates a bucket and uploads a file to the bucket. Var getListBucketsTask = await minio.ListBucketsAsync().ConfigureAwait(false) įoreach (var bucket in )Ĭonsole.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime) Create an async task for listing buckets. Private static IMinioClient minio = new MinioClient() Initialize the client with access credentials. Var accessKey = "Q3AM3UQ867trueSPQQA43P2F" The following examples uses a freely hosted public MinIO service "" for development purposes. User ID that uniquely identifies your accountīoolean value to enable/disable HTTPS support (default=true) To connect to an Amazon S3 compatible cloud storage service, you need the following information Variable name Var minioClient = minioClientFactory.CreateClient() //Has optional argument to configure specifics This.minioClientFactory = minioClientFactory Public ExampleFactor圜ontroller(IMinioClientFactory minioClientFactory) Private readonly IMinioClientFactory minioClientFactory Public class ExampleFactor圜ontroller : ControllerBase Return Ok(await minioClient.PresignedGetObjectAsync(new PresignedGetObjectArgs() Public async Task GetUrl(string bucketID) Public ExampleController(IMinioClient minioClient) Private readonly IMinioClient minioClient Public class ExampleController : ControllerBase NOTE: SSL and Build are called by the build-in services already. Add Minio using the custom endpoint and configure additional settings for default MinioClient initializationī(configureClient => configureClient Var builder = WebApplication.CreateBuilder() ī(accessKey, secretKey) Var secretKey = "zuf+tfteSlswRu7BJ86wtrueekitnifILbZam1KYY3TG" When using AddMinio to add Minio to your ServiceCollection, Minio will also use any custom Logging providers you've added, like Serilog to output traces when enabled. NET package, run the following command in Nuget Package Manager Console. MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services.For a complete list of APIs and examples, please take a look at the Dotnet Client API Reference.This document assumes that you have a working VisualStudio development environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |