Loader
ConfigLoader
Source code in libs/python/services/setup/config-loader/config_loader/loader.py
__init__()
Initialize the ConfigLoader.
Note
This class is used to load configurations from the config handler API client.
Source code in libs/python/services/setup/config-loader/config_loader/loader.py
fetch_configs_for_service(service_name, context_env)
async
Fetch configurations for a specific service and context environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service_name |
str
|
The name of the service for which configurations are to be fetched. |
required |
context_env |
str
|
The context environment for which configurations are to be fetched. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Note
This method fetches configurations and registers them using the register_config function.
Source code in libs/python/services/setup/config-loader/config_loader/loader.py
fetch_configs(service, context_env)
async
Fetch configurations for a given service and context environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service |
str
|
The name of the service for which configurations are to be fetched. |
required |
context_env |
str
|
The context environment for which configurations are to be fetched. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, ConfigDTO]]
|
Dict[str, Dict[str, ConfigDTO]]: A dictionary containing configurations organized by context and ID. |
Note
The mapping_config dictionary will be populated by this function.
Source code in libs/python/services/setup/config-loader/config_loader/loader.py
register_config(context, config_id, config)
Register a configuration in the mapping_config dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context |
str
|
The context for which the configuration is being registered. |
required |
config_id |
str
|
The ID of the configuration. |
required |
config |
ConfigDTO
|
The configuration object to be registered. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Raises:
| Type | Description |
|---|---|
Exception
|
If a configuration with the same ID already exists |