Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
balmart 82eb9f56bc
only returned nearest AirQo sites which are active
2 weeks ago
..
bin
ef01071184
modifications to the signals use case
4 months ago
49ae813b38
reduce DB projects for Grids and also fix small runtimes
4 months ago
85a334538b
new recent readings endpoint
2 months ago
82eb9f56bc
only returned nearest AirQo sites which are active
2 weeks ago
a22edc8d9f
reduce the input validation precision to 1 dec place
2 weeks ago
82eb9f56bc
only returned nearest AirQo sites which are active
2 weeks ago
3 years ago
c93d2ba3bb
library installations: status codes, validation, dev dependecies - cont-d
4 years ago
5bb6774fbc
script for generating downtime report
4 months ago
c1e079d8d3
Upgrading node version
8 months ago
f9e6701885
refresh deployment to pick latest changes
3 years ago
18228bbd83
trigger microservices
3 weeks ago
bb67edc75c
command query responsibiliuty segregation (CQRS)
4 months ago
4e439cd58a
just transferring the job
4 months ago
45b4805cd6
new file to manage state of Kafka topics
2 years ago

README.md

You have to be logged in to leave a comment. Sign In

Device Registry.

This microservice handles device creation, site creation, events creation and the respective activities which take place on a site.

Run Locally

a) Using npm scripts

You can clone the project

  git clone https://github.com/airqo-platform/AirQo-api

Go to the microservice directory and follow the steps below:

  cd AirQo-api/src/device-registry

Install the dependencies

  npm install

To run on MacOS

  npm run dev-mac

To run on Windows

  npm run dev-pc

b) Using Docker

Build the image within the microservice's directory

docker build --target={TARGET_STAGE} -t {IMAGE_NAME} .

Then run the container based on the newly created image

docker run -d -n {CONTAINER_NAME} -p host-port:container-port {IMAGE_NAME}

After successfully runing the container, you can go ahead and test out the respective endpoints

Deployment

To deploy this project, we take advantages of kubernetes as a container orchestration tool

Build the image within the microservice's directory

docker build --target={TARGET_STAGE} -t {IMAGE_NAME} .

Push the respective images to a respective Docker register

Use the images in deployment files for Kubernetes accordingly

API Reference

Get all devices

  GET /api/v1/devices
Query Parameter Type Description
tenant string Required. the tenant string
active string Optional. filters active device, yes returns active devices, no returns inactive devices
primary string Optional. yes returns primary in location devices, no returns non primary devices
site string Optional. the name of the site which appears on upper section of the Map nodes
map string Optional. the map address which appears on the lower section of the map nodes
channel string Optional. the unique channel ID
chid string Optional. the unique channel ID
name string Optional. the name of the device
skip Number Optional. skip this number of records in the response
limit Number Optional. limit the response to this number of records
location string Optional. the unique location ID
site_id string Optional. the site_id associated with the device
siteName string Optional. the siteName associated with the device
mapAddress string Optional. the mapAddress associated with the device
map string Optional. the mapAddress associated with the device
primary string Optional. yes if device is primary and no if it is not
active string Optional. yes if device is active and no if it is not active

Get all sites

  GET /api/v1/devices/sites
Query Parameter Type Description
tenant string Required. the tenant/organisation
id Object ID Optional. the Object ID of the site
lat_long string Optional. the lat_long string of the site
generated_name string Optional. the generated name of the site
formatted_name string Optional. the formatted name of the site
name string Optional. the name of the site
county string Optional. the county of the site
district string Optional. the district of the site
region string Optional. the region of the site
city string Optional. the city of the site
street string Optional. the street of the site
country string Optional. the country of the site
parish string Optional. the parish of the site

Get all Events

  GET /api/v1/devices/events
Query Parameter Type Description
tenant string Required. the tenant/organisation
startTime string Optional. the startTime which can be datetime (YYYY-MM-DDTHH:MM:SS.MSSZ) or just a day (YYYY-MM-DD)
endTime string Optional. the endTime which can be datetime (YYYY-MM-DDTHH:MM:SS.MSSZ) or just a day (YYYY-MM-DD)
device string Optional. the unique name of the device
frequency string Optional. the frequency of the events. Includes: hourly, daily and raw

Get all Site activities

  GET /api/v1/devices/activities
Query Parameter Type Description
tenant string Required. the tenant/organisation
site_id string Optional. the id of the site
activity_tags string Optional. the tags for the activity
maintenance_type string Optional. the type of maintenance
id Object ID Optional. the Object ID associated with the activity
device string Optional. the unique device name
activity_type string Optional. the activity types which include: deployment, recallment, maintenance
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...