C# Class Minio.MinioClient

显示文件 Open project: minio/minio-dotnet Class Usage Examples

Private Properties

Property Type Description
CalculatePartSize long
CompleteMultipartUpload void
GetListParts List>.Tuple
GetMultipartUploadsList List>.Tuple
GetObjectList List>.Tuple
ListParts IEnumerable
NewMultipartUpload string
ParseError Minio.Errors.ClientException
PutObject string
ReadFull byte[]
RemoveUpload void
StripXmlnsXsi string
UrlEncode string
isValidEndpoint bool
listIncompleteUploads IEnumerable

Public Methods

Method Description
BucketExists ( string bucketName ) : bool

Returns true if the specified bucketName exists, otherwise returns false.

GetObject ( string bucketName, string objectName, Action callback ) : void

Get an object. The object will be streamed to the callback given by the user.

GetPartialObject ( string bucketName, string objectName, ulong offset, Action callback ) : void

Get an object starting with the byte specified in offset. The object will be streamed to the callback given by the user

GetPartialObject ( string bucketName, string objectName, ulong offset, ulong length, Action callback ) : void

Get a byte range of an object given by the offset and length. The object will be streamed to the callback given by the user

ListBuckets ( ) : List

Lists all buckets owned by the user

ListIncompleteUploads ( string bucketName ) : IEnumerable

Lists all incomplete uploads in a given bucket

ListIncompleteUploads ( string bucketName, string prefix ) : IEnumerable

Lists all incomplete uploads in a given bucket and prefix

ListIncompleteUploads ( string bucketName, string prefix, bool recursive ) : IEnumerable

Lists all incomplete uploads in a given bucket and prefix recursively

ListObjects ( string bucketName ) : IEnumerable

List all objects in a bucket

ListObjects ( string bucketName, string prefix ) : IEnumerable

List all objects in a bucket with a given prefix

ListObjects ( string bucketName, string prefix, bool recursive ) : IEnumerable

List all objects non-recursively in a bucket with a given prefix, optionally emulating a directory

MakeBucket ( string bucketName ) : void

Create a private bucket with a give name.

MakeBucket ( string bucketName, string location ) : void

Create a bucket with a given name and location.

MinioClient ( Uri uri ) : System

Creates and returns an Cloud Storage client.

MinioClient ( Uri uri, string accessKey, string secretKey ) : System
MinioClient ( string endpoint ) : System

Creates and returns an Cloud Storage client

MinioClient ( string endpoint, int port, string accessKey, string secretKey ) : System
MinioClient ( string endpoint, int port, string accessKey, string secretKey, bool secure ) : System

Creates and returns an Cloud Storage client

MinioClient ( string url, string accessKey, string secretKey ) : System

Creates and returns an Cloud Storage client

MinioClient ( string endpoint, string accessKey, string secretKey, bool secure ) : System
PresignedGetObject ( string bucketName, string objectName, int expiresInt ) : string

Presigned Get url.

PresignedPostPolicy ( PostPolicy policy ) : string>.Dictionary

Presigned post policy

PresignedPutObject ( string bucketName, string objectName, int expiresInt ) : string

Presigned Put url.

PutObject ( string bucketName, string objectName, Stream data, long size, string contentType ) : void

Creates an object

RemoveBucket ( string bucketName ) : void

Remove a bucket

RemoveIncompleteUpload ( string bucketName, string objectName ) : void

Remove incomplete uploads from a given bucket and objectName

RemoveObject ( string bucketName, string objectName ) : void

Remove an object

SetAppInfo ( string appName, string appVersion ) : void
StatObject ( string bucketName, string objectName ) : ObjectStat

Tests the object's existence and returns metadata about existing objects.

Private Methods

