improved gitignore for generated proto files, added new initial separate config service proto, incorporated into grpc api
This commit is contained in:
parent
43fe81a86e
commit
0af6a7a620
7 changed files with 161 additions and 4 deletions
|
@ -12,6 +12,14 @@ import netaddr
|
|||
|
||||
from core import utils
|
||||
from core.api.grpc import core_pb2, core_pb2_grpc
|
||||
from core.api.grpc.configservices_pb2 import (
|
||||
GetConfigServiceRequest,
|
||||
GetConfigServiceResponse,
|
||||
GetConfigServicesRequest,
|
||||
GetConfigServicesResponse,
|
||||
SetConfigServiceRequest,
|
||||
SetConfigServiceResponse,
|
||||
)
|
||||
|
||||
|
||||
class InterfaceHelper:
|
||||
|
@ -1078,6 +1086,26 @@ class CoreGrpcClient:
|
|||
request = core_pb2.GetInterfacesRequest()
|
||||
return self.stub.GetInterfaces(request)
|
||||
|
||||
def get_config_services(self) -> GetConfigServicesResponse:
|
||||
request = GetConfigServicesRequest()
|
||||
return self.stub.GetConfigServices(request)
|
||||
|
||||
def get_config_service(
|
||||
self, session_id: int, node_id: int, name: str
|
||||
) -> GetConfigServiceResponse:
|
||||
request = GetConfigServiceRequest(
|
||||
session_id=session_id, node_id=node_id, name=name
|
||||
)
|
||||
return self.stub.GetConfigService(request)
|
||||
|
||||
def set_config_service(
|
||||
self, session_id: int, node_id: int, name: str, config: Dict[str, str]
|
||||
) -> SetConfigServiceResponse:
|
||||
request = SetConfigServiceRequest(
|
||||
session_id=session_id, node_id=node_id, name=name, config=config
|
||||
)
|
||||
return self.stub.SetConfigService(request)
|
||||
|
||||
def connect(self) -> None:
|
||||
"""
|
||||
Open connection to server, must be closed manually.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue