diff --git a/daemon/core/api/grpc/client.py b/daemon/core/api/grpc/client.py index c258c91e..29e65daf 100644 --- a/daemon/core/api/grpc/client.py +++ b/daemon/core/api/grpc/client.py @@ -25,7 +25,6 @@ from core.api.grpc.configservices_pb2 import ( GetConfigServiceDefaultsRequest, GetConfigServicesRequest, GetNodeConfigServiceRequest, - SetNodeConfigServiceRequest, ) from core.api.grpc.core_pb2 import ExecuteScriptRequest from core.api.grpc.emane_pb2 import ( @@ -1130,25 +1129,6 @@ class CoreGrpcClient: response = self.stub.GetNodeConfigService(request) return dict(response.config) - def set_node_config_service( - self, session_id: int, node_id: int, name: str, config: Dict[str, str] - ) -> bool: - """ - Assigns a config service to a node with the provided configuration. - - :param session_id: session node belongs to - :param node_id: id of node to assign config service to - :param name: name of service - :param config: service configuration - :return: True for success, False otherwise - :raises grpc.RpcError: when session or node doesn't exist - """ - request = SetNodeConfigServiceRequest( - session_id=session_id, node_id=node_id, name=name, config=config - ) - response = self.stub.SetNodeConfigService(request) - return response.result - def get_emane_event_channel(self, session_id: int) -> wrappers.EmaneEventChannel: """ Retrieves the current emane event channel being used for a session. diff --git a/daemon/core/api/grpc/server.py b/daemon/core/api/grpc/server.py index 534c1578..bd6a758e 100644 --- a/daemon/core/api/grpc/server.py +++ b/daemon/core/api/grpc/server.py @@ -28,8 +28,6 @@ from core.api.grpc.configservices_pb2 import ( GetConfigServicesResponse, GetNodeConfigServiceRequest, GetNodeConfigServiceResponse, - SetNodeConfigServiceRequest, - SetNodeConfigServiceResponse, ) from core.api.grpc.core_pb2 import ExecuteScriptResponse from core.api.grpc.emane_pb2 import ( @@ -1402,29 +1400,6 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer): templates=templates, config=config, modes=modes ) - def SetNodeConfigService( - self, request: SetNodeConfigServiceRequest, context: ServicerContext - ) -> SetNodeConfigServiceResponse: - """ - Set custom config, for a given configuration service, for a given node. - - :param request: set node config service request - :param context: grpc context - :return: set node config service response - """ - session = self.get_session(request.session_id, context) - node = self.get_node(session, request.node_id, context, CoreNode) - self.validate_service(request.name, context) - service = node.config_services.get(request.name) - if service: - service.set_config(request.config) - return SetNodeConfigServiceResponse(result=True) - else: - context.abort( - grpc.StatusCode.NOT_FOUND, - f"node {node.name} missing service {request.name}", - ) - def GetEmaneEventChannel( self, request: GetEmaneEventChannelRequest, context: ServicerContext ) -> GetEmaneEventChannelResponse: diff --git a/daemon/proto/core/api/grpc/configservices.proto b/daemon/proto/core/api/grpc/configservices.proto index 7a71ab8c..401a9198 100644 --- a/daemon/proto/core/api/grpc/configservices.proto +++ b/daemon/proto/core/api/grpc/configservices.proto @@ -66,14 +66,3 @@ message GetNodeConfigServiceRequest { message GetNodeConfigServiceResponse { map config = 1; } - -message SetNodeConfigServiceRequest { - int32 session_id = 1; - int32 node_id = 2; - string name = 3; - map config = 4; -} - -message SetNodeConfigServiceResponse { - bool result = 1; -} diff --git a/daemon/proto/core/api/grpc/core.proto b/daemon/proto/core/api/grpc/core.proto index 0466a449..c0f735f3 100644 --- a/daemon/proto/core/api/grpc/core.proto +++ b/daemon/proto/core/api/grpc/core.proto @@ -87,8 +87,6 @@ service CoreApi { } rpc GetNodeConfigService (configservices.GetNodeConfigServiceRequest) returns (configservices.GetNodeConfigServiceResponse) { } - rpc SetNodeConfigService (configservices.SetNodeConfigServiceRequest) returns (configservices.SetNodeConfigServiceResponse) { - } // wlan rpc rpc GetWlanConfig (wlan.GetWlanConfigRequest) returns (wlan.GetWlanConfigResponse) {