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
9aca9687
Commit
9aca9687
authored
Jul 03, 2019
by
jpalanca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add README.md
parents
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
166 additions
and
0 deletions
+166
-0
README.md
README.md
+166
-0
No files found.
README.md
0 → 100644
View file @
9aca9687
FIWARE deployment
=================
`docker-compose up`
Note:
It's recommended to expand the virtual memory of the OS executing docker:
1.
Put
`sysctl -w vm.max_map_count=262144`
at
`/etc/sysctl.conf`
2.
Reboot
Port to interact with FIWARE:
1026 -> Orion (general)
4200 -> CrateDB (to check temporal data)
3003 y 3000 -> Grafana
Examples
========
Create product
--------------
curl -X POST
\
http://localhost:1026/v2/entities
\
-H 'Content-Type: application/json'
\
-H 'fiware-service: sensores'
\
-H 'fiware-servicepath: /'
\
-d '{
"id": "urn:ngsi-ld:Product:001",
"type": "Product",
"name": {
"type": "Text",
"value": "Lumber"
},
"size": {
"type": "Text",
"value": "S"
},
"quantity": {
"type": "Integer",
"value": 1
}
}'
Verify product
--------------
curl -X GET
\
http://localhost:1026/v2/entities/urn:ngsi-ld:Product:001
\
-H 'fiware-path: /'
\
-H 'fiware-service: sensores'
Subscribe quantity to quantumleap
---------------------------------
curl -X POST
\
http://localhost:1026/v2/subscriptions/
\
-H 'Content-Type: application/json'
\
-H 'fiware-service: sensores'
\
-H 'fiware-servicepath: /'
\
-d '{
"description": "Notify QuantumLeap of count changes of any Sensor",
"subject": {
"entities":
[
{
"idPattern": ".
*
"
}
],
"condition": {
"attrs":
[
"quantity"
]
}
},
"notification": {
"http": {
"url": "http://quantumleap:8668/v2/notify"
},
"attrs":
[
"quantity"
],
"metadata":
[
"dateCreated", "dateModified"
]
},
"throttling": 1
}'
Subscribe quantity and size to quantumleap
------------------------------------------
curl -X POST
\
http://localhost:1026/v2/subscriptions/
\
-H 'Content-Type: application/json'
\
-H 'fiware-service: sensores'
\
-H 'fiware-servicepath: /'
\
-d '{
"description": "Notify QuantumLeap of count changes of any Sensor",
"subject": {
"entities":
[
{
"idPattern": ".
*
"
}
],
"condition": {
"attrs":
[
"quantity", "size"
]
}
},
"notification": {
"http": {
"url": "http://quantumleap:8668/v2/notify"
},
"attrs":
[
"quantity"
],
"metadata":
[
"dateCreated", "dateModified"
]
}
}'
Modify quantity
---------------
curl -X PUT
\
http://localhost:1026/v2/entities/urn:ngsi-ld:Product:001/attrs/quantity/value
\
-H 'Content-Type: text/plain'
\
-H 'fiware-path: /'
\
-H 'fiware-service: sensores'
\
-d $1
Modify quantity and size
------------------------
curl -iX PATCH
\
--url 'http://localhost:1026/v2/entities/urn:ngsi-ld:Product:001/attrs'
\
-H 'Content-Type: application/json'
\
-H 'fiware-path: /'
\
-H 'fiware-service: sensores'
\
--data ' {
"quantity":{"type":"Integer", "value": '$1'},
"size": {"type":"Text", "value": "'$2'"}
}'
Active subscriptions
--------------------
curl -X GET
\
http://localhost:1026/v2/subscriptions/
\
-H 'fiware-service: sensores'
\
-H 'fiware-servicepath: /'
Query temporal serie of quantity
--------------------------------
curl -X GET
\
'http://localhost:8668/v2/entities/urn:ngsi-ld:Product:001/attrs/quantity?lastN=1000'
\
-H 'Accept: application/json'
\
-H 'Fiware-Service: sensores'
\
-H 'Fiware-ServicePath: /'
\
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