trolldb.cli module

Main interface.

trolldb.cli.prepend_uri(msg, protocol='ssh')[source]

Add the protocol and the host to the beginning of the URI.

async trolldb.cli.delete_uri_from_collection(collection: motor.motor_asyncio.AsyncIOMotorCollection, uri: str) int[source]

Deletes a document from collection and logs the deletion.

Parameters:
  • collection – The collection object which includes the document to delete.

  • uri – The URI used to query the collection. It can be either a URI of a previously recorded file message or a dataset message.

Returns:

Number of deleted documents.

async trolldb.cli.record_messages(config: AppConfig) None[source]

Record the metadata of messages into the database.

async trolldb.cli.record_messages_from_config(config_file: pydantic.FilePath) None[source]

Record messages into the database, getting the configuration from a file.

async trolldb.cli.record_messages_from_command_line(args=None) None[source]

Record messages into the database, command-line interface.

trolldb.cli.run_sync() None[source]

Runs the interface synchronously.