initial
This commit is contained in:
commit
c98243d39b
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
__pycache__
|
||||||
|
*~
|
||||||
|
.*.sw?
|
||||||
|
.*~
|
||||||
|
ENV
|
||||||
|
|
20
Entries.py
Normal file
20
Entries.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import _typeshed
|
||||||
|
import logging
|
||||||
|
import werkzeug
|
||||||
|
from flask import request
|
||||||
|
import json
|
||||||
|
|
||||||
|
class Entry(object):
|
||||||
|
def __init__(self, ts, freq):
|
||||||
|
self.ts = ts
|
||||||
|
self.freq = freq
|
||||||
|
|
||||||
|
def insert(**args):
|
||||||
|
try:
|
||||||
|
body = request.json
|
||||||
|
logging.info("JSON Body: {}".format(body))
|
||||||
|
return "200"
|
||||||
|
except KeyError as e:
|
||||||
|
raise werkzeug.exceptions.InternalServerError("Key Error: {}".format(e))
|
||||||
|
|
||||||
|
|
43
openapi.yaml
Normal file
43
openapi.yaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
openapi: 3.0.3
|
||||||
|
|
||||||
|
info:
|
||||||
|
title: SinkConvert2
|
||||||
|
version: "0.0.1"
|
||||||
|
|
||||||
|
paths:
|
||||||
|
/sc2/v1/entry:
|
||||||
|
post:
|
||||||
|
tags: [ "entry" ]
|
||||||
|
operationId: Entries.insert
|
||||||
|
summary: Insert one or more entries into the database
|
||||||
|
requestBody:
|
||||||
|
description: List of entries
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/entry"
|
||||||
|
responses:
|
||||||
|
201:
|
||||||
|
description: One or more entries has been inserted
|
||||||
|
401:
|
||||||
|
description: Unauthorized
|
||||||
|
404:
|
||||||
|
description: Not found
|
||||||
|
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
entry:
|
||||||
|
description: Entry with timestamp and frequency
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timestamp:
|
||||||
|
description: Synchronized timestamp in RFC3339 format in timezone UTC
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
frequency:
|
||||||
|
description: Frequency in mHz
|
||||||
|
type: integer
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user