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 #

Responses #

text/plain

{
  "type": "string"
}

[GET]/board/timems/{tz} #

Responses #

text/plain

{
  "type": "string"
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/board/timems #

Parameters(Query) #

tz?: string

Responses #

text/plain

{
  "type": "string"
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/board/time/hour #

Responses #

text/plain

{
  "type": "string"
}

[GET]/board/time/min #

Responses #

text/plain

{
  "type": "string"
}

[GET]/board/date/{tz} #

Responses #

text/plain

{
  "type": "string"
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/board/date #

Parameters(Query) #

tz?: string

Responses #

text/plain

{
  "type": "string"
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[PUT]/board/putdata/{dataid} #

RequestBody #

{
  // 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 #

text/plain

{
  "type": "string"
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/resources/graph/all #

Parameters(Query) #

type?: string

Responses #

application/json

string[]

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[POST]/resources/graph/query #

Parameters(Query) #

dataid?: string[]
gte?: string
lte?: string
unique?: string

Responses #

application/json

{}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/resources/datas #

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 #

application/json

{
  dataid: {
    time: string
    value: number
    metadata: {
      id: string
    }
  }[]
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/resources/datas/last #

Parameters(Query) #

dataid?: string[]
type?: string

Responses #

application/json

{
  dataid: {
    time: string
    value: number
    metadata: {
      id: string
    }
  }
}

application/json

{
  detail: {
    loc?: Partial(string) & Partial(integer)[]
    msg: string
    type: string
  }[]
}

[GET]/resources/datas_stream #

Responses #

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
  }
}