# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import edge_agent_pb2 as edge__agent__pb2 class EdgeAgentStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.DetectAnomalies = channel.unary_unary( '/AWS.LookoutVision.EdgeAgent/DetectAnomalies', request_serializer=edge__agent__pb2.DetectAnomaliesRequest.SerializeToString, response_deserializer=edge__agent__pb2.DetectAnomaliesResponse.FromString, ) self.StartModel = channel.unary_unary( '/AWS.LookoutVision.EdgeAgent/StartModel', request_serializer=edge__agent__pb2.StartModelRequest.SerializeToString, response_deserializer=edge__agent__pb2.StartModelResponse.FromString, ) self.StopModel = channel.unary_unary( '/AWS.LookoutVision.EdgeAgent/StopModel', request_serializer=edge__agent__pb2.StopModelRequest.SerializeToString, response_deserializer=edge__agent__pb2.StopModelResponse.FromString, ) self.ListModels = channel.unary_unary( '/AWS.LookoutVision.EdgeAgent/ListModels', request_serializer=edge__agent__pb2.ListModelsRequest.SerializeToString, response_deserializer=edge__agent__pb2.ListModelsResponse.FromString, ) self.DescribeModel = channel.unary_unary( '/AWS.LookoutVision.EdgeAgent/DescribeModel', request_serializer=edge__agent__pb2.DescribeModelRequest.SerializeToString, response_deserializer=edge__agent__pb2.DescribeModelResponse.FromString, ) class EdgeAgentServicer(object): """Missing associated documentation comment in .proto file.""" def DetectAnomalies(self, request, context): """Detects anomalies in the supplied image. The response from DetectAnomalies includes a boolean prediction that the image contains one or more anomalies and a confidence value for the prediction. The model that you use with DetectAnomalies must be running. You can get the current status by calling DescribeModel. To start running a model, use StartModel. DetectAnomalies supports packed bitmaps (images) in interleaved RGB888 format. The minimum supported image dimension is 64x64 pixels. The maximum supported image dimension is 4096x4096 pixels. You can send the image in the protobuf message or through a shared memory segment. Serializing large images into the protobuf message can significantly increase the latency of calls to DetectAnomalies. For the best latency, we recommended that you use shared memory. Status codes: 0. OK - DetectAnomalies successfully made a prediction. 2. UNKNOWN - An unknown error has occurred. 3. INVALID_ARGUMENT - One or more input parameters is invalid. Check the error message for more details. 5. NOT_FOUND - A model with the specified name wasn't found. 8. RESOURCE_EXHAUSTED - There isn't enough resources to perform this operation. For example, The Lookout for Vision Edge Agent can't keep up with the rate of calls to DetectAnomalies. Check the error message for more details. 9. FAILED_PRECONDITION - DetectAnomalies was called for model that is not in the RUNNING state. 13. INTERNAL - An internal error has occurred. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def StartModel(self, request, context): """ Starts a model running on an AWS IoT Greengrass Version 2 core device. It might take a while for the model to start running. To check the current status call DescribeModel. The model is running if the Status field is RUNNING. The number of models that you can run concurrently depends on the hardware specification of your core device. Status Codes: 0. OK - The model is starting. 2. UNKNOWN - An unknown error has occurred. 3. INVALID_ARGUMENT - One or more input parameters is invalid. Check the error message for more details. 5. NOT_FOUND - A model with the supplied name wasn't found. 8. RESOURCE_EXHAUSTED - There isn't enough resources to perform this operation. For example, there is isn't enough memory to load the model. Check the error message for more details. 9. FAILED_PRECONDITION - The method was called for model that is not in the STOPPED or FAILED state. 13. INTERNAL - An internal error has occurred. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def StopModel(self, request, context): """ Stops the model on an AWS IoT Greengrass Version 2 core device. Note: 1. Call can only stop a model that is in RUNNING. 2. call is synchronous and returns after the model was stopped. Status Codes: 0. OK - The model is stopping. 2. UNKNOWN - An unknown error has occurred. 3. INVALID_ARGUMENT - One or more input parameters is invalid. Check the error message for more details. 5. NOT_FOUND - A model with the supplied name wasn't found. 8. RESOURCE_EXHAUSTED - There isn't enough memory to load the model. 9. FAILED_PRECONDITION - The method was called for model that is not in the RUNNING state. 13. INTERNAL - An internal error has occurred. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ListModels(self, request, context): """ Lists the models deployed to an AWS IoT Greengrass Version 2 core device. Status Codes: 0. OK - The call was successful. 2. UNKNOWN - An unknown error has occurred. 13. INTERNAL - An internal error has occurred. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DescribeModel(self, request, context): """ Describes an Amazon Lookout for Vision model that's deployed to an AWS IoT Greengrass Version 2 core device. Status Codes: 0. OK - The call was successful. 2. UNKNOWN - An unknown error has occurred. 3. INVALID_ARGUMENT - One or more input parameters is invalid. Check the error message for more details. 5. NOT_FOUND - model with provided name was not found. 13. INTERNAL - An internal error has occurred. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_EdgeAgentServicer_to_server(servicer, server): rpc_method_handlers = { 'DetectAnomalies': grpc.unary_unary_rpc_method_handler( servicer.DetectAnomalies, request_deserializer=edge__agent__pb2.DetectAnomaliesRequest.FromString, response_serializer=edge__agent__pb2.DetectAnomaliesResponse.SerializeToString, ), 'StartModel': grpc.unary_unary_rpc_method_handler( servicer.StartModel, request_deserializer=edge__agent__pb2.StartModelRequest.FromString, response_serializer=edge__agent__pb2.StartModelResponse.SerializeToString, ), 'StopModel': grpc.unary_unary_rpc_method_handler( servicer.StopModel, request_deserializer=edge__agent__pb2.StopModelRequest.FromString, response_serializer=edge__agent__pb2.StopModelResponse.SerializeToString, ), 'ListModels': grpc.unary_unary_rpc_method_handler( servicer.ListModels, request_deserializer=edge__agent__pb2.ListModelsRequest.FromString, response_serializer=edge__agent__pb2.ListModelsResponse.SerializeToString, ), 'DescribeModel': grpc.unary_unary_rpc_method_handler( servicer.DescribeModel, request_deserializer=edge__agent__pb2.DescribeModelRequest.FromString, response_serializer=edge__agent__pb2.DescribeModelResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'AWS.LookoutVision.EdgeAgent', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class EdgeAgent(object): """Missing associated documentation comment in .proto file.""" @staticmethod def DetectAnomalies(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, '/AWS.LookoutVision.EdgeAgent/DetectAnomalies', edge__agent__pb2.DetectAnomaliesRequest.SerializeToString, edge__agent__pb2.DetectAnomaliesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def StartModel(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, '/AWS.LookoutVision.EdgeAgent/StartModel', edge__agent__pb2.StartModelRequest.SerializeToString, edge__agent__pb2.StartModelResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def StopModel(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, '/AWS.LookoutVision.EdgeAgent/StopModel', edge__agent__pb2.StopModelRequest.SerializeToString, edge__agent__pb2.StopModelResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ListModels(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, '/AWS.LookoutVision.EdgeAgent/ListModels', edge__agent__pb2.ListModelsRequest.SerializeToString, edge__agent__pb2.ListModelsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DescribeModel(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, '/AWS.LookoutVision.EdgeAgent/DescribeModel', edge__agent__pb2.DescribeModelRequest.SerializeToString, edge__agent__pb2.DescribeModelResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)