local_connection_utils module
This module contains functions related to store managing and retrieving information from .local folder.
- check_jar_exists(jar)
- create_con_directory()
Create all directories in dirs array.
- get_all_connection_configs()
Get all connection configs from .local
- Returns:
array of connection configs
- Return type:
list
- get_log_file_path(logs_dir, integration_id=None, logs_type='INTEGRATION')
Get log files from the specified directory, filtered and sorted by modification time.
- Parameters:
logs_dir (
str) – Directory where logs are stored.integration_id (
str|None) – ID of the integration (if applicable).logs_type (
str) – Type of log file (e.g., “INTEGRATION”, “SCHEDULER”, “CELERY”, “API”).
- Return type:
List[str]- Returns:
A list of log file paths sorted by modification time (newest first).
- paginate_log_content(log_file_paths, page, per_page)
Paginate the content of multiple log files.
- Parameters:
log_file_paths (
List[str]) – A list of paths to log files.page (
int) – The page number to retrieve.per_page (
int) – The number of lines per page.
- Returns:
A list of paginated log entries from all log files (newest first).
The total number of pages across all log files.
- Return type:
A tuple containing
- read_all_apis()
Reads all the APIs from the API directory and returns a list of JSON file names.
- Returns:
A list of JSON file names without the extension.
- Return type:
list
- read_all_connection_configs()
Read all connection configs database and JDBC
- Returns:
{“database”: database_data,”api”: jdbc_data}
- Return type:
dict
- read_all_pipeline_configs()
Read all pipeline configurations from .local/pipelines
- Returns:
List of all pipelines
- Return type:
list
- read_api_config(apiname)
- read_connection_config(config)
Read a single config file from connections_directory in .local
- Parameters:
config (string) – Name of the config file
- Returns:
{‘filename’:’myconfiguration’, ‘data’:’json_data’}
- Return type:
dict
- read_connection_configs(configs)
Read all configuration files in config from .local folder
- Parameters:
configs (list) – Names of configuration files
- Returns:
{‘filename’:’myconfiguration’}
- Return type:
dict
- read_pipeline_detals(pipeline)
Read single pipeline configuration
- Parameters:
pipeline (string) – Name of the pipeline
- Returns:
details of the pipeline
- Return type:
dict
- read_single_connection_config(config)
Read single connection configuration from connection directory
- Parameters:
config (string) – Name of the pipeline
- Returns:
config of the pipeline
- Return type:
dict
- store_connection_config(json_data, filename='', is_api=False, connection_name='')
Store connection settings in a file in .local
- Parameters:
filename (string) – Connection name picked as filename
json_data (dict) – Connection details as key value pair.
- Returns:
True if saved else False
- Return type:
Boolean