cterasdk.direct.client module#
- class cterasdk.direct.client.Client(baseurl, credentials)#
Bases:
object
- async blocks(file_id, blocks, max_workers)#
Blocks API.
- Parameters:
file_id (int) – File ID.
blocks (list[cterasdk.direct.exceptions.BlockInfo]) – List of BlockInfo objects, or list of integers identifying the block position.
max_workers (int) – Max concurrent tasks. A task will be dispatched for each block if no limited was specified.
- Returns:
List of Blocks.
- Return type:
- async close()#
- async executor(chunks, encryption_key, file_id=None, max_workers=None)#
Get Blocks.
- Parameters:
chunks (list[cterasdk.direct.types.Chunk]) – List of Chunks.
encryption_key (str) – Decryption Key.
file_id (int,optional) – File ID.
max_workers (int,optional) – Max concurrent tasks.
- Returns:
Callable Downloader
- Return type:
function
- async metadata(file_id)#
Direct IO Metadata API.
- Parameters:
file_id (int) – File ID.
- async streamer(file_id, byte_range)#
Stream API.
- Parameters:
file_id (int) – File ID.
byte_range (cterasdk.direct.types.ByteRange) – Byte Range.
- Returns:
Streamer Object
- Return type:
- class cterasdk.direct.client.Credentials(access_key_id, secret_access_key)#
Bases:
tuple
Tuple holding the access and secret keys to access objects using DirectIO
- access_key_id#
Access key
- secret_access_key#
Secret Key
- class cterasdk.direct.client.DirectIO(baseurl=None, access_key_id=None, secret_access_key=None)#
Bases:
object
- async blocks(file_id, blocks=None, max_workers=None)#
Get Blocks.
- Parameters:
file_id (int) – File ID
blocks (list[cterasdk.direct.exceptions.BlockInfo],optional) – List of BlockInfo objects, or list of integers identifying the block position.
max_workers (int,optional) – Max allowed concurrent tasks. A task will be dispatched for each block if no limited was specified.
- Returns:
Blocks
- Return type:
- async close()#
- async metadata(file_id)#
Get Metadata.
- Parameters:
file_id (int) – File ID
- async streamer(file_id, byte_range=None)#
Iterates over data chunks.
- Parameters:
file_id (int) – File ID.
byte_range (cterasdk.direct.types.ByteRange,optional) – Byte Range.
- Returns:
Stream Object
- Return type:
- cterasdk.direct.client.client_settings(parameters)#