DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
restcmd
scripts
recv-restcmd.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
import
argparse
4
from
flask
import
Flask, request
5
6
parser = argparse.ArgumentParser(description=
''
)
7
parser.add_argument(
'-a'
,
'--answer-port'
, type=int, default=12333, help=
'listening port for command return'
)
8
9
args = parser.parse_args()
10
11
app = Flask(__name__)
12
13
@app.route('/response', methods = ['POST'])
14
def
index
():
15
json = request.get_json(force=
True
)
16
print(
"Command: "
, json[
"data"
][
"cmdid"
])
17
print(
"Application:"
, json[
"appname"
])
18
print(
"Success:"
, json[
"success"
])
19
print(
"Result:"
, json[
"result"
])
20
return
'Response received'
21
22
if
__name__ ==
"__main__"
:
23
app.run(port=args.answer_port)
24
recv-restcmd.index
index()
Definition
recv-restcmd.py:14
Generated on
for DUNE-DAQ by
1.17.0