Show / Hide Table of Contents

Class QBucket

This class manages the Qarnot Ceph buckets (S3 compatible).

Inheritance
object
QAbstractStorage
QBucket
Inherited Members
QAbstractStorage.UploadFileAsync(string, string, CancellationToken)
QAbstractStorage.DownloadFileAsync(string, string, CancellationToken)
QAbstractStorage.UploadStringAsync(string, string, Encoding, CancellationToken)
QAbstractStorage.DownloadStringAsync(string, Encoding, CancellationToken)
QAbstractStorage.UploadBytesAsync(byte[], string, CancellationToken)
QAbstractStorage.SyncRemoteToLocalAsync(string, CancellationToken, bool, string)
QAbstractStorage.SyncLocalToRemoteAsync(string, CancellationToken, bool, string)
QAbstractStorage.UploadFolderAsync(string, string, CancellationToken)
QAbstractStorage.DownloadFolderAsync(string, string, CancellationToken)
QAbstractStorage.SyncRemoteToLocalAsync(string, bool, string)
QAbstractStorage.SyncLocalToRemoteAsync(string, bool, string)
QAbstractStorage.Create(CancellationToken)
QAbstractStorage.Update(CancellationToken)
QAbstractStorage.Delete(CancellationToken)
QAbstractStorage.ListEntries(string, CancellationToken)
QAbstractStorage.ListFiles(CancellationToken)
QAbstractStorage.ListFiles(string, CancellationToken)
QAbstractStorage.DeleteEntry(string, CancellationToken)
QAbstractStorage.UploadStream(Stream, string, CancellationToken)
QAbstractStorage.UploadStream(Stream, string, char, CancellationToken)
QAbstractStorage.DownloadStream(string, CancellationToken)
QAbstractStorage.DownloadStream(string, char, CancellationToken)
QAbstractStorage.UploadFile(string, string, CancellationToken)
QAbstractStorage.DownloadFile(string, string, CancellationToken)
QAbstractStorage.UploadString(string, string, Encoding, CancellationToken)
QAbstractStorage.DownloadString(string, Encoding, CancellationToken)
QAbstractStorage.UploadBytes(byte[], string, CancellationToken)
QAbstractStorage.UploadFolder(string, string, CancellationToken)
QAbstractStorage.DownloadFolder(string, string, CancellationToken)
QAbstractStorage.SyncRemoteToLocal(string, bool, string)
QAbstractStorage.SyncRemoteToLocal(string, CancellationToken, bool, string)
QAbstractStorage.SyncLocalToRemote(string, bool, string)
QAbstractStorage.SyncLocalToRemote(string, CancellationToken, bool, string)
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public class QBucket : QAbstractStorage

Constructors

QBucket(Connection, string, bool)

Create a bucket object.

Declaration
public QBucket(Connection connection, string shortname, bool create = true)
Parameters
Type Name Description
Connection connection

The inner connection object.

string shortname

The bucket name.

bool create

bool, to create the resource on the api too.

Properties

CacheTTLSec

Time to live for the resource cache (in seconds). Override the task default value DefaultResourcesCacheTTLSec

Declaration
public int? CacheTTLSec { get; protected set; }
Property Value
Type Description
int?

Connection

The inner Connection object.

Declaration
public override Connection Connection { get; }
Property Value
Type Description
Connection
Overrides
QAbstractStorage.Connection

CreationDate

The bucket creation date

Declaration
public override DateTime CreationDate { get; }
Property Value
Type Description
DateTime
Overrides
QAbstractStorage.CreationDate

FileCount

Number of files in this bucket. Use Update or UpdateAsync to refresh. Note: only available for Qarnot's Buckets.

Declaration
public override int FileCount { get; }
Property Value
Type Description
int
Overrides
QAbstractStorage.FileCount

Filtering

Add filtering to the bucket content so that only part of it is made available to tasks

Declaration
public ABucketFiltering Filtering { get; protected set; }
Property Value
Type Description
ABucketFiltering

ResourcesTransformation

Add a transformation to resources as seen in the execution environment

Declaration
public AResourcesTransformation ResourcesTransformation { get; protected set; }
Property Value
Type Description
AResourcesTransformation

Shortname

The bucket name.

Declaration
public override string Shortname { get; protected set; }
Property Value
Type Description
string
Overrides
QAbstractStorage.Shortname

UniqueId

The bucket name.

Declaration
public override string UniqueId { get; }
Property Value
Type Description
string
Overrides
QAbstractStorage.UniqueId

UsedSpaceBytes

Size of this bucket in bytes. Use Update or UpdateAsync to refresh. Note: only available for Qarnot's Buckets.

Declaration
public override long UsedSpaceBytes { get; }
Property Value
Type Description
long
Overrides
QAbstractStorage.UsedSpaceBytes

