Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oci-fn-object-storage-router

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.

Quick run

python3 func.py sample-event.json

Sample output:

{
  "matched": true,
  "route": "finance-ingest",
  "rule": "finance-csv",
  "bucket": "shared-inbound",
  "object_name": "finance/inbound/april-close.csv"
}

How routing works

Rules can match on:

  • bucket
  • object prefix
  • object suffix
  • regex

The default sample rules include patterns like:

  • finance/inbound/*.csv -> finance-ingest
  • claims/raw/*.json -> claims-parser
  • images/*.(png|jpg|jpeg) -> image-pipeline

What this repo is good for

  • 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

What it intentionally leaves out

  • 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.

Repo shape

  • func.py contains the Function handler and local CLI
  • sample-event.json gives you a realistic Object Storage event to test with
  • tests/test_router.py covers matched and unmatched routing behavior

Related context

About

OCI Function pattern for routing Object Storage events to downstream systems.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages