runner.mongodb

Module Contents

Functions

ensure_mongodb(func)

Decorator to raise an exception before running a function in case the mongodb

execute_root_shell(command: Optional[str])

Open a root shell on the MongoDB database. If a command is given

list_databases() → List[dict]

List all existing databases

list_users() → List[dict]

List all existing users

create_user(user: str, password: str, roles: List[str])

Create a new user

drop_database(database_name: str)

Drop the selected database

copy_database(source_db_name: str, destination_db_name: str)

Copy an existing database

create_root_user()

Create the root user

reset_mongodb_password(current_password: str = None)

Reset the mongodb root user password

Attributes

logger

MONGODB_ROOT_PASSWORD

container

runner.mongodb.logger[source]
runner.mongodb.MONGODB_ROOT_PASSWORD[source]
runner.mongodb.container[source]
runner.mongodb.ensure_mongodb(func)[source]

Decorator to raise an exception before running a function in case the mongodb server is not available.

runner.mongodb.execute_root_shell(command: Optional[str])[source]

Open a root shell on the MongoDB database. If a command is given it is executed.

runner.mongodb.list_databases()List[dict][source]

List all existing databases

runner.mongodb.list_users()List[dict][source]

List all existing users

runner.mongodb.create_user(user: str, password: str, roles: List[str])[source]

Create a new user

runner.mongodb.drop_database(database_name: str)[source]

Drop the selected database

runner.mongodb.copy_database(source_db_name: str, destination_db_name: str)[source]

Copy an existing database

runner.mongodb.create_root_user()[source]

Create the root user

runner.mongodb.reset_mongodb_password(current_password: str = None)[source]

Reset the mongodb root user password