forked from luci/luci-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the swarming bot proto service comments.
This adds comments to the supported service definition for the swarming bots. [email protected] BUG= Review-Url: https://codereview.chromium.org/2697123006
- Loading branch information
1 parent
8f6e97d
commit a8110bd
Showing
8 changed files
with
680 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
425 changes: 244 additions & 181 deletions
425
appengine/swarming/swarming_bot/proto_bot/swarming_bot_pb2.py
Large diffs are not rendered by default.
Oops, something went wrong.
116 changes: 116 additions & 0 deletions
116
appengine/swarming/swarming_bot/proto_bot/swarming_bot_pb2_grpc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
import grpc | ||
from grpc.framework.common import cardinality | ||
from grpc.framework.interfaces.face import utilities as face_utilities | ||
|
||
import swarming_bot_pb2 as swarming__bot__pb2 | ||
|
||
|
||
class BotServiceStub(object): | ||
"""BotService exposes operations for interacting with remote bots/workers. | ||
""" | ||
|
||
def __init__(self, channel): | ||
"""Constructor. | ||
Args: | ||
channel: A grpc.Channel. | ||
""" | ||
self.Handshake = channel.unary_unary( | ||
'/luci.swarming.bot.BotService/Handshake', | ||
request_serializer=swarming__bot__pb2.HandshakeRequest.SerializeToString, | ||
response_deserializer=swarming__bot__pb2.HandshakeResponse.FromString, | ||
) | ||
self.BotUpdate = channel.unary_unary( | ||
'/luci.swarming.bot.BotService/BotUpdate', | ||
request_serializer=swarming__bot__pb2.BotUpdateRequest.SerializeToString, | ||
response_deserializer=swarming__bot__pb2.BotUpdateResponse.FromString, | ||
) | ||
self.Poll = channel.unary_unary( | ||
'/luci.swarming.bot.BotService/Poll', | ||
request_serializer=swarming__bot__pb2.PollRequest.SerializeToString, | ||
response_deserializer=swarming__bot__pb2.PollResponse.FromString, | ||
) | ||
self.TaskUpdate = channel.unary_unary( | ||
'/luci.swarming.bot.BotService/TaskUpdate', | ||
request_serializer=swarming__bot__pb2.TaskUpdateRequest.SerializeToString, | ||
response_deserializer=swarming__bot__pb2.TaskUpdateResponse.FromString, | ||
) | ||
self.TaskError = channel.unary_unary( | ||
'/luci.swarming.bot.BotService/TaskError', | ||
request_serializer=swarming__bot__pb2.TaskErrorRequest.SerializeToString, | ||
response_deserializer=swarming__bot__pb2.TaskErrorResponse.FromString, | ||
) | ||
|
||
|
||
class BotServiceServicer(object): | ||
"""BotService exposes operations for interacting with remote bots/workers. | ||
""" | ||
|
||
def Handshake(self, request, context): | ||
"""Handshake implements the initial handshake from a bot to Swarming. | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def BotUpdate(self, request, context): | ||
"""BotUpdate requests a version of the bot code. | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def Poll(self, request, context): | ||
"""Poll is called by a bot to request additional work. | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def TaskUpdate(self, request, context): | ||
"""TaskUpdate updates the state of a remote action. | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def TaskError(self, request, context): | ||
"""TaskError marks a remote action as failed. | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
|
||
def add_BotServiceServicer_to_server(servicer, server): | ||
rpc_method_handlers = { | ||
'Handshake': grpc.unary_unary_rpc_method_handler( | ||
servicer.Handshake, | ||
request_deserializer=swarming__bot__pb2.HandshakeRequest.FromString, | ||
response_serializer=swarming__bot__pb2.HandshakeResponse.SerializeToString, | ||
), | ||
'BotUpdate': grpc.unary_unary_rpc_method_handler( | ||
servicer.BotUpdate, | ||
request_deserializer=swarming__bot__pb2.BotUpdateRequest.FromString, | ||
response_serializer=swarming__bot__pb2.BotUpdateResponse.SerializeToString, | ||
), | ||
'Poll': grpc.unary_unary_rpc_method_handler( | ||
servicer.Poll, | ||
request_deserializer=swarming__bot__pb2.PollRequest.FromString, | ||
response_serializer=swarming__bot__pb2.PollResponse.SerializeToString, | ||
), | ||
'TaskUpdate': grpc.unary_unary_rpc_method_handler( | ||
servicer.TaskUpdate, | ||
request_deserializer=swarming__bot__pb2.TaskUpdateRequest.FromString, | ||
response_serializer=swarming__bot__pb2.TaskUpdateResponse.SerializeToString, | ||
), | ||
'TaskError': grpc.unary_unary_rpc_method_handler( | ||
servicer.TaskError, | ||
request_deserializer=swarming__bot__pb2.TaskErrorRequest.FromString, | ||
response_serializer=swarming__bot__pb2.TaskErrorResponse.SerializeToString, | ||
), | ||
} | ||
generic_handler = grpc.method_handlers_generic_handler( | ||
'luci.swarming.bot.BotService', rpc_method_handlers) | ||
server.add_generic_rpc_handlers((generic_handler,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.