Metadata service API¶
- class MetadataAPI(kv_host: str, kv_port: int)[source]¶
-
- async new_account(username: str, password: str)[source]¶
Registers a new account
Creates a new account. Checks that the username is not registered.
- Parameters:
username – Accounts username
password – Accounts password
- async new_dataset(username: str, password: str, dataset_name: str)[source]¶
Registers a new dataset
Validates the account credentials, and creates a new dataset associated to the account. It updates the account metadata to add access to the new dataset. The dataset name must bu unique.
- Parameters:
username – Accounts username
password – Accounts password
dataset_name – Name of the new dataset. Must be unique.
- Raises:
Exception('Account is not valid!') – If wrong credentials
- async add_account_to_dataset(username: str, password: str, dataset_name: str, account_name: str)[source]¶
Allow a certain account to access a certain dataset.
The owner of a dataset can call this and add access to an arbitrary account.
- async get_all_objects(filter_func: Callable[[ObjectMetadata], bool] | None = None) dict[UUID, ObjectMetadata] [source]¶