Method Description
CalculatePartSize ( long size ) : long
CompleteMultipartUpload ( string bucketName, string objectName, string uploadId, string>.Dictionary etags ) : void
GetListParts ( string bucketName, string objectName, string uploadId, int partNumberMarker ) : List>.Tuple
GetMultipartUploadsList ( string bucketName, string prefix, string keyMarker, string uploadIdMarker, string delimiter ) : List>.Tuple
GetObjectList ( string bucketName, string prefix, bool recursive, string marker ) : List>.Tuple
ListParts ( string bucketName, string objectName, string uploadId ) : IEnumerable
NewMultipartUpload ( string bucketName, string objectName, string contentType ) : string
ParseError ( IRestResponse response ) : ClientException
PutObject ( string bucketName, string objectName, string uploadId, int partNumber, byte data, string contentType ) : string
ReadFull ( Stream data, int currentPartSize ) : byte[]
RemoveUpload ( string bucketName, string objectName, string uploadId ) : void
StripXmlnsXsi ( string input ) : string
UrlEncode ( string input ) : string
isValidEndpoint ( string endpoint ) : bool
listIncompleteUploads ( string bucketName, string prefix, string delimiter ) : IEnumerable

Lists all or delimited incomplete uploads in a given bucket with a given objectName

Method Details

BucketExists() public method

Returns true if the specified bucketName exists, otherwise returns false.
public BucketExists ( string bucketName ) : bool
bucketName string Bucket to test existence of
return bool

GetObject() public method

Get an object. The object will be streamed to the callback given by the user.
public GetObject ( string bucketName, string objectName, Action callback ) : void
bucketName string Bucket to retrieve object from
objectName string Name of object to retrieve
callback Action A stream will be passed to the callback
return void

GetPartialObject() public method

Get an object starting with the byte specified in offset. The object will be streamed to the callback given by the user
public GetPartialObject ( string bucketName, string objectName, ulong offset, Action callback ) : void
bucketName string Bucket to retrieve object from
objectName string Name of object to retrieve
offset ulong Number of bytes to skip
callback Action A stream will be passed to the callback
return void

GetPartialObject() public method

Get a byte range of an object given by the offset and length. The object will be streamed to the callback given by the user
public GetPartialObject ( string bucketName, string objectName, ulong offset, ulong length, Action callback ) : void
bucketName string Bucket to retrieve object from
objectName string Key of object to retrieve
offset ulong Number of bytes to skip
length ulong Length of requested byte range
callback Action A stream will be passed to the callback
return void

ListBuckets() public method

Lists all buckets owned by the user
public ListBuckets ( ) : List
return List

ListIncompleteUploads() public method

Lists all incomplete uploads in a given bucket
public ListIncompleteUploads ( string bucketName ) : IEnumerable
bucketName string Bucket to list all incomplepte uploads from
return IEnumerable

ListIncompleteUploads() public method

Lists all incomplete uploads in a given bucket and prefix
public ListIncompleteUploads ( string bucketName, string prefix ) : IEnumerable
bucketName string Bucket to list all incomplepte uploads from
prefix string prefix to list all incomplepte uploads
return IEnumerable

ListIncompleteUploads() public method

Lists all incomplete uploads in a given bucket and prefix recursively
public ListIncompleteUploads ( string bucketName, string prefix, bool recursive ) : IEnumerable
bucketName string Bucket to list all incomplepte uploads from
prefix string prefix to list all incomplepte uploads
recursive bool option to list incomplete uploads recursively
return IEnumerable

ListObjects() public method

List all objects in a bucket
public ListObjects ( string bucketName ) : IEnumerable
bucketName string Bucket to list objects from
return IEnumerable

ListObjects() public method

List all objects in a bucket with a given prefix
public ListObjects ( string bucketName, string prefix ) : IEnumerable
bucketName string Bucket to list objects from
prefix string Filters all objects not beginning with a given prefix
return IEnumerable

ListObjects() public method

List all objects non-recursively in a bucket with a given prefix, optionally emulating a directory
public ListObjects ( string bucketName, string prefix, bool recursive ) : IEnumerable
bucketName string Bucket to list objects from
prefix string Filters all objects not beginning with a given prefix
recursive bool Set to false to emulate a directory
return IEnumerable

MakeBucket() public method

Create a private bucket with a give name.
public MakeBucket ( string bucketName ) : void
bucketName string Name of the new bucket
return void

MakeBucket() public method

Create a bucket with a given name and location.
public MakeBucket ( string bucketName, string location ) : void
bucketName string Name of the new bucket
location string Name of the location
return void

MinioClient() public method

Creates and returns an Cloud Storage client.
public MinioClient ( Uri uri ) : System
uri System.Uri Location of the server, supports HTTP and HTTPS.
return System

MinioClient() public method

public MinioClient ( Uri uri, string accessKey, string secretKey ) : System
uri System.Uri
accessKey string
secretKey string
return System

MinioClient() public method

Creates and returns an Cloud Storage client
public MinioClient ( string endpoint ) : System
endpoint string
return System

MinioClient() public method

public MinioClient ( string endpoint, int port, string accessKey, string secretKey ) : System
endpoint string
port int
accessKey string
secretKey string
return System

MinioClient() public method

Creates and returns an Cloud Storage client
public MinioClient ( string endpoint, int port, string accessKey, string secretKey, bool secure ) : System
endpoint string
port int
accessKey string Access Key for authenticated requests
secretKey string Secret Key for authenticated requests
secure bool Boolean value set to true/false makes the request HTTPS/HTTP respectively
return System

MinioClient() public method

Creates and returns an Cloud Storage client
public MinioClient ( string url, string accessKey, string secretKey ) : System
url string Location of the server, supports HTTP and HTTPS
accessKey string Access Key for authenticated requests
secretKey string Secret Key for authenticated requests
return System

MinioClient() public method

public MinioClient ( string endpoint, string accessKey, string secretKey, bool secure ) : System
endpoint string
accessKey string
secretKey string
secure bool
return System

PresignedGetObject() public method

Presigned Get url.
public PresignedGetObject ( string bucketName, string objectName, int expiresInt ) : string
bucketName string Bucket to retrieve object from
objectName string Key of object to retrieve
expiresInt int Expiration time in seconds
return string

PresignedPostPolicy() public method

Presigned post policy
public PresignedPostPolicy ( PostPolicy policy ) : string>.Dictionary
policy PostPolicy
return string>.Dictionary

PresignedPutObject() public method

Presigned Put url.
public PresignedPutObject ( string bucketName, string objectName, int expiresInt ) : string
bucketName string Bucket to retrieve object from
objectName string Key of object to retrieve
expiresInt int Expiration time in seconds
return string

PutObject() public method

Creates an object
public PutObject ( string bucketName, string objectName, Stream data, long size, string contentType ) : void
bucketName string Bucket to create object in
objectName string Key of the new object
data Stream Stream of bytes to send
size long Total size of bytes to be written, must match with data's length
contentType string Content type of the new object, null defaults to "application/octet-stream"
return void

RemoveBucket() public method

Remove a bucket
public RemoveBucket ( string bucketName ) : void
bucketName string Name of bucket to remove
return void

RemoveIncompleteUpload() public method

Remove incomplete uploads from a given bucket and objectName
public RemoveIncompleteUpload ( string bucketName, string objectName ) : void
bucketName string Bucket to remove incomplete uploads from
objectName string Key to remove incomplete uploads from
return void

RemoveObject() public method

Remove an object
public RemoveObject ( string bucketName, string objectName ) : void
bucketName string Name of bucket to remove
objectName string Name of object to remove
return void

SetAppInfo() public method

public SetAppInfo ( string appName, string appVersion ) : void
appName string
appVersion string
return void

StatObject() public method

Tests the object's existence and returns metadata about existing objects.
public StatObject ( string bucketName, string objectName ) : ObjectStat
bucketName string Bucket to test object in
objectName string Name of the object to stat
return ObjectStat