Skip to content
Snippets Groups Projects
Commit 232b75f7 authored by Guilherme Arthur Gerônimo's avatar Guilherme Arthur Gerônimo
Browse files

API@root

parent 04a224aa
Branches main
No related tags found
No related merge requests found
openapi: 3.0.3
info:
title: IoT@UFSC
description: |-
Documentação da API da plataforma IoT da UFSC
contact:
email: servicos.ti+iot@sistemas.ufsc.br
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.11
externalDocs:
description: Mais sobre o serviços
url: https://iot.lisha.ufsc.br
servers:
- url: /
tags:
- name: series
description: |-
Gerenciamento das series temporais
externalDocs:
description: Mais informações
url: https://epos.lisha.ufsc.br/IoT+Platform#SmartData_Series
- name: dados
description: Entrada e saida de dados
externalDocs:
description: Mais informações
url: https://epos.lisha.ufsc.br/IoT+Platform#SmartData
paths:
/api/create:
post:
tags:
- series
summary: Criar uma serie temporal
description: Criar uma serie temporal
#operationId: updatePet
requestBody:
description: Requisição para criar serie
content:
application/json:
schema:
$ref: '#/components/schemas/series'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/series'
'401':
description: Credenciais erradas
/api/put:
post:
tags:
- dados
summary: Entrar com dados na plataforma
description: Criar uma serie temporal
#operationId: updatePet
requestBody:
description: Requisição para criar serie
content:
application/json:
schema:
$ref: '#/components/schemas/smartdata'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/series'
'401':
description: Credenciais erradas
/api/get:
post:
tags:
- dados
summary: Entrar com dados na plataforma
description: Criar uma serie temporal
requestBody:
description: Requisição para criar serie
content:
application/json:
schema:
$ref: '#/components/schemas/query'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/query-response-v12'
'401':
description: Credenciais erradas
components:
schemas:
series:
type: object
properties:
version:
$ref: '#/components/schemas/version'
unit:
$ref: '#/components/schemas/unit'
x:
$ref: '#/components/schemas/ponto'
y:
$ref: '#/components/schemas/ponto'
z:
$ref: '#/components/schemas/ponto'
r:
type: integer
description: Raio
example: 10
t0:
$ref: '#/components/schemas/tempo'
t1:
$ref: '#/components/schemas/tempo'
dev:
type: integer
example: 10
signature:
type: string
example: 10
workflow:
type: integer
example: 0
smartdata:
type: object
properties:
version:
$ref: '#/components/schemas/version'
unit:
$ref: '#/components/schemas/unit'
value:
type: number
format: double
error:
type: integer
format: int64
default: 0
confidence:
type: integer
format: int64
default: 1
x:
$ref: '#/components/schemas/ponto'
y:
$ref: '#/components/schemas/ponto'
z:
$ref: '#/components/schemas/ponto'
r:
type: integer
description: Raio
example: 10
t:
$ref: '#/components/schemas/tempo'
dev:
type: integer
example: 10
signature:
type: string
example: 10
workflow:
type: integer
example: 0
query:
type: object
required:
- version
- unit
- dev
- x
- y
- z
properties:
version:
$ref: '#/components/schemas/version'
unit:
$ref: '#/components/schemas/unit'
dev:
type: integer
example: 10
signature:
type: string
example: 10
x:
$ref: '#/components/schemas/ponto'
y:
$ref: '#/components/schemas/ponto'
z:
$ref: '#/components/schemas/ponto'
r:
type: integer
description: Raio
example: 10
t0:
$ref: '#/components/schemas/tempo'
tf:
$ref: '#/components/schemas/tempo'
query-response-v12:
type: object
properties:
version:
$ref: '#/components/schemas/version'
unit:
$ref: '#/components/schemas/unit'
timestamp:
$ref: '#/components/schemas/tempo'
value:
type: number
format: double
error:
type: integer
format: int64
default: 0
confidence:
type: integer
format: int64
default: 1
gateway:
type: integer
example: 10
type:
type: string
example: 10
period:
type: integer
example: 10
dev:
type: integer
example: 10
signature:
type: string
example: 10
x:
$ref: '#/components/schemas/ponto'
y:
$ref: '#/components/schemas/ponto'
z:
$ref: '#/components/schemas/ponto'
tempo:
type: integer
format: int64
description: |-
- Microsegundos
- UNIX Time * 1.000.000
- Ex.: time.time() * 1000000
ponto:
type: integer
format: int32
description: |-
- Coordenada absoluta (ECEF) da localização do dado.
- Não é Latitude/Longitude (LLH).
- [Converter LLH para ECEF](https://www.oc.nps.edu/oc2902w/coord/llhxyz.htm)
```python
#Python
import pyproj
transformer = pyproj.Transformer.from_crs({"proj":'latlong', "ellps":'WGS84', "datum":'WGS84'},{"proj":'geocent', "ellps":'WGS84', "datum":'WGS84'})
x, y, z = transformer.transform( lng, lat, alt)
```
version:
type: string
enum:
- "1.1"
- "1.2"
description: |-
- A lista de versoes pode se encontrada em:
- https://epos.lisha.ufsc.br/IoT+Platform#SmartData
unit:
type: integer
format: int32
example: 66571993184
description: |-
- A lista de unidades pode se encontrada em:
- https://epos.lisha.ufsc.br/Usefull+SmartData+Units
- https://epos.lisha.ufsc.br/EPOS+2+User+Guide#Unit
<html>
<h3>API: /api </h3>
<a href='/api'>API</>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Plataforma IoT</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-standalone-preset.js"></script>
<script>
const ui = SwaggerUIBundle({
url: '/api/openapi.yml',
dom_id: '#swagger-ui',
presets: [
SwaggerUIStandalonePreset,
SwaggerUIBundle.presets.apis,
],
layout: "StandaloneLayout",
});
</script>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment