# API

## API Middleware

class designate.api.middleware.APIv2ValidationErrorMiddleware(application)

  Bases: `Middleware`

class designate.api.middleware.ContextMiddleware(application: WSGIApplication | None, conf: dict[str, ty.Any] | cfg.ConfigOpts | None = None)

  Bases: `Middleware`

  make_context(request, *args, **kwargs)

class designate.api.middleware.FaultWrapperMiddleware(application)

  Bases: `Middleware`

class designate.api.middleware.KeystoneContextMiddleware(application)

  Bases: `ContextMiddleware`

  process_request(request)

    Called on each request.

    If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.

class designate.api.middleware.MaintenanceMiddleware(application)

  Bases: `Middleware`

  process_request(request)

    Called on each request.

    If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.

class designate.api.middleware.NoAuthContextMiddleware(application)

  Bases: `ContextMiddleware`

  process_request(request)

    Called on each request.

    If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.

class designate.api.middleware.NormalizeURIMiddleware(application: WSGIApplication | None, conf: dict[str, ty.Any] | cfg.ConfigOpts | None = None)

  Bases: `Middleware`

class designate.api.middleware.TestContextMiddleware(application, tenant_id=None, user_id=None)

  Bases: `ContextMiddleware`

  process_request(request)

    Called on each request.

    If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.

designate.api.middleware.auth_pipeline_factory(loader, global_conf, **local_conf)

  A paste pipeline replica that keys off of auth_strategy.

  Code nabbed from cinder.

## API Service

class designate.api.service.Service

  Bases: `WSGIService`

  property service_name
  start()

    Start a service.

  stop(graceful=True)

    Stop a service.

    Parameters:

      graceful – indicates whether to wait for all threads to finish or terminate them instantly

  property wsgi_application

class designate.api.service.WSGIService(app, name, listen, max_url_len=None)

  Bases: `Service`

  start()

    Start a service.

  stop(graceful=True)

    Stop a service.

    Parameters:

      graceful – indicates whether to wait for all threads to finish or terminate them instantly

  wait()

    Wait for a service to shut down.

this page last updated: 2026-04-13 15:37:16

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug