To install Minio .NET package, run the following command in Nuget Package Manager Console
PM> Install-Package Minio
using Minio;
private static MinioClient client = new MinioClient("https://s3.amazonaws.com", "Access Key", "Secret Key");
var buckets = client.ListBuckets();
foreach (Bucket bucket in buckets)
{
Console.Out.WriteLine(bucket.Name + " " + bucket.CreationDate);
}
- ListBuckets.cs
- MakeBucket.cs
- RemoveBucket.cs
- BucketExists.cs
- ListObjects.cs
- ListIncompleteUploads.cs
- PutObject.cs
- GetObject.cs
- GetPartialObject.cs
- RemoveObject.cs
- StatObject.cs
- RemoveIncompleteUpload.cs
Simply edit the example .Net program to include your access credentials and follow the steps below.
$ git clone https://github.com/minio/minio-dotnet && cd minio-dotnet
$ sudo apt-get install mono-xbuild mono-devel mono-complete
$ sudo mozroots --import --machine --sync
$ sudo certmgr -ssl -m https://go.microsoft.com
$ sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
$ sudo certmgr -ssl -m https://nuget.org
$ wget https://www.nuget.org/nuget.exe
$ mono nuget.exe update -self
$ mono nuget.exe restore
$ xbuild /t:Clean
$ xbuild /t:Rebuild /p:Configuration=Release
[edit Minio.Examples/ListBuckets.cs]
$ mcs /r:Minio/bin/Release/Minio.dll Minio.Examples/ListBuckets.cs
$ export MONO_PATH=Minio/bin/Release
$ mono Minio.Examples/ListBuckets.exe
....