import yaml class Config: def __init__(self, filename): self.filename = filename self.providers = [] self.prometheus_url = None self.database_url = None self.load_config() def load_config(self): """load the configuration from the file""" with open(self.filename, 'r') as file: data = yaml.safe_load(file) self.providers = data.get('providers', []) self.prometheus_url = data.get('prometheus_url', None) self.database_url = data.get('database_url', None) def get_providers(self): """return the provider information from the configuration""" return self.providers def get_provider(self, provider_name): """return the provider information from the configuration""" for provider in self.providers: if provider.get('name') == provider_name: return provider return None def get_prometheus_url(self): """return the prometheus url from the configuration""" return self.prometheus_url def get_database_url(self): """return the database url from the configuration""" return self.database_url