updates to config services dialogs in coretk, initial working state for running config services from the coretk gui
This commit is contained in:
parent
83e7853821
commit
da107cc1d9
9 changed files with 111 additions and 209 deletions
|
@ -11,7 +11,7 @@ import grpc
|
|||
import netaddr
|
||||
|
||||
from core import utils
|
||||
from core.api.grpc import core_pb2, core_pb2_grpc
|
||||
from core.api.grpc import configservices_pb2, core_pb2, core_pb2_grpc
|
||||
from core.api.grpc.configservices_pb2 import (
|
||||
GetConfigServiceDefaultsRequest,
|
||||
GetConfigServiceDefaultsResponse,
|
||||
|
@ -175,6 +175,7 @@ class CoreGrpcClient:
|
|||
service_configs: List[core_pb2.ServiceConfig] = None,
|
||||
service_file_configs: List[core_pb2.ServiceFileConfig] = None,
|
||||
asymmetric_links: List[core_pb2.Link] = None,
|
||||
config_service_configs: List[configservices_pb2.ConfigServiceConfig] = None,
|
||||
) -> core_pb2.StartSessionResponse:
|
||||
"""
|
||||
Start a session.
|
||||
|
@ -191,6 +192,7 @@ class CoreGrpcClient:
|
|||
:param service_configs: node service configurations
|
||||
:param service_file_configs: node service file configurations
|
||||
:param asymmetric_links: asymmetric links to edit
|
||||
:param config_service_configs: config service configurations
|
||||
:return: start session response
|
||||
"""
|
||||
request = core_pb2.StartSessionRequest(
|
||||
|
@ -206,6 +208,7 @@ class CoreGrpcClient:
|
|||
service_configs=service_configs,
|
||||
service_file_configs=service_file_configs,
|
||||
asymmetric_links=asymmetric_links,
|
||||
config_service_configs=config_service_configs,
|
||||
)
|
||||
return self.stub.StartSession(request)
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ def add_node_data(node_proto: core_pb2.Node) -> Tuple[NodeTypes, int, NodeOption
|
|||
options.opaque = node_proto.opaque
|
||||
options.image = node_proto.image
|
||||
options.services = node_proto.services
|
||||
options.config_services = node_proto.config_services
|
||||
if node_proto.emane:
|
||||
options.emane = node_proto.emane
|
||||
if node_proto.server:
|
||||
|
|
|
@ -179,6 +179,14 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
|
|||
for config in request.service_configs:
|
||||
grpcutils.service_configuration(session, config)
|
||||
|
||||
# config service configs
|
||||
for config in request.config_service_configs:
|
||||
node = self.get_node(session, config.node_id, context)
|
||||
service = node.config_services[request.name]
|
||||
service.set_config(config.config)
|
||||
for name, template in config.templates.values():
|
||||
service.custom_template(name, template)
|
||||
|
||||
# service file configs
|
||||
for config in request.service_file_configs:
|
||||
session.services.set_service_file(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue