updates to grpc to provide a consistent config response, mapping config ids to ConfigOptions

This commit is contained in:
Blake Harnden 2019-10-22 09:57:41 -07:00
parent 233ca92fd2
commit 0a689a3e96
4 changed files with 109 additions and 84 deletions

View file

@ -194,7 +194,7 @@ class CoreGrpcClient(object):
def get_session_options(self, session_id):
"""
Retrieve session options.
Retrieve session options as a dict with id mapping.
:param int session_id: id of session
:return: response with a list of configuration groups
@ -204,6 +204,18 @@ class CoreGrpcClient(object):
request = core_pb2.GetSessionOptionsRequest(session_id=session_id)
return self.stub.GetSessionOptions(request)
def get_session_options_group(self, session_id):
"""
Retrieve session options in a group list.
:param int session_id: id of session
:return: response with a list of configuration groups
:rtype: core_pb2.GetSessionOptionsGroupResponse
:raises grpc.RpcError: when session doesn't exist
"""
request = core_pb2.GetSessionOptionsGroupRequest(session_id=session_id)
return self.stub.GetSessionOptionsGroup(request)
def set_session_options(self, session_id, config):
"""
Set options for a session.