Skip to content

api: change the GET /v1/bricks/{id} variables field #92

@dido18

Description

@dido18

Motivation

Align the GET /v1/bricks/{id} response with the config_variables refactored here #18.

  • deprecate the variables field returned as a map of object
  • add config_variables field as an array of objects

Current behaviour

curl 127.0.0.1:8800/v1/bricks/arduino:visual_anomaly_detection
{
  "id": "arduino:visual_anomaly_detection",
  "name": "Visual Anomaly Detection",
  "author": "Arduino",
  "description": "Brick for visual anomaly detection using a pre-trained model. It processes images to identify unusual patterns and returns detected anomalies with bounding boxes. \nSupports pre-trained models provided by the framework or custom anomaly detection models trained on the Edge Impulse platform. \n",
  "category": "image",
  "status": "installed",
  "require_model": true,
  "variables": {
    "CUSTOM_MODEL_PATH": {
      "default_value": "/home/arduino/.arduino-bricks/ei-models",
      "description": "path to the custom model directory",
      "required": false
    },
    "EI_V_ANOMALY_DETECTION_MODEL": {
      "default_value": "/models/ootb/ei/concrete-crack-anomaly-detection.eim",
      "description": "path to the model file",
      "required": false
    }
  },

Expected

curl 127.0.0.1:8800/v1/bricks/arduino:visual_anomaly_detection
{
  "id": "arduino:visual_anomaly_detection",
  "name": "Visual Anomaly Detection",
  "author": "Arduino",
  "description": "",
  "category": "image",
  "status": "installed",
  "require_model": true,
 // Depreacted
  "variables": {
    "CUSTOM_MODEL_PATH": {
      "default_value": "/home/arduino/.arduino-bricks/ei-models",
      "description": "path to the custom model directory",
      "required": false
    },
    "EI_V_ANOMALY_DETECTION_MODEL": {
      "default_value": "/models/ootb/ei/concrete-crack-anomaly-detection.eim",
      "description": "path to the model file",
      "required": false
    }
 // Added
 "config_variables": [
    {
      "name": "CUSTOM_MODEL_PATH",
      "default_value": "/home/arduino/.arduino-bricks/ei-models",
      "description": "path to the custom model directory",
      "required": false
    },
    {
      "name": "EI_OBJ_DETECTION_MODEL",
      "default_value": "/models/ootb/ei/yolo-x-nano.eim",
      "description": "path to the model file",
      "required": false
    }
  ],
  },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions