Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fiware
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platinum
fiware
Commits
085e3e42
Commit
085e3e42
authored
Jul 03, 2019
by
jpalanca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added script to send test data.
parent
b601559f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
test_sensors.py
test_sensors.py
+18
-0
No files found.
test_sensors.py
0 → 100644
View file @
085e3e42
import
time
import
requests
import
json
import
random
max_cycles
=
200000
orion
=
'http://localhost:1026/v2/entities/'
headers
=
{
'Content-Type'
:
'application/json'
,
'fiware-service'
:
'sensores'
,
'fiware-servicepath'
:
'/'
}
name_rpi
=
"urn:ngsi-ld:Product:001"
for
cycles
in
range
(
max_cycles
):
print
(
'Cycle'
,
cycles
)
body
=
{
'quantity'
:
{
'value'
:
cycles
},
'size'
:
{
'value'
:
(
cycles
+
random
.
randint
(
1
,
101
))}}
contents
=
requests
.
patch
(
orion
+
name_rpi
+
'/attrs'
,
headers
=
headers
,
json
=
body
)
print
(
contents
.
status_code
,
contents
.
reason
)
print
(
contents
.
text
)
time
.
sleep
(
0.1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment