oci-fn-object-storage-router is a Python OCI Function pattern for the common case where one bucket is feeding several downstream systems.
This shows up in a lot of real workflows:
- finance files landing in a shared bucket
- claims or document payloads needing different processors
- media drops that split into separate pipelines based on path or file type
The repo stays focused on one job: inspect an Object Storage event and return the route that should handle it next.
python3 func.py sample-event.jsonSample output:
{
"matched": true,
"route": "finance-ingest",
"rule": "finance-csv",
"bucket": "shared-inbound",
"object_name": "finance/inbound/april-close.csv"
}Rules can match on:
- bucket
- object prefix
- object suffix
- regex
The default sample rules include patterns like:
finance/inbound/*.csv->finance-ingestclaims/raw/*.json->claims-parserimages/*.(png|jpg|jpeg)->image-pipeline
- showing the pattern cleanly before wiring in real downstream systems
- testing routing logic locally with sample events
- using as a starter when the real handoff will be a queue, webhook, or internal API
- actual downstream invocation
- OCI auth and deployment setup
- retries, dead-letter handling, and delivery guarantees
- shared rule storage outside the sample JSON structure
Those pieces matter in production. They are just not the point of this repo.
func.pycontains the Function handler and local CLIsample-event.jsongives you a realistic Object Storage event to test withtests/test_router.pycovers matched and unmatched routing behavior