def to_proto(self) -> services_pb2.ServiceConfig: return services_pb2.ServiceConfig( node_id=self.node_id, service=self.service, files=self.files, directories=self.directories, startup=self.startup, validate=self.validate, shutdown=self.shutdown, )
def get_service_configs_proto(self) -> List[services_pb2.ServiceConfig]: configs = [] for node in self.session.nodes.values(): if not NodeUtils.is_container_node(node.type): continue if not node.service_configs: continue for name, config in node.service_configs.items(): config_proto = services_pb2.ServiceConfig( node_id=node.id, service=name, directories=config.dirs, files=config.configs, startup=config.startup, validate=config.validate, shutdown=config.shutdown, ) configs.append(config_proto) return configs