buildgrid.server.bots.service module

BotsService

class buildgrid.server.bots.service.BotsService

Bases: BotsServicer, InstancedServicer[BotsInterface]

SERVICE_NAME = 'Bots'
REGISTER_METHOD(server)
FULL_NAME: ClassVar[str] = 'google.devtools.remoteworkers.v1test2.Bots'

The full name of the servicer, used to match instances to the servicer and configure reflection. This value should be declared on the class of any Servicer implementations.

CreateBotSession(request: CreateBotSessionRequest, context: ServicerContext) BotSession

CreateBotSession is called when the bot first joins the farm, and establishes a session ID to ensure that multiple machines do not register using the same name accidentally.

UpdateBotSession(request: UpdateBotSessionRequest, context: ServicerContext) BotSession

UpdateBotSession must be called periodically by the bot (on a schedule determined by the server) to let the server know about its status, and to pick up new lease requests from the server.

PostBotEventTemp(request: PostBotEventTempRequest, context: ServicerContext) Empty

PostBotEventTemp may be called by the bot to indicate that some exceptional event has occurred. This method is subject to change or removal in future revisions of this API; we may simply want to replace it with StackDriver or some other common interface.

query_connected_bots_for_instance(instance_name: str) int
count_bots_by_status(instance_name: str) Dict[BotStatus, int]