зеркало из https://github.com/github/vitess-gh.git
65 строки
2.5 KiB
Python
65 строки
2.5 KiB
Python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
import grpc
|
|
|
|
import automation_pb2 as automation__pb2
|
|
|
|
|
|
class AutomationStub(object):
|
|
# missing associated documentation comment in .proto file
|
|
pass
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.EnqueueClusterOperation = channel.unary_unary(
|
|
'/automationservice.Automation/EnqueueClusterOperation',
|
|
request_serializer=automation__pb2.EnqueueClusterOperationRequest.SerializeToString,
|
|
response_deserializer=automation__pb2.EnqueueClusterOperationResponse.FromString,
|
|
)
|
|
self.GetClusterOperationDetails = channel.unary_unary(
|
|
'/automationservice.Automation/GetClusterOperationDetails',
|
|
request_serializer=automation__pb2.GetClusterOperationDetailsRequest.SerializeToString,
|
|
response_deserializer=automation__pb2.GetClusterOperationDetailsResponse.FromString,
|
|
)
|
|
|
|
|
|
class AutomationServicer(object):
|
|
# missing associated documentation comment in .proto file
|
|
pass
|
|
|
|
def EnqueueClusterOperation(self, request, context):
|
|
"""Start a cluster operation.
|
|
"""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
def GetClusterOperationDetails(self, request, context):
|
|
"""TODO(mberlin): Polling this is bad. Implement a subscribe mechanism to wait for changes?
|
|
Get all details of an active cluster operation.
|
|
"""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
|
|
def add_AutomationServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'EnqueueClusterOperation': grpc.unary_unary_rpc_method_handler(
|
|
servicer.EnqueueClusterOperation,
|
|
request_deserializer=automation__pb2.EnqueueClusterOperationRequest.FromString,
|
|
response_serializer=automation__pb2.EnqueueClusterOperationResponse.SerializeToString,
|
|
),
|
|
'GetClusterOperationDetails': grpc.unary_unary_rpc_method_handler(
|
|
servicer.GetClusterOperationDetails,
|
|
request_deserializer=automation__pb2.GetClusterOperationDetailsRequest.FromString,
|
|
response_serializer=automation__pb2.GetClusterOperationDetailsResponse.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'automationservice.Automation', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|