nat.cli.commands.object_store.object_store#

Attributes#

Functions#

get_object_store_config(...)

Process common object store arguments and return the config class

upload_file(object_store, file_path, key)

Upload a single file to object store.

object_store_command_decorator(async_func)

Decorator that handles the common object store command pattern.

upload_command(store, local_dir, **_kwargs)

Upload a directory to an object store.

delete_command(store, keys, **_kwargs)

Delete files from an object store.

object_store_command(**_kwargs)

Manage object store operations including uploading files and directories.

register_object_store_commands()

Module Contents#

logger#
STORE_CONFIGS#
get_object_store_config(
\*\*kwargs,
) nat.data_models.object_store.ObjectStoreBaseConfig#

Process common object store arguments and return the config class

async upload_file(
object_store: nat.object_store.interfaces.ObjectStore,
file_path: pathlib.Path,
key: str,
)#

Upload a single file to object store.

Args:

object_store: The object store instance to use. file_path: The path to the file to upload. key: The key to upload the file to.

object_store_command_decorator(async_func)#

Decorator that handles the common object store command pattern.

The decorated function should take (store: ObjectStore, kwargs) as parameters and return an exit code (0 for success).

async upload_command(
store: nat.object_store.interfaces.ObjectStore,
local_dir: pathlib.Path,
**_kwargs,
)#

Upload a directory to an object store.

Args:

local_dir: The local directory to upload. store: The object store to use. _kwargs: Additional keyword arguments.

async delete_command(
store: nat.object_store.interfaces.ObjectStore,
keys: list[str],
**_kwargs,
)#

Delete files from an object store.

Args:

store: The object store to use. keys: The keys to delete. _kwargs: Additional keyword arguments.

object_store_command(**_kwargs)#

Manage object store operations including uploading files and directories.

register_object_store_commands()#