jfjoch_grpc2http.py: implement cancel
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user