tensorbay.client.storage_config#

Related classes for the Storage Config.

class tensorbay.client.cloud_storage.CloudClient(name, client)[source]#

Bases: object

CloudClient defines the client to interact between local and cloud platform.

Parameters
  • name (str) – Name of the auth cloud storage config.

  • client (tensorbay.client.requests.Client) – The initial client to interact between local and TensorBay.

Return type

None

list_auth_data(path='')[source]#

List all cloud files in the given directory as AuthData.

Parameters

path (str) – The directory path on the cloud platform.

Returns

The list of AuthData of all the cloud files.

Return type

List[tensorbay.dataset.data.AuthData]

class tensorbay.client.cloud_storage.StorageConfig(name, file_path, type_, is_graviti_storage)[source]#

Bases: tensorbay.utility.attr.AttrsMixin, tensorbay.utility.repr.ReprMixin

This is a class stores the information of storage config.

Parameters
  • name (str) – The storage config name.

  • file_path (str) – Storage config path of the bucket.

  • type – Type of the storage provider, such as oss, s3, azure.

  • is_graviti_storage (bool) – Whether the config is belong to graviti.

  • type_ (str) –

Return type

None

classmethod loads(contents)[source]#

Loads a StorageConfig instance from the given contents.

Parameters

contents (Dict[str, Any]) –

The given dict containing the storage config:

{
    "name":                 <str>,
    "filePath":             <str>,
    "type":                 <str>,
    "isGravitiStorage":     <boolean>
}

Returns

The loaded StorageConfig instance.

Return type

tensorbay.client.cloud_storage._T

dumps()[source]#

Dumps the storage config into a dict.

Returns

A dict containing all the information of the StorageConfig:

{
    "name":                 <str>,
    "filePath":             <str>,
    "type":                 <str>,
    "isGravitiStorage":     <boolean>
}

Return type

Dict[str, Any]