FINOS Legend Database Manager
- FINOS
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 22 | 14 Aug 2023 | |
latest/edge | 23 | 21 Aug 2023 |
juju deploy finos-legend-db-k8s
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
charms.finos_legend_db_k8s.v0.legend_database
-
- Last updated 22 Oct 2021
- Revision Library version 0.4
Module defining Legend DB consumer class and helpers.
Index
def
get_database_connection_from_mongo_data(
mongodb_consumer_data,
mongodb_databases
)
Returns a dict with Mongo connection info for Legend components.
Arguments
connection data as returned by charms.mongodb_k8s.v0.mongodb.MongoConsumer.connection() Should be a dict of the following structure: { "username": "user", "password": "pass", "replica_set_uri": "Replica set URI with user/pass/login DB" }
List of database names as returned by charms.mongodb_k8s.v0.mongodb.MongoConsumer.databases()
Returns
Dictionary with the following structure: { "uri": "<replica set URI (with user/pass, no DB name)>", "username": "<username>", "password": "<password>", "database": "<database name>" }
Description
Output is compatible with LegendDatabaseConsumer.get_legend_database_creds()
.
def
set_legend_database_creds_in_relation_data(
relation_data,
creds
)
Set connection data for MongoDB from the provided relation data.
Arguments
Data of the relation to set the info into.
Returns
True if the provided creds are of a valid structure, else False.
class LegendDatabaseConsumer
Description
Class which facilitates reading Legend DB creds from relation data. None
Methods
LegendDatabaseConsumer. __init__( self , charm , relation_name )
LegendDatabaseConsumer. get_legend_database_creds( self , relation_id )
Get connection data for MongoDB from the provided relation.
Description
Args: relation_id: ID of the relation to fetch data from.
Returns: Dictionary with the following structure: { "uri": "<replica set URI (with user/pass, no DB name)>", "username": "<username>", "password": "<password>", "database": "<database name>" }
Raises: TooManyRelatedAppsError if relation id is not provided and multiple relation of the same name are present.