]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | from flask import request, jsonify |
2 | from flask_restful import Resource | |
3 | from elasticsearch import Elasticsearch | |
4 | ||
5 | ||
6 | class Report(Resource): | |
7 | def put(self): | |
8 | report = request.get_json(force=True) | |
9 | es = Elasticsearch() | |
10 | es.index(index='telemetry', doc_type='report', id=report['report_id'], | |
11 | body=report) | |
12 | return jsonify(status=True) |