diff --git a/python/jfjoch_grpc2http.py b/python/jfjoch_grpc2http.py index 1f5ef7c0..d22284f7 100644 --- a/python/jfjoch_grpc2http.py +++ b/python/jfjoch_grpc2http.py @@ -95,7 +95,7 @@ async def stop(): @app.post("/detector/trigger") -async def stop(): +async def trigger(): try: stub = jfjoch_pb2_grpc.gRPC_JFJochBrokerStub(channel) stub.Trigger(jfjoch_pb2.Empty()) @@ -104,6 +104,16 @@ async def stop(): return {} +@app.post("/detector/cancel") +async def cancel(): + try: + stub = jfjoch_pb2_grpc.gRPC_JFJochBrokerStub(channel) + stub.Cancel(jfjoch_pb2.Empty()) + except grpc.RpcError as e: + raise HTTPException(status_code=400, detail=e.details()) + return {} + + @app.get("/detector/status") async def get_status(): try: