grpc: combined get services and get config services into new get config call, that can be used to get all daemon configuration information
This commit is contained in:
parent
42dc56c56b
commit
8108db545a
8 changed files with 66 additions and 115 deletions
|
@ -175,7 +175,7 @@ class ConfigServiceDefaults:
|
|||
|
||||
@classmethod
|
||||
def from_proto(
|
||||
cls, proto: configservices_pb2.GetConfigServicesResponse
|
||||
cls, proto: configservices_pb2.GetConfigServiceDefaultsResponse
|
||||
) -> "ConfigServiceDefaults":
|
||||
config = ConfigOption.from_dict(proto.config)
|
||||
modes = {x.name: dict(x.config) for x in proto.modes}
|
||||
|
@ -886,6 +886,18 @@ class Session:
|
|||
self.options[key] = option
|
||||
|
||||
|
||||
@dataclass
|
||||
class CoreConfig:
|
||||
services: List[Service] = field(default_factory=list)
|
||||
config_services: List[ConfigService] = field(default_factory=list)
|
||||
|
||||
@classmethod
|
||||
def from_proto(cls, proto: core_pb2.GetConfigResponse) -> "CoreConfig":
|
||||
services = [Service.from_proto(x) for x in proto.services]
|
||||
config_services = [ConfigService.from_proto(x) for x in proto.config_services]
|
||||
return CoreConfig(services=services, config_services=config_services)
|
||||
|
||||
|
||||
@dataclass
|
||||
class LinkEvent:
|
||||
message_type: MessageType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue