grpc: removed get node config services, achieved with get node or get session

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

View file

@ -25,7 +25,6 @@ from core.api.grpc.configservices_pb2 import (
GetConfigServiceDefaultsRequest,
GetConfigServicesRequest,
GetNodeConfigServiceRequest,
GetNodeConfigServicesRequest,
SetNodeConfigServiceRequest,
)
from core.api.grpc.core_pb2 import ExecuteScriptRequest
@ -1131,19 +1130,6 @@ class CoreGrpcClient:
response = self.stub.GetNodeConfigService(request)
return dict(response.config)
def get_node_config_services(self, session_id: int, node_id: int) -> List[str]:
"""
Retrieves the config services currently assigned to a node.
:param session_id: session node belongs to
:param node_id: id of node to get config services for
:return: list of config services
:raises grpc.RpcError: when session or node doesn't exist
"""
request = GetNodeConfigServicesRequest(session_id=session_id, node_id=node_id)
response = self.stub.GetNodeConfigServices(request)
return list(response.services)
def set_node_config_service(
self, session_id: int, node_id: int, name: str, config: Dict[str, str]
) -> bool:

View file

@ -28,8 +28,6 @@ from core.api.grpc.configservices_pb2 import (
GetConfigServicesResponse,
GetNodeConfigServiceRequest,
GetNodeConfigServiceResponse,
GetNodeConfigServicesRequest,
GetNodeConfigServicesResponse,
SetNodeConfigServiceRequest,
SetNodeConfigServiceResponse,
)
@ -1404,21 +1402,6 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
templates=templates, config=config, modes=modes
)
def GetNodeConfigServices(
self, request: GetNodeConfigServicesRequest, context: ServicerContext
) -> GetNodeConfigServicesResponse:
"""
Get configuration services for a given node.
:param request: get node config services request
:param context: grpc context
:return: get node config services response
"""
session = self.get_session(request.session_id, context)
node = self.get_node(session, request.node_id, context, CoreNode)
services = node.config_services.keys()
return GetNodeConfigServicesResponse(services=services)
def SetNodeConfigService(
self, request: SetNodeConfigServiceRequest, context: ServicerContext
) -> SetNodeConfigServiceResponse:

View file

@ -67,15 +67,6 @@ message GetNodeConfigServiceResponse {
map<string, string> config = 1;
}
message GetNodeConfigServicesRequest {
int32 session_id = 1;
int32 node_id = 2;
}
message GetNodeConfigServicesResponse {
repeated string services = 1;
}
message SetNodeConfigServiceRequest {
int32 session_id = 1;
int32 node_id = 2;

View file

@ -87,8 +87,6 @@ service CoreApi {
}
rpc GetNodeConfigService (configservices.GetNodeConfigServiceRequest) returns (configservices.GetNodeConfigServiceResponse) {
}
rpc GetNodeConfigServices (configservices.GetNodeConfigServicesRequest) returns (configservices.GetNodeConfigServicesResponse) {
}
rpc SetNodeConfigService (configservices.SetNodeConfigServiceRequest) returns (configservices.SetNodeConfigServiceResponse) {
}