Skip to content

Routers

The routers module provides the infrastructure for building FastAPI REST API endpoints in DiracX. This section documents the tools and utilities developers need to add new routes, implement access control, and structure their API endpoints.

For REST API Documentation

If you're looking for documentation on the available REST API endpoints (HTTP methods, request/response schemas, etc.), please see:

  • REST API Routes - Complete REST API documentation with request/response examples

When running a DiracX instance, you can also access:

  • Swagger UI at /api/docs - Interactive API documentation where you can try endpoints
  • OpenAPI Specification at /api/openapi.json - Machine-readable API schema

Developer Infrastructure

This section documents the Python infrastructure for building routers:

Core Infrastructure

  • Dependencies - FastAPI dependency injection utilities for database access, authentication, configuration
  • Factory - Router factory functions for creating and registering routers
  • FastAPI Classes - Custom DiracX router classes that extend FastAPI functionality
  • Access Policies - Access control and authorization policy implementations
  • Utilities - Helper functions and utilities for building routes

OpenTelemetry Integration

  • OpenTelemetry - Instrumentation and tracing setup for monitoring API requests

Example Routers

For reference on how routers are structured, you can examine the source code of existing routers:

  • diracx.routers.jobs - Job management endpoints
  • diracx.routers.auth - Authentication flows
  • diracx.routers.configuration - Configuration management
  • diracx.routers.job_manager - Advanced job operations

Note: For complete REST API endpoint documentation with request/response examples, see the REST API Routes section.