grpc: removed add hook and get gooks, can be achieved with get session and start session
This commit is contained in:
parent
634341dd03
commit
f271b0289e
6 changed files with 0 additions and 184 deletions
|
@ -66,7 +66,6 @@ from core.api.grpc.wlan_pb2 import (
|
|||
WlanConfig,
|
||||
WlanLinkRequest,
|
||||
)
|
||||
from core.api.grpc.wrappers import Hook
|
||||
from core.emulator.data import IpPrefixes
|
||||
from core.errors import CoreError
|
||||
|
||||
|
@ -764,35 +763,6 @@ class CoreGrpcClient:
|
|||
response = self.stub.DeleteLink(request)
|
||||
return response.result
|
||||
|
||||
def get_hooks(self, session_id: int) -> List[wrappers.Hook]:
|
||||
"""
|
||||
Get all hook scripts.
|
||||
|
||||
:param session_id: session id
|
||||
:return: list of hooks
|
||||
:raises grpc.RpcError: when session doesn't exist
|
||||
"""
|
||||
request = core_pb2.GetHooksRequest(session_id=session_id)
|
||||
response = self.stub.GetHooks(request)
|
||||
hooks = []
|
||||
for hook_proto in response.hooks:
|
||||
hook = wrappers.Hook.from_proto(hook_proto)
|
||||
hooks.append(hook)
|
||||
return hooks
|
||||
|
||||
def add_hook(self, session_id: int, hook: Hook) -> bool:
|
||||
"""
|
||||
Add hook scripts.
|
||||
|
||||
:param session_id: session id
|
||||
:param hook: hook to add
|
||||
:return: True for success, False otherwise
|
||||
:raises grpc.RpcError: when session doesn't exist
|
||||
"""
|
||||
request = core_pb2.AddHookRequest(session_id=session_id, hook=hook.to_proto())
|
||||
response = self.stub.AddHook(request)
|
||||
return response.result
|
||||
|
||||
def get_mobility_configs(
|
||||
self, session_id: int
|
||||
) -> Dict[int, Dict[str, wrappers.ConfigOption]]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue