# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from chromiumos.longrunning import operations_pb2 as chromiumos_dot_longrunning_dot_operations__pb2 from chromiumos.test.api import servod_service_pb2 as chromiumos_dot_test_dot_api_dot_servod__service__pb2 class ServodServiceStub(object): """Provides the ability to start/stop servod daemon and execute servod commands on it. Servod daemon can be running either inside a Docker container or directly on the host. The servo host could also be the same as the service host or a remote host. go/cros-servod-design to learn more about the design. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.StartServod = channel.unary_unary( '/chromiumos.test.api.ServodService/StartServod', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.StartServodRequest.SerializeToString, response_deserializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.StopServod = channel.unary_unary( '/chromiumos.test.api.ServodService/StopServod', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.StopServodRequest.SerializeToString, response_deserializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.ExecCmd = channel.unary_unary( '/chromiumos.test.api.ServodService/ExecCmd', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdRequest.SerializeToString, response_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdResponse.FromString, ) self.CallServod = channel.unary_unary( '/chromiumos.test.api.ServodService/CallServod', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodRequest.SerializeToString, response_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodResponse.FromString, ) self.LogCheckPoint = channel.unary_unary( '/chromiumos.test.api.ServodService/LogCheckPoint', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointRequest.SerializeToString, response_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointResponse.FromString, ) self.SaveLogs = channel.unary_unary( '/chromiumos.test.api.ServodService/SaveLogs', request_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsRequest.SerializeToString, response_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsResponse.FromString, ) class ServodServiceServicer(object): """Provides the ability to start/stop servod daemon and execute servod commands on it. Servod daemon can be running either inside a Docker container or directly on the host. The servo host could also be the same as the service host or a remote host. go/cros-servod-design to learn more about the design. """ def StartServod(self, request, context): """StartServod runs a servod Docker container and starts the servod daemon inside the container if servod is containerized. Otherwise, it simply starts the servod daemon. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def StopServod(self, request, context): """StopServod stops the servod daemon inside the container and stops the servod Docker container if servod is containerized. Otherwise, it simply stops the servod daemon. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExecCmd(self, request, context): """ExecCmd executes a system command that is provided through the command parameter in the request. It allows the user to execute arbitrary commands that can't be handled by calling servod (e.g. update firmware through "futility", remote file copy through "scp"). It executes the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it executes the command directly inside the host that the servo is physically connected to. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CallServod(self, request, context): """CallServod runs a servod command through an XML-RPC call. It runs the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it runs the command directly inside the host that the servo is physically connected to. Allowed methods: doc, get, set, and hwinit. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def LogCheckPoint(self, request, context): """LogCheckPoint will create checkpoint certain files so that some files can be saved partially when SaveLogs is called. For example, /var/log/messages in a labstation can be very big and include information from a few days ago. Getting the checkpoint of the current /var/log/messages will allow SaveLogs to save the portion only relevant to the current testing session. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SaveLogs(self, request, context): """SaveLogs will save servod related logs on the host that this service is running. Logs include: /var/log/message from the servod host. /var/log/servod_/ latest.DEBUG from servod host. /var/log/servod_.STARTUP.log from servod host. The output of "dmesg -H" from the servod host. The extraction of the MCU console logs from latest.DEBUG """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_ServodServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'StartServod': grpc.unary_unary_rpc_method_handler( servicer.StartServod, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.StartServodRequest.FromString, response_serializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), 'StopServod': grpc.unary_unary_rpc_method_handler( servicer.StopServod, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.StopServodRequest.FromString, response_serializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), 'ExecCmd': grpc.unary_unary_rpc_method_handler( servicer.ExecCmd, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdRequest.FromString, response_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdResponse.SerializeToString, ), 'CallServod': grpc.unary_unary_rpc_method_handler( servicer.CallServod, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodRequest.FromString, response_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodResponse.SerializeToString, ), 'LogCheckPoint': grpc.unary_unary_rpc_method_handler( servicer.LogCheckPoint, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointRequest.FromString, response_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointResponse.SerializeToString, ), 'SaveLogs': grpc.unary_unary_rpc_method_handler( servicer.SaveLogs, request_deserializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsRequest.FromString, response_serializer=chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'chromiumos.test.api.ServodService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class ServodService(object): """Provides the ability to start/stop servod daemon and execute servod commands on it. Servod daemon can be running either inside a Docker container or directly on the host. The servo host could also be the same as the service host or a remote host. go/cros-servod-design to learn more about the design. """ @staticmethod def StartServod(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/StartServod', chromiumos_dot_test_dot_api_dot_servod__service__pb2.StartServodRequest.SerializeToString, chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def StopServod(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/StopServod', chromiumos_dot_test_dot_api_dot_servod__service__pb2.StopServodRequest.SerializeToString, chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExecCmd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/ExecCmd', chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdRequest.SerializeToString, chromiumos_dot_test_dot_api_dot_servod__service__pb2.ExecCmdResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CallServod(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/CallServod', chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodRequest.SerializeToString, chromiumos_dot_test_dot_api_dot_servod__service__pb2.CallServodResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def LogCheckPoint(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/LogCheckPoint', chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointRequest.SerializeToString, chromiumos_dot_test_dot_api_dot_servod__service__pb2.LogCheckPointResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SaveLogs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.ServodService/SaveLogs', chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsRequest.SerializeToString, chromiumos_dot_test_dot_api_dot_servod__service__pb2.SaveLogsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)