Skip to content
Snippets Groups Projects
Commit 4bc469ac authored by poojara's avatar poojara
Browse files

Add new file

parent c45a346f
No related branches found
No related tags found
No related merge requests found
---
swagger: "2.0"
info:
description: "This is documentation for Python Flask micro-service endpoints"
version: "1.0.0"
title: "Swagger IoT data"
termsOfService: "http://swagger.io/terms/"
contact:
email: "xxx@ut.ee"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "172.17.91.23:8081"
basePath: "/v2"
schemes:
- "http"
paths:
/upload:
post:
tags:
- "Upload Sensor Data"
summary: "Uploads a file."
operationId: "upload_post"
consumes:
- "multipart/form-data"
parameters:
- name: "upfile"
in: "formData"
description: "The file to upload."
required: false
type: "file"
responses:
"200":
description: "File uploaded"
"400":
description: "File not uploaded."
/modify:
put:
tags:
- "Modify Sensor Data"
summary: "Updated Sensor name"
operationId: "update_sensor_data"
consumes:
- "application/json"
- "application/xml"
produces:
- "application/xml"
- "application/json"
parameters:
- in: "body"
name: "body"
description: "device object that needs to be modified"
required: true
schema:
$ref: "#/definitions/device"
responses:
"200":
description: "Data modified"
"400":
description: "Data not modified"
/sensor_data/{host}:
get:
tags:
- "Query Sensor Data"
summary: "Find sensor data by host"
description: "Returns a list of sensor data"
operationId: "get_sensor_by_id"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "host"
in: "path"
description: "Device id to search in the data"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "Successful operation"
schema:
$ref: "#/definitions/device"
"400":
description: "Invalid ID supplied"
delete:
tags:
- "Delete Sensor Data"
summary: "Delete sensor data"
operationId: "delete_sensor_data"
produces:
- "application/json"
parameters:
- name: "host"
in: "path"
description: "Sensor Id that need to be updated"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "Successful operation"
"400":
description: "Invalid device id supplied"
/minimum/{sensor}:
get:
tags:
- "Query Sensor Data"
summary: "Find minimum sensor data by host"
description: "Returns a list of sensor data"
operationId: "getminimum"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "sensor"
in: "path"
description: "Host to search in the data"
required: true
type: "string"
responses:
"200":
description: "Successful with response containing minimum value"
schema:
$ref: "#/definitions/device"
"400":
description: "Invalid host supplied"
/maximum/{sensor}:
get:
tags:
- "Query Sensor Data"
summary: "Find maximum sensor data by host"
description: "Returns a list of sensor data"
operationId: "getmaximum"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "sensor"
in: "path"
description: "host to search in the data"
required: true
type: "string"
responses:
"200":
description: "Successful with response containing maximum value"
schema:
$ref: "#/definitions/device"
"400":
description: "Invalid ID supplied"
definitions:
device:
type: "object"
properties:
host:
type: "integer"
format: "int64"
unit:
type: "string"
example: "kg"
example:
host: "13318"
unit: "kg"
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