Skip to content

sensors

Sensors definition management


create_sensor

Creates (adds) a new sensor given sensor information.
Source code

POST

http://localhost:8888/api/sensors/{fullSensorName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_sensor_name Full sensor name string

Request body

 Description                       Data type   Required 
Dictionary of sensor definitions SensorModel

Usage examples

curl -X POST http://localhost:8888/api/sensors/sample_target/sample_category/sample_sensor^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"full_sensor_name\":\"sample_target/sample_category/sample_sensor\",\"sensor_definition_spec\":{\"fields\":[{\"field_name\":\"sample_string_param\",\"data_type\":\"string\"},{\"field_name\":\"sample_double_param\",\"data_type\":\"double\"}],\"default_value\":0.0},\"provider_sensor_list\":[],\"custom\":false,\"built_in\":false,\"can_edit\":true}"

delete_sensor

Deletes a custom sensor definition
Source code

DELETE

http://localhost:8888/api/sensors/{fullSensorName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_sensor_name Full sensor name string

Usage examples

curl -X DELETE http://localhost:8888/api/sensors/sample_target/sample_category/sample_sensor^
    -H "Accept: application/json"

get_all_sensors

Returns a flat list of all sensors available in DQOps, both built-in sensors and user defined or customized sensors.
Source code

GET

http://localhost:8888/api/sensors  

Return value

 Property name   Description                       Data type 
sensor_list_model List[SensorListModel]

Usage examples

curl http://localhost:8888/api/sensors^
    -H "Accept: application/json"

get_sensor

Returns a sensor model
Source code

GET

http://localhost:8888/api/sensors/{fullSensorName}  

Return value

 Property name   Description                       Data type 
sensor_model SensorModel

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_sensor_name Full sensor name string

Usage examples

curl http://localhost:8888/api/sensors/sample_target/sample_category/sample_sensor^
    -H "Accept: application/json"

get_sensor_folder_tree

Returns a tree of all sensors available in DQOps, both built-in sensors and user defined or customized sensors.
Source code

GET

http://localhost:8888/api/definitions/sensors  

Return value

 Property name   Description                       Data type 
sensor_folder_model SensorFolderModel

Usage examples

curl http://localhost:8888/api/definitions/sensors^
    -H "Accept: application/json"

update_sensor

Updates an existing sensor, making a custom sensor definition if it is not present. Removes sensor if custom definition is same as Dqo Home sensor
Source code

PUT

http://localhost:8888/api/sensors/{fullSensorName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_sensor_name Full sensor name string

Request body

 Description                       Data type   Required 
Dictionary of sensor definitions SensorModel

Usage examples

curl -X PUT http://localhost:8888/api/sensors/sample_target/sample_category/sample_sensor^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"full_sensor_name\":\"sample_target/sample_category/sample_sensor\",\"sensor_definition_spec\":{\"fields\":[{\"field_name\":\"sample_string_param\",\"data_type\":\"string\"},{\"field_name\":\"sample_double_param\",\"data_type\":\"double\"}],\"default_value\":0.0},\"provider_sensor_list\":[],\"custom\":false,\"built_in\":false,\"can_edit\":true}"