Skip to main content

Storage Configurations

List Storage Configs

Returns all storage configurations for a project.
curl -X GET "http://localhost:8080/api/storage/configs?project_id=proj-123"

Query Parameters

project_id
string
required
Filter by project ID

Response

configs
array
Array of storage config objects

Create Storage Config

Creates a new storage backend configuration for a project.
curl -X POST http://localhost:8080/api/storage/configs \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "plugin_type": "postgres",
    "config": {
      "connection_string": "postgresql://user:pass@localhost/mimir",
      "schema": "public"
    },
    "ontology_id": "onto-456",
    "active": true
  }'

Request Body

project_id
string
required
Project ID to associate with
plugin_type
string
required
Plugin type: filesystem, s3, neo4j, postgres, or custom plugin name
config
object
required
Plugin-specific configuration (varies by plugin type)
ontology_id
string
Ontology ID to use for schema mapping
active
boolean
Whether config is active (defaults to true)

Response

Returns the created storage config object.

Get Storage Config

Returns a single storage config by ID.
curl -X GET http://localhost:8080/api/storage/configs/storage-123

Path Parameters

id
string
required
Storage config ID

Response

Returns the storage config object.

Update Storage Config

Updates a storage configuration.
curl -X PUT http://localhost:8080/api/storage/configs/storage-123 \
  -H "Content-Type: application/json" \
  -d '{
    "active": false
  }'

Path Parameters

id
string
required
Storage config ID

Request Body

All fields are optional. Only provided fields will be updated.
config
object
Updated configuration
ontology_id
string
New ontology ID
active
boolean
New active status

Response

Returns the updated storage config object.

Delete Storage Config

Deletes a storage configuration.
curl -X DELETE http://localhost:8080/api/storage/configs/storage-123

Path Parameters

id
string
required
Storage config ID

Response

Returns 204 No Content on success.

CIR Data Operations

Store CIR Data

Writes one or more CIR records to the specified storage backend.
curl -X POST http://localhost:8080/api/storage/store \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "storage_id": "storage-456",
    "cir_data": {
      "version": "1.0",
      "source": {
        "type": "api",
        "uri": "https://api.example.com/sensors",
        "timestamp": "2024-01-15T10:30:00Z",
        "format": "json"
      },
      "data": {
        "sensor_id": "temp-001",
        "temperature": 22.5,
        "humidity": 65.2
      },
      "metadata": {
        "size": 1024,
        "record_count": 1
      }
    }
  }'

Request Body

project_id
string
required
Project ID
storage_id
string
required
Storage config ID
cir_data
object
required
CIR data object to store

Response

success
boolean
Whether operation succeeded
affected_items
number
Number of items stored
error
string
Error message if failed

Retrieve CIR Data

Queries and returns CIR records from the specified storage backend.
curl -X POST http://localhost:8080/api/storage/retrieve \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "storage_id": "storage-456",
    "query": {
      "entity_type": "Sensor",
      "filters": [
        {
          "attribute": "temperature",
          "operator": "gt",
          "value": 20
        }
      ],
      "limit": 100
    }
  }'

Request Body

project_id
string
required
Project ID
storage_id
string
required
Storage config ID
query
object
required
Query specification

Response

Returns an array of CIR objects matching the query.

Update CIR Data

Applies delta updates to matching CIR records in the specified storage backend.
curl -X POST http://localhost:8080/api/storage/update \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "storage_id": "storage-456",
    "query": {
      "filters": [
        {
          "attribute": "sensor_id",
          "operator": "eq",
          "value": "temp-001"
        }
      ]
    },
    "updates": {
      "filters": [],
      "updates": {
        "calibrated": true,
        "last_maintenance": "2024-01-15"
      }
    }
  }'

Request Body

project_id
string
required
Project ID
storage_id
string
required
Storage config ID
query
object
required
Query to select records (see Retrieve CIR Data)
updates
object
required
Update specification

Response

success
boolean
Whether operation succeeded
affected_items
number
Number of items updated
error
string
Error message if failed

Delete CIR Data

Deletes matching CIR records from the specified storage backend.
curl -X POST http://localhost:8080/api/storage/delete \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj-123",
    "storage_id": "storage-456",
    "query": {
      "filters": [
        {
          "attribute": "timestamp",
          "operator": "lt",
          "value": "2024-01-01"
        }
      ]
    }
  }'

Request Body

project_id
string
required
Project ID
storage_id
string
required
Storage config ID
query
object
required
Query to select records to delete (see Retrieve CIR Data)

Response

success
boolean
Whether operation succeeded
affected_items
number
Number of items deleted
error
string
Error message if failed

Storage Health

Check Storage Health

Checks connectivity to the underlying backend for the given storage config ID.
curl -X GET http://localhost:8080/api/storage/storage-123/health

Path Parameters

id
string
required
Storage config ID

Response

healthy
boolean
Whether the backend is reachable
error
string
Error message if unhealthy

Build docs developers (and LLMs) love