Giter Club home page Giter Club logo

aq-simulator's Introduction

AirQuality Simulator

Simulator for providing AirQuality Data to FIWARE platforms like fiware-ops/marinera.

Configuration

Configuration can be done via the Micronaut standard mechanisms, e.g. application.yaml and environment-variables. Since list-configuration is better readable in yaml, the application.yaml is the recommended way to do it.

Property Description Default
general.brokerUrl Url of the broker to send the data to http://localhost:1026
general.historicDensity Minutes between the data points generated for historical data. 15
general.startupDelay Seconds before the simulation starts. Can be used to avoid downstream race-conditions. 120
general.fiwareService Fiware-Service for sending the data empty
general.fiwareServicePath Fiware-ServicePath for sending the data /
general.aqSimulations[] List of aq Simulations to be created []
general.aqSimulations[0].id Id to be used for the simulation. Will be generated if not provided. null
general.aqSimulations[0].name Name to be used for the simulation. test-device
general.aqSimulations[0].lat Latitude of the aquality data. 38.07
general.aqSimulations[0].longi Longitude of aq Simulations to be created -1.271
general.aqSimulations[0].sampleInterval Sample interval of the datapoints in seconds 30
general.aqSimulations[0].age Number of days to generate the historical data for.(e.g. today - age) 10
keycloak.enabled Should the simulation add auth-tokens from keycloak? false
keycloak.clientId ClientId to be used at keycloak null
keycloak.clientSecret ClientSecret to be used at keycloak null
keycloak.username Username to be used at keycloak null
keycloak.password Password to be used at keycloak null
keycloak.realm Realm to be used at keycloak null
keycloak.url URL of keycloak null

Run

Execution can be done via docker:

    docker run -v $(pwd)/application.yaml:/etc/sim/application.yaml -e MICRONAUT_CONFIG_FILES=/etc/sim/application.yaml quay.io/fiware/airquality-simulator

Security

The simulator is able to execute its simulation directly against the NGSI Api, but also in a secured way through the PEP-Proxy. The simulator currently supports the retrieval of user-tokens from Keycloak and transparently adds them to the requests.

The flow looks as following(everything in green is added when keycloak.enabled=true): secured-flow

Be aware, that general.brokerUrl needs to be the url of the PEP-Proxy in the secured case. Else, no policy enforcement can happen.

Subscriptions

For QuantumLeap to receive all the data, a subscription has to be setup. To do that, an image for creating the subscription is provided.

The image is available at fiware/v2-subscription-init and uses the broker-api to create the subscriptions.

Configuration

Configuration is done via environment variables:

Env-Var Description Default
FIWARE_SERVICE Fiware service to be used for the subscription(and notification)
FIWARE_SERVICE_PATH Fiware servicepath to be used for the subscription(and notification) /simulated
BROKER_URL URL of the context-broker to create the configuration http://localhost:1026
QUANTUM_LEAP_URL URL of the quantumleap-instance to receive the notifications http://localhost:8668
ENTITY_TYPE Type of entities to subscribe to. AirQualityObserved

Run

    docker run --network host -e QUANTUM_LEAP_URL=http://quantumleap-quantumleap:8668 -e FIWARE_SERVICE=test init

aq-simulator's People

Contributors

ernesgonzalez33 avatar wistefan avatar

Watchers

 avatar  avatar

Forkers

ernesgonzalez33

aq-simulator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.