Forge.AnvilBridge.HTTP (Forge v0.1.1)

View Source

HTTP adapter for AnvilBridge - REST API integration.

This adapter makes HTTP API calls to Anvil when Forge and Anvil are deployed as separate services (different hosts/containers).

Benefits

  • Service isolation (deploy independently)
  • Language-agnostic integration
  • Horizontal scaling of Forge and Anvil
  • Clear API boundaries

Configuration

config :forge, :anvil_bridge_adapter, Forge.AnvilBridge.HTTP
config :forge, :anvil_api_url, "https://anvil.example.com"
config :forge, :anvil_api_key, System.get_env("ANVIL_API_KEY")

API Endpoints

  • POST /api/v1/samples/publish - Publish sample to queue
  • POST /api/v1/samples/batch - Batch publish samples
  • GET /api/v1/samples/:id/labels - Get labels for sample
  • POST /api/v1/samples/:id/sync_labels - Sync labels to Forge
  • POST /api/v1/queues - Create queue
  • GET /api/v1/queues/:name/stats - Get queue statistics

Implementation Notes

Currently returns :not_available errors until Anvil HTTP API is implemented. When available, this adapter will:

  • Use HTTPoison or Req for HTTP requests
  • Handle authentication with API keys
  • Apply timeouts and retries
  • Parse JSON responses