Methods

CreateAsync(CancellationToken)

Create the bucket.

Declaration
public override Task CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

A token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.CreateAsync(CancellationToken)

DeleteAsync(CancellationToken)

Delete this bucket. Note: this method also remove all the objects inside this bucket.

Declaration
public override Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.DeleteAsync(CancellationToken)

DeleteEntryAsync(string, CancellationToken)

Delete a file or folder in this bucket. Note: this method also remove all the sub-objects inside the deleted folder.

Declaration
public override Task DeleteEntryAsync(string remotePath, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string remotePath

The entry to remove.

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.DeleteEntryAsync(string, CancellationToken)

DownloadStreamAsync(string, char, CancellationToken)

Get a stream on a file in this bucket.(should be disposed)

Declaration
public override Task<Stream> DownloadStreamAsync(string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string remoteFile

The source file name in this bucket.

char pathDirectorySeparator

PathDirectorySeparator char that will change the remote file path to match the folder hierarchy ('/' on linux, '' on windows).

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task<Stream>

A stream with the file's data.

Overrides
QAbstractStorage.DownloadStreamAsync(string, char, CancellationToken)

DownloadStreamAsync(string, CancellationToken)

Get a stream on a file in this bucket.

Declaration
public override Task<Stream> DownloadStreamAsync(string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string remoteFile

The source file name in this bucket.

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task<Stream>

A stream with the file's data.

Overrides
QAbstractStorage.DownloadStreamAsync(string, CancellationToken)

ListEntriesAsync(string, CancellationToken)

List the files and folders entries in the corresponding folder (without content of subfolders).

Declaration
public override Task<List<QAbstractStorageEntry>> ListEntriesAsync(string remoteFolder = "", CancellationToken cancellationToken = default)
Parameters
Type Name Description
string remoteFolder

The folder to list.

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task<List<QAbstractStorageEntry>>

A list of QAbstractStorageEntry

Overrides
QAbstractStorage.ListEntriesAsync(string, CancellationToken)

ListFilesAsync(string, CancellationToken)

List all files and folders from the root of the bucket.

Declaration
public override Task<List<QAbstractStorageEntry>> ListFilesAsync(string prefix, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string prefix

Prefix for file search.

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task<List<QAbstractStorageEntry>>

A list of storage entries

Overrides
QAbstractStorage.ListFilesAsync(string, CancellationToken)

ListFilesAsync(CancellationToken)

List all files and folders from the root of the bucket.

Declaration
public override Task<List<QAbstractStorageEntry>> ListFilesAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task<List<QAbstractStorageEntry>>

A list of storage entries

Overrides
QAbstractStorage.ListFilesAsync(CancellationToken)

UpdateAsync(CancellationToken)

Update this bucket statistics.

Declaration
public override Task UpdateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.UpdateAsync(CancellationToken)

UploadStreamAsync(Stream, string, char, CancellationToken)

Write a stream to a file in this bucket.

Declaration
public override Task UploadStreamAsync(Stream sourceStream, string remoteFile, char pathDirectorySeparator, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream sourceStream

The source stream.

string remoteFile

The destination file name in this bucket.

char pathDirectorySeparator

PathDirectorySeparator char that will change the remote file path to match the folder hierarchy ('/' on linux, '' on windows).

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.UploadStreamAsync(Stream, string, char, CancellationToken)

UploadStreamAsync(Stream, string, CancellationToken)

Write a stream to a file in this bucket.

Declaration
public override Task UploadStreamAsync(Stream sourceStream, string remoteFile, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Stream sourceStream

The source stream.

string remoteFile

The destination file name in this bucket.

CancellationToken cancellationToken

Optional token to cancel the request.

Returns
Type Description
Task
Overrides
QAbstractStorage.UploadStreamAsync(Stream, string, CancellationToken)

WithCacheTTL(int)

Returns a copy of the bucket object with a cache TTL added

Declaration
public QBucket WithCacheTTL(int ttl)
Parameters
Type Name Description
int ttl

The resources cache TTL to add

Returns
Type Description
QBucket

WithFiltering(ABucketFiltering)

Returns a copy of the bucket object with a filtering added

Declaration
public QBucket WithFiltering(ABucketFiltering filtering)
Parameters
Type Name Description
ABucketFiltering filtering

The filtering to add

Returns
Type Description
QBucket

WithResourcesTransformation(AResourcesTransformation)

Returns a copy of the bucket object with a resources transformation added

Declaration
public QBucket WithResourcesTransformation(AResourcesTransformation transformation)
Parameters
Type Name Description
AResourcesTransformation transformation

The resources transformation to add

Returns
Type Description
QBucket
In this article
Back to top Generated by DocFX