code: def apply_config(self, config):
          self.host = config.get("host", "127.0.0.1")
          self.configured_ports = config.get("ports", [config.get("port")])
          self.discovery = config["discovery"]
          self.metadata = config.get("metadata", {})
          self.update_ports()
          self.check_interval = config["checks"]["interval"]
          self.update_checks(config["checks"])