Skip to content

Latest commit

 

History

History
162 lines (147 loc) · 3.92 KB

README.md

File metadata and controls

162 lines (147 loc) · 3.92 KB

sage-data-api

Placeholder API for Sages Metadata API (now referred to as Beekeeper-Manifest

Docker container usage

The docker image is hosted on DockerHub

To build image:

docker build -t iperezx/sage-data-api:latest .

To run container:

docker run -p 8080:8080 iperezx/sage-data-api:latest

To push a new tag to this repository:

docker push iperezx/sage-data-api:latest

Kubernetes Setup

The command deploys the data API on Nautilus.

kubectl apply -f sage-data-api.yaml

User side

The API reads the init_data files located in the init_data directory and outputs the content in a json format to the user.

Possible options:

Note:

  • node data (Sage Edge devices) is from the manifest files provided by Sage
  • sensor hardware data was generated to easily do the joins through sage data entities.
  • plugin data is generated by a python notebook, but can be swap out by the public sage data endpoint https://data.sagecontinuum.org/api/v1/query during the joining process. See the sage data api client for usage.

User-side verbose output from endpoints

Get all the nodes data:

curl GET 'http://localhost:8080/api/v1/nodes-data'

Returns:

{
  "data": [
    {
      "name": "Sage-NEON-01",
      "id": "4cd98fc4d2a8",
      "status": "Up",
      "provisionDate": "10/22/20",
      "OSVersion": "dell-1.0.0.local-6da62a8",
      "serviceTag": "79BBZ23",
      "SpecialDevices": "N/A",
      "BiosVersion": "2.8.2",
      "lat": "40.01631",
      "lon": "-105.24585"
    },
    ...
    {
      "name": "Sage-TTU-01",
      "id": "2cea7f5a0a3d",
      "status": "Up",
      "provisionDate": "11/19/20",
      "OSVersion": "dell-1.0.0.local-6da62a8",
      "serviceTag": "J42P853",
      "SpecialDevices": "N/A",
      "BiosVersion": "2.8.2",
      "lat": "33.584306",
      "lon": "-101.871984"
    }
  ]
}

Get all the nodes metadata:

curl GET 'http://localhost:8080/api/v1/nodes-metadata'

Returns:

{
  "metadata": [
    {
      "id": "name",
      "type": "text",
      "label": "name",
      "description": "Name of node."
    },
    ...
    {
      "id": "lon",
      "type": "numeric",
      "label": "Longitude",
      "description": "Longitude of Node."
    }
  ]
}          

Get all the nodes data and metadata:

curl GET 'http://localhost:8080/api/v1/nodes-all'

Returns:

{
  "data": [
    {
      "name": "Sage-NEON-01",
      "id": "4cd98fc4d2a8",
      "status": "Up",
      "provisionDate": "10/22/20",
      "OSVersion": "dell-1.0.0.local-6da62a8",
      "serviceTag": "79BBZ23",
      "SpecialDevices": "N/A",
      "BiosVersion": "2.8.2",
      "lat": "40.01631",
      "lon": "-105.24585"
    },
    ...
    {
      "name": "Sage-TTU-01",
      "id": "2cea7f5a0a3d",
      "status": "Up",
      "provisionDate": "11/19/20",
      "OSVersion": "dell-1.0.0.local-6da62a8",
      "serviceTag": "J42P853",
      "SpecialDevices": "N/A",
      "BiosVersion": "2.8.2",
      "lat": "33.584306",
      "lon": "-101.871984"
    }
  ],
  "metadata": [
    {
      "id": "name",
      "type": "text",
      "label": "name",
      "description": "Name of node."
    },
    ...
    {
      "id": "lon",
      "type": "numeric",
      "label": "Longitude",
      "description": "Longitude of Node."
    }
  ]
}