.NET Client API Reference
IMinioClientminioClient=newMinioClient().WithEndpoint("play.min.io").WithCredentials("Q3AM3UQ867SPQQA43P2F","zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG").WithSSL().Build();IIMinioClientminioClient=newMinioClient().WithEndpoint("s3.amazonaws.com").WithCredentials("YOUR-ACCESSKEYID","YOUR-SECRETACCESSKEY").WithSSL().Build();public MinioClient(string endpoint, string accessKey = "", string secretKey = "", string region = "", string sessionToken="") |
| Creates MinIO client object with given endpoint.AccessKey, secretKey, region and sessionToken are optional parameters, and can be omitted for anonymous access. |
| The client object uses Http access by default. To use Https, chain method WithSSL() to client object to use secure transfer protocol |
Parameters
| Param | Type | Description |
|---|---|---|
endpoint | string | endPoint is an URL, domain name, IPv4 address or IPv6 address.Valid endpoints are listed below: |
| s3.amazonaws.com | ||
| play.min.io | ||
| localhost | ||
| play.min.io | ||
accessKey | string | accessKey is like user-id that uniquely identifies your account.This field is optional and can be omitted for anonymous access. |
secretKey | string | secretKey is the password to your account.This field is optional and can be omitted for anonymous access. |
region | string | region to which calls should be made.This field is optional and can be omitted. |
sessionToken | string | sessionToken needs to be set if temporary access credentials are used |
| Secure Access (TLS) |
|---|
Chain .WithSSL() or WithSSL(true) to MinIO Client object to use https. |
Chain .WithSSL(false) or nothing to Client object to use http. |
| Proxy |
|---|
Chain .WithProxy(proxyObject) to MinIO Client object to use proxy |
public MinioClient() |
| Creates MinIO client. This client gives an empty object that can be used with Chaining to populate only the member variables we need. |
| The next important step is to connect to an endpoint. You can chain one of the overloaded method WithEndpoint() to client object to connect. |
| This client object also uses Http access by default. To use Https, chain method WithSSL() or WithSSL(true) to client object to use secure transfer protocol. |
| To use non-anonymous access, chain method WithCredentials() to the client object along with the access key & secret key. |
| Finally chain the method Build() to get the finally built client object. |
| Endpoint |
|---|
Chain .WithEndpoint() to MinIO Client object to initialize the endpoint. |
| Return Type | Exceptions |
|---|---|
MinioClient | Listed Exceptions: |
Examples
// 1. Using Builder with public MinioClient(), Endpoint, Credentials & Secure (HTTPS) connectionIMinioClientminioClient=newMinioClient().WithEndpoint("play.min.io").WithCredentials("Q3AM3UQ867SPQQA43P2F","zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG").WithSSL().Build()// 2. Using Builder with public MinioClient(), Endpoint, Credentials & Secure (HTTPS) connectionIMinioClientminioClient=newMinioClient().WithEndpoint("play.min.io",9000,true).WithCredentials("Q3AM3UQ867SPQQA43P2F","zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG").WithSSL().Build()// 3. Initializing minio client with proxyIWebProxyproxy=newWebProxy("192.168.0.1",8000);IMinioClientminioClient=newMinioClient().WithEndpoint("my-ip-address:9000").WithCredentials("minio","minio123").WithSSL().WithProxy(proxy).Build();// 1. Using Builder with public MinioClient(), Endpoint, Credentials, Secure (HTTPS) connection & proxyIMinioClients3Client=newMinioClient().WithEndpoint("s3.amazonaws.com").WithCredentials("YOUR-AWS-ACCESSKEYID","YOUR-AWS-SECRETACCESSKEY").WithSSL().WithProxy(proxy).Build();Task MakeBucketAsync(string bucketName, string location = "us-east-1", CancellationToken cancellationToken = default(CancellationToken))
Creates a new bucket.
Parameters
| Param | Type | Description |
|---|---|---|
bucketName | string | Name of the bucket |
region | string | Optional parameter. Defaults to us-east-1 for AWS requests |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
RedirectionException : upon redirection by server | |
InternalClientException : upon internal library error |
Example
try{// Create bucket if it doesn't exist.boolfound=awaitminioClient.BucketExistsAsync("mybucket");if(found){Console.WriteLine("mybucket already exists");}else{// Create bucket 'my-bucketname'.awaitminioClient.MakeBucketAsync("mybucket");Console.WriteLine("mybucket is created successfully");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task MakeBucketAsync(MakeBucketArgs args, CancellationToken cancellationToken = default(CancellationToken))
Creates a new bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | MakeBucketArgs | Arguments Object - name, location. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
RedirectionException : upon redirection by server | |
InternalClientException : upon internal library error |
Example
try{// Create bucket if it doesn't exist.boolfound=awaitminioClient.BucketExistsAsync(bktExistArgs);if(found){Console.WriteLine(bktExistArgs.BucketName+" already exists");}else{// Create bucket 'my-bucketname'.awaitminioClient.MakeBucketAsync(mkBktArgs);Console.WriteLine(mkBktArgs.BucketName+" is created successfully");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<ListAllMyBucketsResult> ListBucketsAsync(CancellationToken cancellationToken = default(CancellationToken))
Lists all buckets.
| Param | Type | Description |
|---|---|---|
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ListAllMyBucketsResult> : Task with List of bucket type. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
InvalidOperationException: upon unsuccessful deserialization of xml data | |
ErrorResponseException : upon unsuccessful execution | |
InternalClientException : upon internal library error |
Example
try{// List buckets that have read access.varlist=awaitminioClient.ListBucketsAsync();foreach(Bucketbucketinlist.Buckets){Console.WriteLine(bucket.Name+" "+bucket.CreationDateDateTime);}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<bool> BucketExistsAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
Checks if a bucket exists.
Parameters
| Param | Type | Description |
|---|---|---|
bucketName | string | Name of the bucket. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<bool> : true if the bucket exists | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
ErrorResponseException : upon unsuccessful execution | |
InternalClientException : upon internal library error |
Example
try{// Check whether 'my-bucketname' exists or not.boolfound=awaitminioClient.BucketExistsAsync(bucketName);Console.WriteLine("bucket-name "+((found==true)?"exists":"does not exist"));}catch(MinioExceptione){Console.WriteLine("[Bucket] Exception: {0}",e);}Task<bool> BucketExistsAsync(BucketExistsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Checks if a bucket exists.
Parameters
| Param | Type | Description |
|---|---|---|
args | BucketExistsArgs | Argument object - bucket name. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<bool> : true if the bucket exists | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
ErrorResponseException : upon unsuccessful execution | |
InternalClientException : upon internal library error |
Example
try{// Check whether 'my-bucketname' exists or not.boolfound=awaitminioClient.BucketExistsAsync(args);Console.WriteLine(args.BucketName+" "+((found==true)?"exists":"does not exist"));}catch(MinioExceptione){Console.WriteLine("[Bucket] Exception: {0}",e);}Task RemoveBucketAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
Removes a bucket.
NOTE: - removeBucket does not delete the objects inside the bucket. The objects need to be deleted using the removeObject API.
Parameters
| Param | Type | Description |
|---|---|---|
bucketName | string | Name of the bucket |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
| Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
ErrorResponseException : upon unsuccessful execution | |
InternalClientException : upon internal library error | |
BucketNotFoundException : upon missing bucket |
Example
try{// Check if my-bucket exists before removing it.boolfound=awaitminioClient.BucketExistsAsync("mybucket");if(found){// Remove bucket my-bucketname. This operation will succeed only if the bucket is empty.awaitminioClient.RemoveBucketAsync("mybucket");Console.WriteLine("mybucket is removed successfully");}else{Console.WriteLine("mybucket does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveBucketAsync(RemoveBucketArgs args, CancellationToken cancellationToken = default(CancellationToken))
Removes a bucket.
NOTE: - removeBucket does not delete the objects inside the bucket. The objects need to be deleted using the removeObject API.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveBucketArgs | Arguments Object - bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
| Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
AccessDeniedException : upon access denial | |
ErrorResponseException : upon unsuccessful execution | |
InternalClientException : upon internal library error | |
BucketNotFoundException : upon missing bucket |
Example
try{// Check if my-bucket exists before removing it.boolfound=awaitminioClient.BucketExistsAsync(bktExistsArgs);if(found){// Remove bucket my-bucketname. This operation will succeed only if the bucket is empty.awaitminioClient.RemoveBucketAsync(rmBktArgs);Console.WriteLine(rmBktArgs.BucketName+" is removed successfully");}else{Console.WriteLine(bktExistsArgs.BucketName+" does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<VersioningConfiguration> GetVersioningAsync(GetVersioningArgs args, CancellationToken cancellationToken = default(CancellationToken))
Get versioning information for a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetVersioningArgs | Arguments Object - bucket name. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
VersioningConfiguration:VersioningConfiguration with information populated from response. | None |
Example
try{// Check whether 'mybucket' exists or not.boolfound=minioClient.BucketExistsAsync(bktExistsArgs);if(found){varargs=newGetVersioningArgs("mybucket").WithSSL();VersioningConfigurationvc=awaitminio.GetVersioningInfoAsync(args);}else{Console.WriteLine(bktExistsArgs.BucketName+" does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetVersioningAsync(SetVersioningArgs args, CancellationToken cancellationToken = default(CancellationToken))
Set versioning to Enabled or Suspended for a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetVersioningArgs | Arguments Object - bucket name, versioning status. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task: | None |
Example
try{// Check whether 'mybucket' exists or not.boolfound=minioClient.BucketExistsAsync(bktExistsArgs);if(found){varargs=newSetVersioningArgs("mybucket").WithSSL().WithVersioningEnabled();awaitminio.SetVersioningAsync(setArgs);}else{Console.WriteLine(bktExistsArgs.BucketName+" does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetBucketEncryptionAsync(SetBucketEncryptionArgs args, CancellationToken cancellationToken = default(CancellationToken));
Sets the Bucket Encryption Configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetBucketEncryptionArgs | SetBucketEncryptionArgs Argument Object with bucket, encryption configuration |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Set Encryption Configuration for the bucketSetBucketEncryptionArgsargs=newSetBucketEncryptionArgs().WithBucket(bucketName).WithEncryptionConfig(config);awaitminio.SetBucketEncryptionAsync(args);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<ServerSideEncryptionConfiguration> GetBucketEncryptionAsync(GetBucketEncryptionArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets the Bucket Encryption configuration of the bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetBucketEncryptionArgs | GetBucketEncryptionArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ServerSideEncryptionConfiguration> | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
ServerSideEncryptionConfiguration object which contains the bucket encryption configuration.
Example
try{// Get Bucket Encryption Configuration for the bucketvarargs=newGetBucketEncryptionArgs().WithBucket(bucketName);ServerSideEncryptionConfigurationconfig=awaitminio.GetBucketEncryptionAsync(args);Console.WriteLine($"Got encryption configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveBucketEncryptionAsync(RemoveBucketEncryptionArgs args, CancellationToken cancellationToken = default(CancellationToken))
Remove the Bucket Encryption configuration of an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveBucketEncryptionArgs | RemoveBucketEncryptionArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Bucket Encryption Configuration for the bucketvarargs=newRemoveBucketEncryptionArgs().WithBucket(bucketName);awaitminio.RemoveBucketEncryptionAsync(args);Console.WriteLine($"Removed encryption configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetBucketTagsAsync(SetBucketTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets tags to a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetBucketTagsArgs | SetBucketTagsArgs Argument Object with bucket, tags to set |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Set Tags for the bucketSetBucketTagsArgsargs=newSetBucketTagsArgs().WithBucket(bucketName).WithTagging(tags);awaitminio.SetBucketTagsAsync(args);Console.WriteLine($"Set Tags for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<Tagging> GetBucketTagsAsync(GetBucketTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets tags of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetBucketTagsArgs | GetBucketTagsArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<Tagging>: Tagging object which containing tag-value pairs. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Get Bucket Tags for the bucketvarargs=newGetBucketTagsArgs().WithBucket(bucketName);vartags=awaitminio.GetBucketTagsAsync(args);Console.WriteLine($"Got tags for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveBucketTagsAsync(RemoveBucketTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Deletes tags of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveBucketTagsArgs | RemoveBucketTagsArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Bucket Encryption Configuration for the bucketvarargs=newRemoveBucketTagsArgs().WithBucket(bucketName);awaitminio.RemoveBucketTagsAsync(args);Console.WriteLine($"Removed tags for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetBucketLifecycleAsync(SetBucketLifecycleArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets Lifecycle configuration to a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetBucketLifecycleArgs | SetBucketLifecycleArgs Argument Object with bucket name, Lifecycle configuration to set |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Set Lifecycle configuration for the bucketSetBucketLifecycleArgsargs=newSetBucketLifecycleArgs().WithBucket(bucketName).WithConfiguration(lfc);awaitminio.SetBucketLifecycleAsync(args);Console.WriteLine($"Set Lifecycle for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<LifecycleConfiguration> GetBucketLifecycleAsync(GetBucketLifecycleArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets Lifecycle configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetBucketLifecycleArgs | GetBucketLifecycleArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<LifecycleConfiguration>: LifecycleConfiguration object which contains the Lifecycle configuration details. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Get Bucket Lifecycle configuration for the bucketvarargs=newGetBucketLifecycleArgs().WithBucket(bucketName);varlfc=awaitminio.GetBucketLifecycleAsync(args);Console.WriteLine($"Got Lifecycle configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveBucketLifecycleAsync(RemoveBucketLifecycleArgs args, CancellationToken cancellationToken = default(CancellationToken))
Deletes Lifecycle configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveBucketLifecycleArgs | RemoveBucketLifecycleArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Bucket Lifecycle Configuration for the bucketvarargs=newRemoveBucketLifecycleArgs().WithBucket(bucketName);awaitminio.RemoveBucketLifecycleAsync(args);Console.WriteLine($"Removed Lifecycle configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetBucketReplicationAsync(SetBucketReplicationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets Replication configuration to a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetBucketReplicationArgs | SetBucketReplicationArgs Argument Object with bucket name, Replication configuration to set |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Set Replication configuration for the bucketSetBucketReplicationArgsargs=newSetBucketReplicationArgs().WithBucket(bucketName).WithConfiguration(cfg);awaitminio.SetBucketReplicationAsync(args);Console.WriteLine($"Set Replication configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<ReplicationConfiguration> GetBucketReplicationAsync(GetBucketReplicationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets Replication configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetBucketReplicationArgs | GetBucketReplicationArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ReplicationConfiguration>: ReplicationConfiguration object which contains the Replication configuration details. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Get Bucket Replication for the bucketvarargs=newGetBucketReplicationArgs().WithBucket(bucketName);varcfg=awaitminio.GetBucketReplicationAsync(args);Console.WriteLine($"Got Replication configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveBucketReplicationAsync(RemoveBucketReplicationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Deletes Replication configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveBucketReplicationArgs | RemoveBucketReplicationArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Bucket Replication Configuration for the bucketvarargs=newRemoveBucketReplicationArgs().WithBucket(bucketName);awaitminio.RemoveBucketReplicationAsync(args);Console.WriteLine($"Removed Replication configuration for bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}IObservable<Item> ListObjectsAsync(ListObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Lists all objects (with version IDs, if existing) in a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | ListObjectArgs | ListObjectArgs object - encapsulates bucket name, prefix, show recursively, show versions. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
IObservable<Item>:an Observable of Items. | None |
Example
try{// Just list of objects// Check whether 'mybucket' exists or not.boolfound=minioClient.BucketExistsAsync("mybucket");if(found){// List objects from 'my-bucketname'ListObjectArgsargs=newListObjectArgs().WithBucket("mybucket").WithPrefix("prefix").WithRecursive(true);IObservable<Item>observable=minioClient.ListObjectsAsync(args);IDisposablesubscription=observable.Subscribe(item=>Console.WriteLine("OnNext: {0}",item.Key),ex=>Console.WriteLine("OnError: {0}",ex.Message),()=>Console.WriteLine("OnComplete: {0}"));}else{Console.WriteLine("mybucket does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}try{// List of objects with version IDs.// Check whether 'mybucket' exists or not.boolfound=minioClient.BucketExistsAsync("mybucket");if(found){// List objects from 'my-bucketname'ListObjectArgsargs=newListObjectArgs().WithBucket("mybucket").WithPrefix("prefix").WithRecursive(true).WithVersions(true)IObservable<Item>observable=minioClient.ListObjectsAsync(args,true);IDisposablesubscription=observable.Subscribe(item=>Console.WriteLine("OnNext: {0} - {1}",item.Key,item.VersionId),ex=>Console.WriteLine("OnError: {0}",ex.Message),()=>Console.WriteLine("OnComplete: {0}"));}else{Console.WriteLine("mybucket does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetObjectLockConfigurationAsync(SetObjectLockConfigurationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets object-lock configuration in a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetObjectLockConfigurationArgs | SetObjectLockConfigurationArgs Argument Object with bucket, lock configuration to set |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{ObjectLockConfigurationconfig==newObjectLockConfiguration(RetentionMode.GOVERNANCE,35);// Set Object Lock Configuration for the bucketSetObjectLockConfigurationArgsargs=newSetObjectLockConfigurationArgs().WithBucket(bucketName).WithLockConfiguration(config);awaitminio.SetObjectLockConfigurationAsync(args);Console.WriteLine($"Set Object lock configuration to bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<ObjectLockConfiguration> GetObjectLockConfigurationAsync(GetObjectLockConfigurationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets object-lock configuration of a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetObjectLockConfigurationArgs | GetObjectLockConfigurationArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ObjectLockConfiguration>: ObjectLockConfiguration object which containing lock-enabled status & Object lock rule. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Get the Object Lock Configuration for the bucketvarargs=newGetObjectLockConfigurationArgs().WithBucket(bucketName);varconfig=awaitminio.GetObjectLockConfigurationAsync(args);Console.WriteLine($"Object lock configuration on bucket {bucketName} is : "+config.ObjectLockEnabled);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveObjectLockConfigurationAsync(RemoveObjectLockConfigurationArgs args, CancellationToken cancellationToken = default(CancellationToken))
Removes object-lock configuration on a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveObjectLockConfigurationArgs | RemoveObjectLockConfigurationArgs Argument Object with bucket name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
BucketNotFoundException : upon bucket with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Object Lock Configuration on the bucketvarargs=newRemoveObjectLockConfigurationArgs().WithBucket(bucketName);awaitminio.RemoveObjectLockConfigurationAsync(args);Console.WriteLine($"Removed Object lock configuration on bucket {bucketName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}IObservable<Upload> ListIncompleteUploads(ListIncompleteUploadsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Lists partially uploaded objects in a bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | ListIncompleteUploadsArgs | ListIncompleteUploadsArgs object - encapsulates bucket name, prefix, show recursively. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
IObservable<Upload>: an Observable of Upload. | None |
Example
try{// Check whether 'mybucket' exist or not.boolfound=minioClient.BucketExistsAsync("mybucket");if(found){// List all incomplete multipart upload of objects in 'mybucket'ListIncompleteUploadsArgslistArgs=newListIncompleteUploadsArgs().WithBucket("mybucket").WithPrefix("prefix").WithRecursive(true);IObservable<Upload>observable=minioClient.ListIncompleteUploads(listArgs);IDisposablesubscription=observable.Subscribe(item=>Console.WriteLine("OnNext: {0}",item.Key),ex=>Console.WriteLine("OnError: {0}",ex.Message),()=>Console.WriteLine("OnComplete: {0}"));}else{Console.WriteLine("mybucket does not exist");}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}IObservable<MinioNotificationRaw> ListenBucketNotificationsAsync(ListenBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Subscribes to bucket change notifications (a Minio-only extension)
Parameters
| Param | Type | Description |
|---|---|---|
args | ListenBucketNotificationsArgs | ListenBucketNotificationsArgs object - encapsulates bucket name, list of events, prefix, suffix. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
IObservable<MinioNotificationRaw>: an Observable ofMinioNotificationRaw, which contain the raw JSON notifications. Use theMinioNotification class to deserialise using the JSON library of your choice. | None |
Example
try{varevents=newList<EventType>{EventType.ObjectCreatedAll};varprefix=null;varsuffix=null;ListenBucketNotificationsArgsargs=newListenBucketNotificationsArgs().WithBucket(bucketName).WithEvents(events).WithPrefix(prefix).WithSuffix(suffix);IObservable<MinioNotificationRaw>observable=minioClient.ListenBucketNotificationsAsync(args);IDisposablesubscription=observable.Subscribe(notification=>Console.WriteLine($"Notification: {notification.json}"),ex=>Console.WriteLine($"OnError: {ex}"),()=>Console.WriteLine($"Stopped listening for bucket notifications\n"));}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<String> GetPolicyAsync(GetPolicyArgs args, CancellationToken cancellationToken = default(CancellationToken))
Get bucket policy.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetPolicyArgs | GetPolicyArgs object encapsulating bucket name. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<String>: The current bucket policy for given bucket as a json string. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name. | |
InvalidObjectPrefixException : upon invalid object prefix. | |
ConnectionException : upon connection error. | |
AccessDeniedException : upon access denial | |
InternalClientException : upon internal library error. | |
BucketNotFoundException : upon missing bucket |
Example
try{GetPolicyArgsargs=newGetPolicyArgs().WithBucket("myBucket");StringpolicyJson=awaitminioClient.GetPolicyAsync(args);Console.WriteLine("Current policy: "+policyJson);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetPolicyAsync(SetPolicyArgs args, CancellationToken cancellationToken = default(CancellationToken))
Set policy on bucket.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetPolicyArgs | SetPolicyArgs object encapsulating bucket name, Policy as a json string. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
| Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectPrefixException : upon invalid object prefix |
Example
try{stringpolicyJson=$@"{{""Version"":""2012-10-17"",""Statement"":[{{""Action"":[""s3:GetBucketLocation""],""Effect"":""Allow"",""Principal"":{{""AWS"":[""*""]}},""Resource"":[""arn:aws:s3:::{bucketName}""],""Sid"":""""}},{{""Action"":[""s3:ListBucket""],""Condition"":{{""StringEquals"":{{""s3:prefix"":[""foo"",""prefix/""]}}}},""Effect"":""Allow"",""Principal"":{{""AWS"":[""*""]}},""Resource"":[""arn:aws:s3:::{bucketName}""],""Sid"":""""}},{{""Action"":[""s3:GetObject""],""Effect"":""Allow"",""Principal"":{{""AWS"":[""*""]}},""Resource"":[""arn:aws:s3:::{bucketName}/foo*"",""arn:aws:s3:::{bucketName}/prefix/*""],""Sid"":""""}}]}}";SetPolicyArgsargs=newSetPolicyArgs().WithBucket("myBucket").WithPolicy(policyJson);awaitminioClient.SetPolicyAsync(args);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetBucketNotificationAsync(SetBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets notification configuration for a given bucket
Parameters
| Param | Type | Description |
|---|---|---|
args | SetBucketNotificationsArgs | SetBucketNotificationsArgs object encapsulating bucket name, notification configuration object. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
| Task | Listed Exceptions: |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidOperationException: upon unsuccessful serialization of notification object | |
Example
try{BucketNotificationnotification=newBucketNotification();ArntopicArn=newArn("aws","sns","us-west-1","412334153608","topicminio");TopicConfigtopicConfiguration=newTopicConfig(topicArn);List<EventType>events=newList<EventType>(){EventType.ObjectCreatedPut,EventType.ObjectCreatedCopy};topicConfiguration.AddEvents(events);topicConfiguration.AddFilterPrefix("images");topicConfiguration.AddFilterSuffix("jpg");notification.AddTopic(topicConfiguration);QueueConfigqueueConfiguration=newQueueConfig("arn:aws:sqs:us-west-1:482314153608:testminioqueue1");queueConfiguration.AddEvents(newList<EventType>(){EventType.ObjectCreatedCompleteMultipartUpload});notification.AddQueue(queueConfiguration);SetBucketNotificationsArgsargs=newSetBucketNotificationsArgs().WithBucket(bucketName).WithBucketNotificationConfiguration(notification);awaitminio.SetBucketNotificationsAsync(args);Console.WriteLine("Notifications set for the bucket "+args.BucketName+" successfully");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<BucketNotification> GetBucketNotificationAsync(GetBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Get bucket notification configuration
Parameters
| Param | Type | Description |
|---|---|---|
args | GetBucketNotificationsArgs | GetBucketNotificationsArgs object encapsulating bucket name. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<BucketNotification>: The current notification configuration for the bucket. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name. | |
ConnectionException : upon connection error. | |
AccessDeniedException : upon access denial | |
InternalClientException : upon internal library error. | |
BucketNotFoundException : upon missing bucket | |
InvalidOperationException: upon unsuccessful deserialization of xml data |
Example
try{GetBucketNotificationsArgsargs=newGetBucketNotificationsArgs().WithBucket(bucketName);BucketNotificationnotifications=awaitminioClient.GetBucketNotificationAsync(args);Console.WriteLine("Notifications is "+notifications.ToXML());}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveAllBucketNotificationsAsync(RemoveAllBucketNotificationsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Remove all notification configurations set on the bucket
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveAllBucketNotificationsArgs | RemoveAllBucketNotificationsArgs args encapsulating the bucket name. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
| ``Task`: | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name. | |
ConnectionException : upon connection error. | |
AccessDeniedException : upon access denial | |
InternalClientException : upon internal library error. | |
BucketNotFoundException : upon missing bucket | |
InvalidOperationException: upon unsuccessful serialization of xml data |
Example
try{RemoveAllBucketNotificationsArgsargs=newRemoveAllBucketNotificationsArgs().WithBucket(bucketName);awaitminioClient.RemoveAllBucketNotificationsAsync(args);Console.WriteLine("Notifications successfully removed from the bucket "+bucketName);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task GetObjectAsync(GetObjectArgs args, ServerSideEncryption sse = null, CancellationToken cancellationToken = default(CancellationToken))
Downloads an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetObjectArgs | GetObjectArgs Argument Object encapsulating bucket, object names, version Id, ServerSideEncryption object, offset, length |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task: Task callback returns an InputStream containing the object data. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name. | |
ConnectionException : upon connection error. | |
InternalClientException : upon internal library error. |
Examples
// 1. With Bucket & Object names.try{// Check whether the object exists using statObject().// If the object is not found, statObject() throws an exception,// else it means that the object exists.// Execution is successful.StatObjectArgsstatObjectArgs=newStatObjectArgs().WithBucket("mybucket").WithObject("myobject");awaitminioClient.StatObjectAsync(statObjectArgs);// Get input stream to have content of 'my-objectname' from 'my-bucketname'GetObjectArgsgetObjectArgs=newGetObjectArgs().WithBucket("mybucket").WithObject("myobject").WithCallbackStream((stream)=>{stream.CopyTo(Console.OpenStandardOutput());});awaitminioClient.GetObjectAsync(getObjectArgs);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}// 2. With Offset Length specifying a range of bytes & the object as a stream.try{// Check whether the object exists using statObject().// If the object is not found, statObject() throws an exception,// else it means that the object exists.// Execution is successful.StatObjectArgsstatObjectArgs=newStatObjectArgs().WithBucket("mybucket").WithObject("myobject");awaitminioClient.StatObjectAsync(statObjectArgs);// Get input stream to have content of 'my-objectname' from 'my-bucketname'GetObjectArgsgetObjectArgs=newGetObjectArgs().WithBucket("mybucket").WithObject("myobject").WithOffset(1024L).WithObjectSize(10L).WithCallbackStream((stream)=>{stream.CopyTo(Console.OpenStandardOutput());});awaitminioClient.GetObjectAsync(getObjectArgs);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}// 3. Downloads and saves the object as a file in the local filesystem.try{// Check whether the object exists using statObjectAsync().// If the object is not found, statObjectAsync() throws an exception,// else it means that the object exists.// Execution is successful.StatObjectArgsstatObjectArgs=newStatObjectArgs().WithBucket("mybucket").WithObject("myobject");awaitminioClient.StatObjectAsync(statObjectArgs);// Gets the object's data and stores it in photo.jpgGetObjectArgsgetObjectArgs=newGetObjectArgs().WithBucket("mybucket").WithObject("myobject").WithFileName("photo.jpg");awaitminioClient.GetObjectAsync(getObjectArgs);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);} Task PutObjectAsync(PutObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
PutObjectAsync: Uploads object from a file or stream.
Parameters
| Param | Type | Description |
|---|---|---|
args | PutObjectArgs | Arguments object - bucket name, object name, file name, object data stream, object size, content type, object metadata, operation executing progress, SSE. etc. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error | |
EntityTooLargeException: upon proposed upload size exceeding max allowed | |
UnexpectedShortReadException: data read was shorter than size of input buffer | |
ArgumentNullException: upon null input stream | |
InvalidOperationException: upon input value to PutObjectArgs being invalid |
Example
The maximum size of a single object is limited to 5TB. putObject transparently uploads objects larger than 5MiB in multiple parts. Uploaded data is carefully verified using MD5SUM signatures.
try{AesaesEncryption=Aes.Create();aesEncryption.KeySize=256;aesEncryption.GenerateKey();varssec=newSSEC(aesEncryption.Key);varprogress=newProgress<ProgressReport>(progressReport=>{// Progress events are delivered asynchronously (see remark below)Console.WriteLine($"Percentage: {progressReport.Percentage}% TotalBytesTransferred: {progressReport.TotalBytesTransferred} bytes");if(progressReport.Percentage!=100)Console.SetCursorPosition(0,Console.CursorTop-1);elseConsole.WriteLine();});PutObjectArgsputObjectArgs=newPutObjectArgs().WithBucket("mybucket").WithObject("island.jpg").WithFilename("/mnt/photos/island.jpg").WithContentType("application/octet-stream").WithServerSideEncryption(ssec).WithProgress(progress);awaitminio.PutObjectAsync(putObjectArgs);Console.WriteLine("island.jpg is uploaded successfully");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Remark:Note that the defaultProgressMinio.Helper.SyncProgress<T> instead,but make sure you understand the implications. Progress events are sent synchronous, so they may be invoked on anarbitrary thread (mostly a problem for UI applications) and performing long-running and/or blocking operations willdegrade upload performance.
Task<ObjectStat> StatObjectAsync(StatObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets metadata of an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | StatObjectArgs | StatObjectArgs Argument Object with bucket, object names & server side encryption object |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ObjectStat>: Populated object meta data. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error |
Example
try{// Get the metadata of the object.StatObjectArgsstatObjectArgs=newStatObjectArgs().WithBucket("mybucket").WithObject("myobject");ObjectStatobjectStat=awaitminioClient.StatObjectAsync(statObjectArgs);Console.WriteLine(objectStat);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<CopyObjectResult> CopyObjectAsync(CopyObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Copies content from objectName to destObjectName.
Parameters
| Param | Type | Description |
|---|---|---|
args | CopyObjectArgs | Arguments object - bucket name, object name, destination bucket name, destination object name, copy conditions, metadata, Source SSE, Destination SSE. etc. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error | |
ArgumentException : upon missing bucket/object names |
Example
This API performs a Server-side copy operation from a given source object to destination object.
try{CopyConditionscopyConditions=newCopyConditions();copyConditions.setMatchETagNone("TestETag");ServerSideEncryptionsseSrc,sseDst;// Uncomment to specify source and destination Server-side encryption options/* Aes aesEncryption = Aes.Create(); aesEncryption.KeySize = 256; aesEncryption.GenerateKey(); sseSrc = new SSEC(aesEncryption.Key); sseDst = new SSES3(); */awaitminioClient.CopyObjectAsync("mybucket","island.jpg","mydestbucket","processed.png",copyConditions,sseSrc:sseSrc,sseDest:sseDst);Console.WriteLine("island.jpg is uploaded successfully");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveObjectAsync(RemoveObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Removes an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveObjectArgs | Arguments Object. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error |
Example
// 1. Remove object myobject from the bucket mybucket.try{RemoveObjectArgsrmArgs=newRemoveObjectArgs().WithBucket("mybucket").WithObject("myobject");awaitminioClient.RemoveObjectAsync(args);Console.WriteLine("successfully removed mybucket/myobject");}catch(MinioExceptione){Console.WriteLine("Error: "+e);}// 2. Remove one version of object myobject with versionID from mybucket.try{RemoveObjectArgsrmArgs=newRemoveObjectArgs().WithBucket("mybucket").WithObject("myobject").WithVersionId("versionId");awaitminioClient.RemoveObjectAsync(args);Console.WriteLine("successfully removed mybucket/myobject{versionId}");}catch(MinioExceptione){Console.WriteLine("Error: "+e);}Task<IObservable<DeleteError>> RemoveObjectsAsync(RemoveObjectsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Removes a list of objects or object versions.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveObjectsArgs | Arguments Object - bucket name, List of Objects to be deleted or List of Tuples with Tuple(object name, List of version IDs). |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error |
Example
// 1. Remove list of objects in objectNames from the bucket bucketName.try{stringbucketName="mybucket"List<String>objectNames=newLinkedList<String>();objectNames.add("my-objectname1");objectNames.add("my-objectname2");objectNames.add("my-objectname3");RemoveObjectsAsyncrmArgs=newRemoveObjectsAsync().WithBucket(bucketName).WithObjects(objectNames);IObservable<DeleteError>observable=awaitminio.RemoveObjectAsync(rmArgs);IDisposablesubscription=observable.Subscribe(deleteError=>Console.WriteLine("Object: {0}",deleteError.Key),ex=>Console.WriteLine("OnError: {0}",ex),()=>{Console.WriteLine("Removed objects from "+bucketName+"\n");});}catch(MinioExceptione){Console.WriteLine("Error: "+e);}// 2. Remove list of objects (only specific versions mentioned in Version ID list) from the bucket bucketNametry{stringbucketName="mybucket";stringobjectName="myobject1";List<string>versionIDs=newList<string>();versionIDs.Add("abcobject1version1dce");versionIDs.Add("abcobject1version2dce");versionIDs.Add("abcobject1version3dce");List<Tuple<string,string>>objectsVersions=newList<Tuple<string,string>>();objectsVersions.Add(newTuple<string,List<string>>(objectName,versionIDs));objectsVersions.Add(newTuple<string,string>("myobject2""abcobject2version1dce"));objectsVersions.Add(newTuple<string,string>("myobject2","abcobject2version2dce"));objectsVersions.Add(newTuple<string,string>("myobject2","abcobject2version3dce"));RemoveObjectsAsyncrmArgs=newRemoveObjectsAsync().WithBucket(bucketName).WithObjectsVersions(objectsVersions);IObservable<DeleteError>observable=awaitminio.RemoveObjectsAsync(rmArgs);IDisposablesubscription=observable.Subscribe(deleteError=>Console.WriteLine("Object: {0}",deleteError.Key),ex=>Console.WriteLine("OnError: {0}",ex),()=>{Console.WriteLine("Listed all delete errors for remove objects on "+bucketName+"\n");});}catch(MinioExceptione){Console.WriteLine("Error: "+e);}Task RemoveIncompleteUploadAsync(RemoveIncompleteUploadArgs args, CancellationToken cancellationToken = default(CancellationToken))
Removes a partially uploaded object.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveIncompleteUploadArgs | RemoveIncompleteUploadArgs object encapsulating the bucket, object names |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InternalClientException : upon internal library error |
Example
try{// Removes partially uploaded objects from buckets.RemoveIncompleteUploadArgsargs=newRemoveIncompleteUploadArgs().WithBucket(bucketName).WithObject(objectName);awaitminioClient.RemoveIncompleteUploadAsync(args);Console.WriteLine("successfully removed all incomplete upload session of my-bucketname/my-objectname");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<SelectResponseStream> SelectObjectContentAsync(SelectObjectContentArgs args, CancellationToken cancellationToken = default(CancellationToken))
Downloads an object as a stream.
Parameters
| Param | Type | Description | |
|---|---|---|---|
args | SelectObjectContentArgs | options for SelectObjectContent async | Required parameter. |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task: Task callback returns a SelectResponseStream containing select results. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name. | |
ConnectionException : upon connection error. | |
InternalClientException : upon internal library error. | |
ArgumentException : upon invalid response format | |
IOException : insufficient data |
Example
try{varopts=newSelectObjectOptions(){ExpressionType=QueryExpressionType.SQL,Expression="select count(*) from s3object",InputSerialization=newSelectObjectInputSerialization(){CompressionType=SelectCompressionType.NONE,CSV=newCSVInputOptions(){FileHeaderInfo=CSVFileHeaderInfo.None,RecordDelimiter="\n",FieldDelimiter=",",}},OutputSerialization=newSelectObjectOutputSerialization(){CSV=newCSVOutputOptions(){RecordDelimiter="\n",FieldDelimiter=",",}}};SelectObjectContentArgsargs=SelectObjectContentArgs().WithBucket(bucketName).WithObject(objectName).WithSelectObjectOptions(opts);varresp=awaitminio.SelectObjectContentAsync(args);resp.Payload.CopyTo(Console.OpenStandardOutput());Console.WriteLine("Bytes scanned:"+resp.Stats.BytesScanned);Console.WriteLine("Bytes returned:"+resp.Stats.BytesReturned);Console.WriteLine("Bytes processed:"+resp.Stats.BytesProcessed);if(resp.Progressisnotnull){Console.WriteLine("Progress :"+resp.Progress.BytesProcessed);}}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetObjectLegalHoldAsync(SetObjectLegalHoldArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets the Legal Hold status of an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetObjectLegalHoldArgs | SetObjectLegalHoldArgs Argument Object with bucket, object names, version id(optional) |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MissingObjectLockConfigurationException : upon bucket created with object lock not enabled | |
MalFormedXMLException : upon configuration XML in http request validation failure |
Example
try{// Setting WithLegalHold true, sets Legal hold status to ON.SetObjectLegalHoldArgsargs=newSetObjectLegalHoldArgs().WithBucket(bucketName).WithObject(objectName).WithVersionId(versionId).WithLegalHold(true);awaitminio.SetObjectLegalHoldAsync(args);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<bool> GetObjectLegalHoldAsync(GetObjectLegalHoldArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets the Legal Hold status of an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetObjectLegalHoldArgs | GetObjectLegalHoldArgs Argument Object with bucket, object names, version id(optional) |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<bool>: True if LegalHold is enabled, false otherwise. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MissingObjectLockConfigurationException : upon bucket created with object lock not enabled | |
MalFormedXMLException : upon configuration XML in http request validation failure |
Example
try{// Get Legal Hold status a objectvarargs=newGetObjectLegalHoldArgs().WithBucket(bucketName).WithObject(objectName).WithVersionId(versionId);boolenabled=awaitminio.GetObjectLegalHoldAsync(args);Console.WriteLine("LegalHold Configuration STATUS for "+bucketName+"/"+objectName+(!string.IsNullOrEmpty(versionId)?" with Version ID "+versionId:" ")+" : "+(enabled?"ON":"OFF"));}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetObjectTagsAsync(SetObjectTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets tags to a object.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetObjectTagsArgs | SetObjectTagsArgs Argument Object with object, tags to set |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Set Tags for the objectSetObjectTagsArgsargs=newSetObjectTagsArgs().WithBucket(bucketName).WithObject(objectName).WithTagging(tags);awaitminio.SetObjectTagsAsync(args);Console.WriteLine($"Set tags for object {bucketName}/{objectName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<Tagging> GetObjectTagsAsync(GetObjectTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets tags of a object.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetObjectTagsArgs | GetObjectTagsArgs Argument Object with object name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<Tagging>: Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Get Object Tags for the objectvarargs=newGetObjectTagsArgs().WithBucket(bucketName).WithObject(objectName);vartags=awaitminio.GetObjectTagsAsync(args);Console.WriteLine($"Got tags for object {bucketName}/{objectName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task RemoveObjectTagsAsync(RemoveObjectTagsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Deletes tags of a object.
Parameters
| Param | Type | Description |
|---|---|---|
args | RemoveObjectTagsArgs | RemoveObjectTagsArgs Argument Object with object name |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MalFormedXMLException : upon configuration XML in http request validation failure | |
UnexpectedMinioException : upon internal errors encountered during the operation |
Example
try{// Remove Tags for the objectvarargs=newRemoveObjectTagsArgs().WithBucket(bucketName).WithObject(objectName);awaitminio.RemoveObjectTagsAsync(args);Console.WriteLine($"Removed tags for object {bucketName}/{objectName}.");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task SetObjectRetentionAsync(SetObjectRetentionArgs args, CancellationToken cancellationToken = default(CancellationToken))
Sets retention configuration to an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | SetObjectRetentionArgs | SetObjectRetentionArgs Argument Object with bucket, object names, version id(optional) |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MissingObjectLockConfigurationException : upon bucket created with object lock not enabled | |
MalFormedXMLException : upon configuration XML in http request validation failure |
Example
try{// Setting Retention Configuration of the object.SetObjectRetentionArgsargs=newSetObjectRetentionArgs().WithBucket(bucketName).WithObject(objectName).WithRetentionValidDays(numOfDays);awaitminio.SetObjectRetentionAsync(args);Console.WriteLine($"Assigned retention configuration to object {bucketName}/{objectName}");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<ObjectRetentionConfiguration> GetObjectRetentionAsync(GetObjectRetentionArgs args, CancellationToken cancellationToken = default(CancellationToken))
Gets retention configuration of an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | GetObjectRetentionArgs | GetObjectRetentionArgs Argument Object with bucket, object names, version id(optional) |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task<ObjectRetentionConfiguration>: ObjectRetentionConfiguration object with configuration data. | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MissingObjectLockConfigurationException : upon bucket created with object lock not enabled | |
MalFormedXMLException : upon configuration XML in http request validation failure |
Example
try{// Get Retention configuration of an objectvarargs=newGetObjectRetentionArgs().WithBucket(bucketName).WithObject(objectName);ObjectRetentionConfigurationconfig=awaitminio.GetObjectRetentionAsync(args);Console.WriteLine($"Got retention configuration for object {bucketName}/{objectName}");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task ClearObjectRetentionAsync(ClearObjectRetentionArgs args, CancellationToken cancellationToken = default(CancellationToken))
Clears retention configuration to an object.
Parameters
| Param | Type | Description |
|---|---|---|
args | ClearObjectRetentionArgs | ClearObjectRetentionArgs Argument Object with bucket, object names, version id(optional) |
cancellationToken | System.Threading.CancellationToken | Optional parameter. Defaults to default(CancellationToken) |
| Return Type | Exceptions |
|---|---|
Task | Listed Exceptions: |
AuthorizationException : upon access or secret key wrong or not found | |
InvalidBucketNameException : upon invalid bucket name | |
InvalidObjectNameException : upon invalid object name | |
BucketNotFoundException : upon bucket with name not found | |
ObjectNotFoundException : upon object with name not found | |
MissingObjectLockConfigurationException : upon bucket created with object lock not enabled | |
MalFormedXMLException : upon configuration XML in http request validation failure |
Example
try{// Clearing the Retention Configuration of the object.ClearObjectRetentionArgsargs=newClearObjectRetentionArgs().WithBucket(bucketName).WithObject(objectName);awaitminio.ClearObjectRetentionAsync(args);Console.WriteLine($"Clears retention configuration to object {bucketName}/{objectName}");}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<string> PresignedGetObjectAsync(PresignedGetObjectArgs args)
Generates a presigned URL for HTTP GET operations. Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private. This presigned URL can have an associated expiration time in seconds after which it is no longer operational. The default expiry is set to 7 days.
Parameters
| Param | Type | Description |
|---|---|---|
args | PresignedGetObjectArgs | PresignedGetObjectArgs encapsulating bucket, object names, expiry, response headers & request date |
| Return Type | Exceptions |
|---|---|
Task<string> : string contains URL to download the object | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
InvalidExpiryRangeException : upon invalid expiry range. |
Example
try{PresignedGetObjectArgsargs=newPresignedGetObjectArgs().WithBucket("mybucket").WithObject("myobject").WithExpiry(60*60*24);Stringurl=awaitminioClient.PresignedGetObjectAsync(args);Console.WriteLine(url);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<string> PresignedPutObjectAsync(PresignedPutObjectArgs args)
Generates a presigned URL for HTTP PUT operations. Browsers/Mobile clients may point to this URL to upload objects directly to a bucket even if it is private. This presigned URL can have an associated expiration time in seconds after which it is no longer operational. The default expiry is set to 7 days.
Parameters
| Param | Type | Description |
|---|---|---|
args | PresignedPutObjectArgs | PresignedPutObjectArgs arguments object with bucket, object names & expiry |
| Return Type | Exceptions |
|---|---|
Task<string> : string contains URL to upload the object | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
InvalidKeyException : upon an invalid access key or secret key | |
ConnectionException : upon connection error | |
InvalidExpiryRangeException : upon invalid expiry range. |
Example
try{PresignedPutObjectArgsargs=PresignedPutObjectArgs().WithBucket("mybucket").WithObject("myobject").WithExpiry(60*60*24);Stringurl=awaitminioClient.PresignedPutObjectAsync(args);Console.WriteLine(url);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Task<Dictionary<string, string>> PresignedPostPolicyAsync(PresignedPostPolicyArgs args)
Allows setting policy conditions to a presigned URL for POST operations. Policies such as bucket name to receive object uploads, key name prefixes, expiry policy may be set.
Parameters
| Param | Type | Description |
|---|---|---|
args | PresignedPostPolicyArgs | PresignedPostPolicyArgs Arguments object includes bucket, object names & Post policy of an object. |
| Return Type | Exceptions |
|---|---|
Task<Dictionary<string, string>>: Map of strings to construct form-data. | Listed Exceptions: |
InvalidBucketNameException : upon invalid bucket name | |
ConnectionException : upon connection error | |
NoSuchAlgorithmException : upon requested algorithm was not found during signature calculation. |
Example
try{PostPolicypolicy=newPostPolicy();policy.SetContentType("image/png");policy.SetUserMetadata("custom","user");DateTimeexpiration=DateTime.UtcNow;policy.SetExpires(expiration.AddDays(10));policy.SetKey("my-objectname");policy.SetBucket("my-bucketname");PresignedPostPolicyArgsargs=PresignedPostPolicyArgs().WithBucket("my-bucketname").WithObject("my-objectname").WithPolicy(policy);Dictionary<string,string>formData=minioClient.Api.PresignedPostPolicy(args);stringcurlCommand="curl ";foreach(KeyValuePair<string,string>pairinformData){curlCommand=curlCommand+" -F "+pair.Key+"="+pair.Value;}curlCommand=curlCommand+" -F file=@/etc/bashrc https://s3.amazonaws.com/my-bucketname";Console.WriteLine(curlCommand);}catch(MinioExceptione){Console.WriteLine("Error occurred: "+e);}Adds application details to User-Agent.
Parameters
| Param | Type | Description |
|---|---|---|
appName | string | Name of the application performing the API requests |
appVersion | string | Version of the application performing the API requests |
Example
// Set Application name and version to be used in subsequent API requests.minioClient.SetAppInfo("myCloudApp","1.0.0")Enables HTTP tracing. The trace is written to the stdout.
Parameters
| Param | Type | Description |
|---|---|---|
logger | IRequestLogger | Implementation of interfaceMinio.IRequestLogger for serialization models for trace HTTP |
Example
// Set HTTP tracing on with default trace logger.minioClient.SetTraceOn()// Set custom logger for HTTP traceminioClient.SetTraceOn(newJsonNetLogger())Disables HTTP tracing.
Example
// Sets HTTP tracing off.minioClient.SetTraceOff()