Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Smart-building MSE-Lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LSDS
Smart-building MSE-Lab
Commits
c963af54
Commit
c963af54
authored
7 years ago
by
NizarBouchedakh
Browse files
Options
Downloads
Patches
Plain Diff
update of apidoc
parent
05b8b60c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.DS_Store
+0
-0
0 additions, 0 deletions
.DS_Store
flask-main.py
+88
-8
88 additions, 8 deletions
flask-main.py
with
88 additions
and
8 deletions
.DS_Store
0 → 100644
+
0
−
0
View file @
c963af54
File added
This diff is collapsed.
Click to expand it.
flask-main.py
+
88
−
8
View file @
c963af54
...
...
@@ -52,9 +52,9 @@ def index():
@apiSuccess {boolean} Is_Ready Node status
@apiSuccess {String[]} Neighbours
N
ode
'
s neighbours
@apiSuccess {String[]} Neighbours
List of the n
ode
'
s neighbours
IDs
@apiSuccess {
Number
} Node_ID Node
'
s ID
@apiSuccess {
String
} Node_ID Node
'
s ID
@apiSuccess {String} Node_location Node
'
s location
...
...
@@ -64,7 +64,7 @@ def index():
@apiSuccess {String} Query_stage Node object
'
s readiness stage. Once it
'
s at
"
Complete
"
stage, the Node object is ready to be used.
@apiSuccess {
Number
} Query_stage_(%) Node object
'
s readiness stage (pourcentage). Once it
'
s at 100%, the Node object is ready to be used.
@apiSuccess {
String
} Query_stage_(%) Node object
'
s readiness stage (pourcentage). Once it
'
s at 100%, the Node object is ready to be used.
...
...
@@ -75,7 +75,7 @@ def index():
"
Network Home ID
"
:
"
0xe221b13f
"
,
"
Node 1
"
: {
"
Is Ready
"
: true,
"
Neighbours
"
:
"
2
"
,
"
Neighbours
"
:
[
"
2
"
,
"
3
"
],
"
Node ID
"
:
"
1
"
,
"
Node location
"
:
""
,
"
Node name
"
:
""
,
...
...
@@ -85,13 +85,23 @@ def index():
},
"
Node 2
"
: {
"
Is Ready
"
: true,
"
Neighbours
"
:
"
1
"
,
"
Neighbours
"
:
[
"
1
"
,
"
3
"
],
"
Node ID
"
:
"
2
"
,
"
Node location
"
:
""
,
"
Node name
"
:
""
,
"
Product name
"
:
"
MultiSensor 6
"
,
"
Query Stage
"
:
"
Complete
"
,
"
Query Stage (%)
"
:
"
100 %
"
},
"
Node 3
"
: {
"
Is Ready
"
: true,
"
Neighbours
"
: [
"
1
"
,
"
2
"
],
"
Node ID
"
:
"
3
"
,
"
Node location
"
:
""
,
"
Node name
"
:
""
,
"
Product name
"
:
"
ZE27
"
,
"
Query Stage
"
:
"
Complete
"
,
"
Query Stage (%)
"
:
"
100 %
"
}
}
...
...
@@ -118,7 +128,7 @@ def network_info():
@apiParamExample {json} Request-Exemple :
{
'
Group_Interval
'
:
'
24
1
'
,
'
Group_Interval
'
:
'
2
2
4
'
,
'
Group_Reports
'
:
'
480
'
,
'
Wake-up_Interval
'
:
'
480
'
}
...
...
@@ -178,7 +188,7 @@ def network_configure_sensor_Nodes():
{
"
Network Home ID
"
:
"
0xe221b13f
"
,
"
Node 2
"
: {
"
Enable Motion Sensor
"
:
"
Enabled level 5 (maximum sensitivity
"
,
"
Enable Motion Sensor
"
:
"
Enabled level 5 (maximum sensitivity
)
"
,
"
Group 1 Interval
"
:
"
3600
"
,
"
Group 1 Reports
"
:
"
241
"
,
"
Group 2 Interval
"
:
"
3600
"
,
...
...
@@ -542,7 +552,7 @@ def get_node_name(node):
@apiParam {Number} node_id Sensor
'
s unique ID
@apiSuccess {String[]} neighbors list of a node
'
s neighbours
@apiSuccess {String[]} neighbo
u
rs list of a node
'
s neighbours
@apiDescription Gets list of a node
'
s neighbours
...
...
@@ -620,6 +630,16 @@ def get_sensors_list():
}
@apiDescription Gets all measures of a given sensor, in a JSON format
@apiErrorExample {json} Error in case node is not a sensor:
{
"
error
"
:
"
Node is not a sensor
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/sensors/<int:node>/get_all_measures
'
,
strict_slashes
=
False
)
...
...
@@ -653,6 +673,16 @@ def get_all_measures(node):
}
@apiDescription Gets temperature of a given sensor in a JSON format
@apiErrorExample {json} Error in case node is not a sensor:
{
"
error
"
:
"
Node is not a sensor
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/sensors/<int:node>/get_temperature
'
,
strict_slashes
=
False
)
...
...
@@ -686,6 +716,16 @@ def get_temperature(node):
}
@apiDescription Gets humidity of a given sensor in a JSON format
@apiErrorExample {json} Error in case node is not a sensor:
{
"
error
"
:
"
Node is not a sensor
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/sensors/<int:node>/get_humidity
'
,
strict_slashes
=
False
)
...
...
@@ -719,6 +759,16 @@ def get_humidity(node):
}
@apiDescription Gets humidity of a given sensor in a JSON format
@apiErrorExample {json} Error in case node is not a sensor:
{
"
error
"
:
"
Node is not a sensor
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/sensors/<int:node>/get_luminance
'
,
strict_slashes
=
False
)
...
...
@@ -752,6 +802,16 @@ def get_luminance(node):
}
@apiDescription Gets motion of a given sensor in a JSON format
@apiErrorExample {json} Error in case node is not a sensor:
{
"
error
"
:
"
Node is not a sensor
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/sensors/<int:node>/get_motion
'
,
strict_slashes
=
False
)
...
...
@@ -820,6 +880,16 @@ def get_dimmers():
}
@apiDescription Gets level of a given dimmer in a JSON format
@apiErrorExample {json} Error in case node is not a dimmer:
{
"
error
"
:
"
Node is not a dimmer
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
...
...
@@ -848,6 +918,16 @@ def get_dimmer_level(node_id):
@apiDescription Sends command to dimmer node
@apiErrorExample {json} Error in case node is not a dimmer:
{
"
error
"
:
"
Node is not a dimmer
"
}
@apiErrorExample {json} Error in case node is not ready:
{
"
error
"
:
"
Node is not ready
"
}
"""
@app.route
(
'
/dimmers/set_level
'
,
methods
=
[
'
GET
'
,
'
POST
'
],
strict_slashes
=
False
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment