Progetto CHeArIA #
Version 1.0
Documentazione del backend del progetto CHeArIA #
Path Table #
Method | Path | Description |
---|---|---|
GET | /board/time | Gettime |
GET | /board/timems/{tz} | Gettimems |
GET | /board/timems | Gettimems |
GET | /board/time/hour | Gettime H |
GET | /board/time/min | Gettime Min |
GET | /board/date/{tz} | Getdate |
GET | /board/date | Getdate |
PUT | /board/putdata/{dataid} | Putdata |
GET | /resources/graph/all | Lista di tutti i grafici |
POST | /resources/graph/query | Query Graph |
GET | /resources/datas | Cerca i dati per tipo |
GET | /resources/datas/last | Ritorna l’ultimo dato per tipo |
GET | /resources/datas_stream | Stream dei dati in tempo reale |
Reference Table #
Name | Path | Description |
---|---|---|
DataResponse | #/components/schemas/DataResponse | |
DatasResponse | #/components/schemas/DatasResponse | |
HTTPValidationError | #/components/schemas/HTTPValidationError | |
Metadata | #/components/schemas/Metadata | |
ValidationError | #/components/schemas/ValidationError | |
routers__board__Data | #/components/schemas/routers__board__Data | |
routers__resources__Data | #/components/schemas/routers__resources__Data |
Path Details #
[GET]/board/time #
- Summary
Gettime
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
[GET]/board/timems/{tz} #
- Summary
Gettimems
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/board/timems #
- Summary
Gettimems
Parameters(Query) #
tz?: string
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/board/time/hour #
- Summary
Gettime H
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
[GET]/board/time/min #
- Summary
Gettime Min
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
[GET]/board/date/{tz} #
- Summary
Getdate
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/board/date #
- Summary
Getdate
Parameters(Query) #
tz?: string
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[PUT]/board/putdata/{dataid} #
- Summary
Putdata
RequestBody #
- application/json
{
// The value of data from sensor
datavalue: number
// The timzone to use to calculate the timestamp
timestamptz?: string
// The key for authenticate request
key: string
}
Responses #
- 200 Successful Response
text/plain
{
"type": "string"
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/resources/graph/all #
- Summary
Lista di tutti i grafici
Parameters(Query) #
type?: string
Responses #
- 200 Return all graphs
application/json
string[]
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[POST]/resources/graph/query #
- Summary
Query Graph
Parameters(Query) #
dataid?: string[]
gte?: string
lte?: string
unique?: string
Responses #
- 200 Successful Response
application/json
{}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/resources/datas #
-
Summary
Cerca i dati per tipo -
Description
Questa funzione permette di cercare per dato e per tipo i dati raccolti nel DB,
Trova i dati
Parameters(Query) #
dataid?: string[]
// Data d'inizio, ex: 2022-05-15_10:24:00 or 2022-05-15
gte?: string
// Data di fine, ex: 2022-10-15_16:12:00 or 2022-10-15
lte?: string
// Giorno singolo, ex: 2022-10-15
day?: string
type?: string
sort?: string
Responses #
- 200 sucess response
application/json
{
dataid: {
time: string
value: number
metadata: {
id: string
}
}[]
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/resources/datas/last #
- Summary
Ritorna l’ultimo dato per tipo
Parameters(Query) #
dataid?: string[]
type?: string
Responses #
- 200 sucess response
application/json
{
dataid: {
time: string
value: number
metadata: {
id: string
}
}
}
- 422 Validation Error
application/json
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
[GET]/resources/datas_stream #
-
Summary
Stream dei dati in tempo reale -
Description
Questa funzione restituisce uno streaming dei dai che arrivano dai sensori
Responses #
- 200 Successful Response
application/json
{}
References #
#/components/schemas/DataResponse #
{
dataid: {
time: string
value: number
metadata: {
id: string
}
}
}
#/components/schemas/DatasResponse #
{
dataid: {
time: string
value: number
metadata: {
id: string
}
}[]
}
#/components/schemas/HTTPValidationError #
{
detail: {
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}[]
}
#/components/schemas/Metadata #
{
id: string
}
#/components/schemas/ValidationError #
{
loc?: Partial(string) & Partial(integer)[]
msg: string
type: string
}
#/components/schemas/routers__board__Data #
{
// The value of data from sensor
datavalue: number
// The timzone to use to calculate the timestamp
timestamptz?: string
// The key for authenticate request
key: string
}
#/components/schemas/routers__resources__Data #
{
time: string
value: number
metadata: {
id: string
}
}