-
Notifications
You must be signed in to change notification settings - Fork 1
apis_contentfs
Stand: 5. Dezember 2025
Version: 1.0.0
Kategorie: Apis
Schnittstelle zum Speichern, Abrufen und Löschen binärer Inhalte (Blobs) mit integren Metadaten. Unterstützt ETags (SHA‑256) und Byte-Range Downloads.
- Basis-URL:
http://<host>:<port> - Ressourcenpfad:
/contentfs/:pk - Auth: Scopes + Policies erforderlich (siehe Sicherheit & Access Control)
-
PUT
/contentfs/:pk- Zweck: Blob hochladen oder überschreiben
- Header:
-
Content-Type: MIME-Typ (z. B.application/octet-stream) - Optional
X-Checksum-SHA256: erwarteter SHA‑256 des Request-Bodys (Hex)
-
- Body: binär (roh)
- Antworten:
- 201 Created
- Header:
ETag(SHA‑256),Location: /contentfs/:pk - Body: JSON
{ pk, mime, size, sha256_hex }
- Header:
- 400 Bad Request (Checksum mismatch)
- 500 Internal Server Error (Speicherfehler)
- 201 Created
-
HEAD
/contentfs/:pk- Zweck: Metadaten abrufen
- Antworten:
- 200 OK
- Header:
Content-Length,Content-Type,ETag,Accept-Ranges: bytes
- Header:
- 404 Not Found
- 200 OK
-
GET
/contentfs/:pk- Zweck: Blob abrufen (vollständig oder als Byte-Range)
- Header (optional):
-
Range: bytes=<start>-<end>(einzelne Range)
-
- Antworten:
- 200 OK (vollständiger Inhalt)
- 206 Partial Content (bei Range)
- Header:
Content-Range: bytes <start>-<end>/<total>,Accept-Ranges: bytes
- Header:
- 404 Not Found
- 416 Range Not Satisfiable (ungültiger Bereich)
-
DELETE
/contentfs/:pk- Zweck: Blob + Metadaten löschen
- Antworten:
- 204 No Content
- 404 Not Found (wenn weder Meta noch Blob existiert)
PUT /contentfs/report_2025.bin HTTP/1.1
Content-Type: application/octet-stream
X-Checksum-SHA256: 1e0023...abcd
<binary>Antwort:
HTTP/1.1 201 Created
ETag: 1e0023...abcd
Location: /contentfs/report_2025.bin
Content-Type: application/json
{"pk":"report_2025.bin","mime":"application/octet-stream","size":12345,"sha256_hex":"1e0023...abcd"}GET /contentfs/report_2025.bin HTTP/1.1
Range: bytes=0-99Antwort:
HTTP/1.1 206 Partial Content
Content-Range: bytes 0-99/12345
Accept-Ranges: bytes
Content-Type: application/octet-stream
<100 bytes>Upload (mit Content-Type und Checksumme):
curl -X PUT \
-H "Content-Type: application/octet-stream" \
-H "X-Checksum-SHA256: $(sha256sum file.bin | awk '{print $1}')" \
--data-binary @file.bin \
http://localhost:8765/contentfs/file.binMetadaten (HEAD):
curl -I http://localhost:8765/contentfs/file.binVollständiger Download:
curl -o out.bin http://localhost:8765/contentfs/file.binRange-Download (Bytes 0-99):
curl -H "Range: bytes=0-99" -o first100.bin http://localhost:8765/contentfs/file.binLöschen:
curl -X DELETE -i http://localhost:8765/contentfs/file.binEin vollständiger End-to-End-Test befindet sich in test_content_fs_api_integration.ps1. Er prüft Upload, HEAD, Voll-Download, Range-Download und Delete.
Ausführen (bei laufendem Server):
./test_content_fs_api_integration.ps1- 400: Checksumme abweichend oder ungültige Parameter
- 404: Ressource nicht vorhanden
- 416: Range ungültig / außerhalb der Größe
- 500: Interner Fehler (Persistenz)
- Scopes (AuthMiddleware Pflicht):
-
data:readfürGETundHEAD -
data:writefürPUTundDELETE
-
- Policy Engine (Ranger/Policies):
- Actions:
content.read,content.write,content.delete - Resource Path:
/contentfs/:pk(voller Request-Pfad)
- Actions:
- Evaluationsreihenfolge:
- AuthN → Scopes → Policies. Erst bei Erfolg erfolgt die Handlerausführung.
- Fehlerbilder:
- Fehlende/ungültige Auth →
401 Unauthorized - Fehlende Scopes oder verweigerte Policy →
403 Forbidden
- Fehlende/ungültige Auth →
- Governance:
- Governance-Header (
X-Themis-*) werden bei Antworten gesetzt.
- Governance-Header (
Die ContentFS-Konfiguration ist über folgende Endpunkte abrufbar/änderbar:
- GET
/content/config- Liefert das aktuell effektive Konfigurationsobjekt.
- PUT
/content/config- Aktualisiert Konfigurationsteile. Änderungen wirken nur für neue Uploads.
Aktuelle Felder (Auszug):
-
chunk_size_bytes(uint, optional):- Gültiger Bereich: 65.536 (64 KiB) bis 16.777.216 (16 MiB)
- Wirkt sich auf die Chunk-Größe für neue Blobs aus (Range-Reads werden dadurch effizienter, bestehende Inhalte bleiben unverändert).
Beispiele:
GET:
GET /content/config HTTP/1.1Antwort (Beispiel):
{
"compress_blobs": false,
"compression_level": 19,
"skip_compressed_mimes": ["image/", "video/", "application/zip", "application/gzip"],
"chunk_size_bytes": 1048576
}PUT (Chunk-Größe auf 2 MiB setzen):
PUT /content/config HTTP/1.1
Content-Type: application/json
{"chunk_size_bytes": 2097152}Antwort:
{"status":"ok","chunk_size_bytes":2097152,"note":"Configuration updated. Changes apply to new content imports only."}- Storage-Keys:
content:<pk>:meta(CBOR-JSON),content:<pk>:blob - ETag: SHA‑256 des Blobs (Hex)
- MIME: aus
Content-Typedes Uploads; Defaultapplication/octet-stream
ThemisDB v1.3.4 | GitHub | Documentation | Discussions | License
Last synced: January 02, 2026 | Commit: 6add659
Version: 1.3.0 | Stand: Dezember 2025
- Übersicht
- Home
- Dokumentations-Index
- Quick Reference
- Sachstandsbericht 2025
- Features
- Roadmap
- Ecosystem Overview
- Strategische Übersicht
- Geo/Relational Storage
- RocksDB Storage
- MVCC Design
- Transaktionen
- Time-Series
- Memory Tuning
- Chain of Thought Storage
- Query Engine & AQL
- AQL Syntax
- Explain & Profile
- Rekursive Pfadabfragen
- Temporale Graphen
- Zeitbereichs-Abfragen
- Semantischer Cache
- Hybrid Queries (Phase 1.5)
- AQL Hybrid Queries
- Hybrid Queries README
- Hybrid Query Benchmarks
- Subquery Quick Reference
- Subquery Implementation
- Content Pipeline
- Architektur-Details
- Ingestion
- JSON Ingestion Spec
- Enterprise Ingestion Interface
- Geo-Processor Design
- Image-Processor Design
- Hybrid Search Design
- Fulltext API
- Hybrid Fusion API
- Stemming
- Performance Tuning
- Migration Guide
- Future Work
- Pagination Benchmarks
- Enterprise README
- Scalability Features
- HTTP Client Pool
- Build Guide
- Implementation Status
- Final Report
- Integration Analysis
- Enterprise Strategy
- Verschlüsselungsstrategie
- Verschlüsselungsdeployment
- Spaltenverschlüsselung
- Encryption Next Steps
- Multi-Party Encryption
- Key Rotation Strategy
- Security Encryption Gap Analysis
- Audit Logging
- Audit & Retention
- Compliance Audit
- Compliance
- Extended Compliance Features
- Governance-Strategie
- Compliance-Integration
- Governance Usage
- Security/Compliance Review
- Threat Model
- Security Hardening Guide
- Security Audit Checklist
- Security Audit Report
- Security Implementation
- Development README
- Code Quality Pipeline
- Developers Guide
- Cost Models
- Todo Liste
- Tool Todo
- Core Feature Todo
- Priorities
- Implementation Status
- Roadmap
- Future Work
- Next Steps Analysis
- AQL LET Implementation
- Development Audit
- Sprint Summary (2025-11-17)
- WAL Archiving
- Search Gap Analysis
- Source Documentation Plan
- Changefeed README
- Changefeed CMake Patch
- Changefeed OpenAPI
- Changefeed OpenAPI Auth
- Changefeed SSE Examples
- Changefeed Test Harness
- Changefeed Tests
- Dokumentations-Inventar
- Documentation Summary
- Documentation TODO
- Documentation Gap Analysis
- Documentation Consolidation
- Documentation Final Status
- Documentation Phase 3
- Documentation Cleanup Validation
- API
- Authentication
- Cache
- CDC
- Content
- Geo
- Governance
- Index
- LLM
- Query
- Security
- Server
- Storage
- Time Series
- Transaction
- Utils
Vollständige Dokumentation: https://makr-code.github.io/ThemisDB/