grpc: removed set node config service, achieved with start session

This commit is contained in:
Blake Harnden 2021-05-04 15:57:53 -07:00
parent 805be3f809
commit 42dc56c56b
4 changed files with 0 additions and 58 deletions

View file

@ -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.

View file

@ -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:

View file

@ -66,14 +66,3 @@ message GetNodeConfigServiceRequest {
message GetNodeConfigServiceResponse {
map<string, string> config = 1;
}
message SetNodeConfigServiceRequest {
int32 session_id = 1;
int32 node_id = 2;
string name = 3;
map<string, string> config = 4;
}
message SetNodeConfigServiceResponse {
bool result = 1;
}

View file

@ -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) {