From 639b29a1346ef30b1ebdab5b09079b513a9fc87d Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Tue, 4 May 2021 13:36:10 -0700 Subject: [PATCH] grpc: removed get wlan configs, achieved with get session --- daemon/core/api/grpc/client.py | 18 ------------------ daemon/core/api/grpc/server.py | 17 ----------------- daemon/proto/core/api/grpc/core.proto | 2 -- daemon/proto/core/api/grpc/wlan.proto | 8 -------- 4 files changed, 45 deletions(-) diff --git a/daemon/core/api/grpc/client.py b/daemon/core/api/grpc/client.py index 23a66f1f..e2d6b503 100644 --- a/daemon/core/api/grpc/client.py +++ b/daemon/core/api/grpc/client.py @@ -61,7 +61,6 @@ from core.api.grpc.services_pb2 import ( ) from core.api.grpc.wlan_pb2 import ( GetWlanConfigRequest, - GetWlanConfigsRequest, SetWlanConfigRequest, WlanConfig, WlanLinkRequest, @@ -1002,23 +1001,6 @@ class CoreGrpcClient: response = self.stub.ServiceAction(request) return response.result - def get_wlan_configs( - self, session_id: int - ) -> Dict[int, Dict[str, wrappers.ConfigOption]]: - """ - Get all wlan configurations. - - :param session_id: session id - :return: dict of node ids to dict of names to options - :raises grpc.RpcError: when session doesn't exist - """ - request = GetWlanConfigsRequest(session_id=session_id) - response = self.stub.GetWlanConfigs(request) - configs = {} - for node_id, mapped_config in response.configs.items(): - configs[node_id] = wrappers.ConfigOption.from_dict(mapped_config.config) - return configs - def get_wlan_config( self, session_id: int, node_id: int ) -> Dict[str, wrappers.ConfigOption]: diff --git a/daemon/core/api/grpc/server.py b/daemon/core/api/grpc/server.py index f18f2eec..8a3e570e 100644 --- a/daemon/core/api/grpc/server.py +++ b/daemon/core/api/grpc/server.py @@ -94,8 +94,6 @@ from core.api.grpc.services_pb2 import ( from core.api.grpc.wlan_pb2 import ( GetWlanConfigRequest, GetWlanConfigResponse, - GetWlanConfigsRequest, - GetWlanConfigsResponse, SetWlanConfigRequest, SetWlanConfigResponse, WlanLinkRequest, @@ -1171,21 +1169,6 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer): return ServiceActionResponse(result=result) - def GetWlanConfigs( - self, request: GetWlanConfigsRequest, context: ServicerContext - ) -> GetWlanConfigsResponse: - """ - Retrieve all wireless-lan configurations. - - :param request: request - :param context: core.api.grpc.core_pb2.GetWlanConfigResponse - :return: all wlan configurations - """ - logger.debug("get wlan configs: %s", request) - session = self.get_session(request.session_id, context) - configs = grpcutils.get_wlan_configs(session) - return GetWlanConfigsResponse(configs=configs) - def GetWlanConfig( self, request: GetWlanConfigRequest, context: ServicerContext ) -> GetWlanConfigResponse: diff --git a/daemon/proto/core/api/grpc/core.proto b/daemon/proto/core/api/grpc/core.proto index 28208e7d..2081cc90 100644 --- a/daemon/proto/core/api/grpc/core.proto +++ b/daemon/proto/core/api/grpc/core.proto @@ -109,8 +109,6 @@ service CoreApi { } // wlan rpc - rpc GetWlanConfigs (wlan.GetWlanConfigsRequest) returns (wlan.GetWlanConfigsResponse) { - } rpc GetWlanConfig (wlan.GetWlanConfigRequest) returns (wlan.GetWlanConfigResponse) { } rpc SetWlanConfig (wlan.SetWlanConfigRequest) returns (wlan.SetWlanConfigResponse) { diff --git a/daemon/proto/core/api/grpc/wlan.proto b/daemon/proto/core/api/grpc/wlan.proto index 9605d633..2d161a04 100644 --- a/daemon/proto/core/api/grpc/wlan.proto +++ b/daemon/proto/core/api/grpc/wlan.proto @@ -9,14 +9,6 @@ message WlanConfig { map config = 2; } -message GetWlanConfigsRequest { - int32 session_id = 1; -} - -message GetWlanConfigsResponse { - map configs = 1; -} - message GetWlanConfigRequest { int32 session_id = 1; int32 node_id = 2;