grpc: removed add session server, achieved with start session providing servers for session
This commit is contained in:
parent
7e6b87101b
commit
d40435fa68
6 changed files with 42 additions and 54 deletions
|
@ -307,6 +307,7 @@ class CoreGrpcClient:
|
|||
)
|
||||
config_service_configs.append(config_service_config)
|
||||
options = {k: v.value for k, v in session.options.items()}
|
||||
servers = [x.to_proto() for x in session.servers]
|
||||
request = core_pb2.StartSessionRequest(
|
||||
session_id=session.id,
|
||||
nodes=nodes,
|
||||
|
@ -325,6 +326,7 @@ class CoreGrpcClient:
|
|||
user=session.user,
|
||||
definition=definition,
|
||||
metadata=session.metadata,
|
||||
servers=servers,
|
||||
)
|
||||
response = self.stub.StartSession(request)
|
||||
return response.result, list(response.exceptions)
|
||||
|
@ -421,22 +423,6 @@ class CoreGrpcClient:
|
|||
response = self.stub.SetSessionState(request)
|
||||
return response.result
|
||||
|
||||
def add_session_server(self, session_id: int, name: str, host: str) -> bool:
|
||||
"""
|
||||
Add distributed session server.
|
||||
|
||||
:param session_id: id of session
|
||||
:param name: name of server to add
|
||||
:param host: host address to connect to
|
||||
:return: True for success, False otherwise
|
||||
:raises grpc.RpcError: when session doesn't exist
|
||||
"""
|
||||
request = core_pb2.AddSessionServerRequest(
|
||||
session_id=session_id, name=name, host=host
|
||||
)
|
||||
response = self.stub.AddSessionServer(request)
|
||||
return response.result
|
||||
|
||||
def alert(
|
||||
self,
|
||||
session_id: int,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue