Skip to content

Graph Devices API

This file contains functions to manage operations related to Graph devices, such as fetching devices, updating device information, and managing filter configurations.

Functions

POST getAllDevices(filters)

Fetches all Graph devices based on the provided filters.

Input:

  • filters (object): Contains the following optional properties:
    • locationName (string): Name of the location.
    • regionName (string): Name of the region.
    • roomName (string): Name of the room.

Output: List of devices matching the filters.

Request Details:

  • URL: {deviceService}/device/all
  • Method: POST
  • Data:
    {
      "filters": {
        "locationName": "all",
        "regionName": "all",
        "roomName": "all"
      }
    }
    

PUT updateDeviceInfo(device, filters)

Updates the filter information for a specific device.

Input:

  • device (object): Contains the id of the device.
  • filters (object): Filter data to update.

Output: Confirmation of update.

Request Details:

  • URL: {deviceService}/device/{device.id}/filters
  • Method: PUT
  • Data:
    {
      "filters": { ... }
    }
    

GET getFiltersConfig()

Fetches the current filter configurations.

Input: None
Output: List of filter configurations.

Request Details:

  • URL: {deviceService}/filtersConfig
  • Method: GET

POST addFiltersConfig(filterConfig)

Adds a new filter configuration.

Input:

  • filterConfig (object): Contains filterdata to be added.

Output: Confirmation of addition.

Request Details:

  • URL: {deviceService}/filtersConfig
  • Method: POST
  • Data:
    [ filterConfig.filterdata ]
    

POST updateFiltersConfig(filterConfig)

Updates an existing filter configuration.

Input:

  • filterConfig (object): Contains id and filterdata to update.

Output: Confirmation of update.

Request Details:

  • URL: {deviceService}/filtersConfig/{filterConfig.id}
  • Method: POST
  • Data:
    { ...filterConfig.filterdata }
    

DELETE deleteFiltersConfig(filterConfig)

Deletes a specific filter configuration.

Input:

  • filterConfig (object): Contains the id of the filter configuration.

Output: Confirmation of deletion.

Request Details:

  • URL: {deviceService}/filtersConfig/{filterConfig.id}
  • Method: DELETE