# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import metric_pb2 as metric__pb2
from . import polarrpc_pb2 as polarrpc__pb2
from . import rpc_pb2 as rpc__pb2
[docs]class PolarisRPCServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.NodeState = channel.unary_unary(
'/types.PolarisRPCService/NodeState',
request_serializer=rpc__pb2.NodeReq.SerializeToString,
response_deserializer=rpc__pb2.SingleBytes.FromString,
)
self.Metric = channel.unary_unary(
'/types.PolarisRPCService/Metric',
request_serializer=metric__pb2.MetricsRequest.SerializeToString,
response_deserializer=metric__pb2.Metrics.FromString,
)
self.CurrentList = channel.unary_unary(
'/types.PolarisRPCService/CurrentList',
request_serializer=polarrpc__pb2.Paginations.SerializeToString,
response_deserializer=polarrpc__pb2.PolarisPeerList.FromString,
)
self.WhiteList = channel.unary_unary(
'/types.PolarisRPCService/WhiteList',
request_serializer=polarrpc__pb2.Paginations.SerializeToString,
response_deserializer=polarrpc__pb2.PolarisPeerList.FromString,
)
self.BlackList = channel.unary_unary(
'/types.PolarisRPCService/BlackList',
request_serializer=polarrpc__pb2.Paginations.SerializeToString,
response_deserializer=polarrpc__pb2.PolarisPeerList.FromString,
)
self.ListBLEntries = channel.unary_unary(
'/types.PolarisRPCService/ListBLEntries',
request_serializer=rpc__pb2.Empty.SerializeToString,
response_deserializer=polarrpc__pb2.BLConfEntries.FromString,
)
self.AddBLEntry = channel.unary_unary(
'/types.PolarisRPCService/AddBLEntry',
request_serializer=polarrpc__pb2.AddEntryParams.SerializeToString,
response_deserializer=rpc__pb2.SingleString.FromString,
)
self.RemoveBLEntry = channel.unary_unary(
'/types.PolarisRPCService/RemoveBLEntry',
request_serializer=polarrpc__pb2.RmEntryParams.SerializeToString,
response_deserializer=rpc__pb2.SingleString.FromString,
)
[docs]class PolarisRPCServiceServicer(object):
# missing associated documentation comment in .proto file
pass
[docs] def NodeState(self, request, context):
"""Returns the current state of this node
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Metric(self, request, context):
"""Returns node metrics according to request
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def CurrentList(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def WhiteList(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def BlackList(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def ListBLEntries(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def AddBLEntry(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def RemoveBLEntry(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_PolarisRPCServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'NodeState': grpc.unary_unary_rpc_method_handler(
servicer.NodeState,
request_deserializer=rpc__pb2.NodeReq.FromString,
response_serializer=rpc__pb2.SingleBytes.SerializeToString,
),
'Metric': grpc.unary_unary_rpc_method_handler(
servicer.Metric,
request_deserializer=metric__pb2.MetricsRequest.FromString,
response_serializer=metric__pb2.Metrics.SerializeToString,
),
'CurrentList': grpc.unary_unary_rpc_method_handler(
servicer.CurrentList,
request_deserializer=polarrpc__pb2.Paginations.FromString,
response_serializer=polarrpc__pb2.PolarisPeerList.SerializeToString,
),
'WhiteList': grpc.unary_unary_rpc_method_handler(
servicer.WhiteList,
request_deserializer=polarrpc__pb2.Paginations.FromString,
response_serializer=polarrpc__pb2.PolarisPeerList.SerializeToString,
),
'BlackList': grpc.unary_unary_rpc_method_handler(
servicer.BlackList,
request_deserializer=polarrpc__pb2.Paginations.FromString,
response_serializer=polarrpc__pb2.PolarisPeerList.SerializeToString,
),
'ListBLEntries': grpc.unary_unary_rpc_method_handler(
servicer.ListBLEntries,
request_deserializer=rpc__pb2.Empty.FromString,
response_serializer=polarrpc__pb2.BLConfEntries.SerializeToString,
),
'AddBLEntry': grpc.unary_unary_rpc_method_handler(
servicer.AddBLEntry,
request_deserializer=polarrpc__pb2.AddEntryParams.FromString,
response_serializer=rpc__pb2.SingleString.SerializeToString,
),
'RemoveBLEntry': grpc.unary_unary_rpc_method_handler(
servicer.RemoveBLEntry,
request_deserializer=polarrpc__pb2.RmEntryParams.FromString,
response_serializer=rpc__pb2.SingleString.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'types.PolarisRPCService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))