grpc: removed get node config services, achieved with get node or get session
This commit is contained in:
parent
e299d3dd16
commit
805be3f809
4 changed files with 0 additions and 42 deletions
|
@ -25,7 +25,6 @@ from core.api.grpc.configservices_pb2 import (
|
||||||
GetConfigServiceDefaultsRequest,
|
GetConfigServiceDefaultsRequest,
|
||||||
GetConfigServicesRequest,
|
GetConfigServicesRequest,
|
||||||
GetNodeConfigServiceRequest,
|
GetNodeConfigServiceRequest,
|
||||||
GetNodeConfigServicesRequest,
|
|
||||||
SetNodeConfigServiceRequest,
|
SetNodeConfigServiceRequest,
|
||||||
)
|
)
|
||||||
from core.api.grpc.core_pb2 import ExecuteScriptRequest
|
from core.api.grpc.core_pb2 import ExecuteScriptRequest
|
||||||
|
@ -1131,19 +1130,6 @@ class CoreGrpcClient:
|
||||||
response = self.stub.GetNodeConfigService(request)
|
response = self.stub.GetNodeConfigService(request)
|
||||||
return dict(response.config)
|
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(
|
def set_node_config_service(
|
||||||
self, session_id: int, node_id: int, name: str, config: Dict[str, str]
|
self, session_id: int, node_id: int, name: str, config: Dict[str, str]
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
|
|
@ -28,8 +28,6 @@ from core.api.grpc.configservices_pb2 import (
|
||||||
GetConfigServicesResponse,
|
GetConfigServicesResponse,
|
||||||
GetNodeConfigServiceRequest,
|
GetNodeConfigServiceRequest,
|
||||||
GetNodeConfigServiceResponse,
|
GetNodeConfigServiceResponse,
|
||||||
GetNodeConfigServicesRequest,
|
|
||||||
GetNodeConfigServicesResponse,
|
|
||||||
SetNodeConfigServiceRequest,
|
SetNodeConfigServiceRequest,
|
||||||
SetNodeConfigServiceResponse,
|
SetNodeConfigServiceResponse,
|
||||||
)
|
)
|
||||||
|
@ -1404,21 +1402,6 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
|
||||||
templates=templates, config=config, modes=modes
|
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(
|
def SetNodeConfigService(
|
||||||
self, request: SetNodeConfigServiceRequest, context: ServicerContext
|
self, request: SetNodeConfigServiceRequest, context: ServicerContext
|
||||||
) -> SetNodeConfigServiceResponse:
|
) -> SetNodeConfigServiceResponse:
|
||||||
|
|
|
@ -67,15 +67,6 @@ message GetNodeConfigServiceResponse {
|
||||||
map<string, string> config = 1;
|
map<string, string> config = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetNodeConfigServicesRequest {
|
|
||||||
int32 session_id = 1;
|
|
||||||
int32 node_id = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetNodeConfigServicesResponse {
|
|
||||||
repeated string services = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SetNodeConfigServiceRequest {
|
message SetNodeConfigServiceRequest {
|
||||||
int32 session_id = 1;
|
int32 session_id = 1;
|
||||||
int32 node_id = 2;
|
int32 node_id = 2;
|
||||||
|
|
|
@ -87,8 +87,6 @@ service CoreApi {
|
||||||
}
|
}
|
||||||
rpc GetNodeConfigService (configservices.GetNodeConfigServiceRequest) returns (configservices.GetNodeConfigServiceResponse) {
|
rpc GetNodeConfigService (configservices.GetNodeConfigServiceRequest) returns (configservices.GetNodeConfigServiceResponse) {
|
||||||
}
|
}
|
||||||
rpc GetNodeConfigServices (configservices.GetNodeConfigServicesRequest) returns (configservices.GetNodeConfigServicesResponse) {
|
|
||||||
}
|
|
||||||
rpc SetNodeConfigService (configservices.SetNodeConfigServiceRequest) returns (configservices.SetNodeConfigServiceResponse) {
|
rpc SetNodeConfigService (configservices.SetNodeConfigServiceRequest) returns (configservices.SetNodeConfigServiceResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue