This is the sequence of calls for booting up the Barbican API server:
bin/barbican.sh start: Launches a WSGI service that performs a
PasteDeploy process, invoking the middleware components found in
barbican/api/middleware as configured in
etc/barbican/barbican-api-paste. The middleware
components invoke and then execute the Pecan application created via
barbican/api/app.py:create_main_app(), which also
defines the controllers (defined in barbican/api/controllers/) used to
process requested URI routes.For synchronous calls, the following sequence is generally followed:
XxxxController classes in barbican/api/controllers/xxxx.py,
keyed to an HTTP verb (so one of POST, GET, DELETE, or PUT).barbican/api/controllers/secrets.py, the SecretController’s
on_get() is invoked.SecretRepo repository class (found in
barbican/model/respositories.py) is then used to retrieve the
entity of interest, in this case as a Secret entity defined in
barbican/model/models.py.barbican/plugin/resources.py’s get_secret() function.For asynchronous calls, the following sequence is generally followed:
XxxxcController classes in barbican/api/controllers/.barbican/api/controllers/orders.py, the OrdersController’s
on_post() is invoked.OrderRepo repository class (found in
barbican/model/respositories.py) is then used to create the
barbican/model/models.py’s Order entity in a ‘PENDING’ state.process_type_order() method on the TaskClient
class (found in barbican/queue/client.py) is invoked to send a
message to the queue for asynchronous processing.barbican/queue/server.py’s Tasks class. This method then
invokes the process_and_suppress_exceptions() method on one of the
barbican/tasks/resources.py’s BaseTask implementors. This method
can then utilize repository classes as needed to retrieve and update
entities. It may also interface with third party systems via plugins`. The
barbican/queue/client.py’s TaskClient class above may also be
invoked from a worker node for follow on asynchronous processing steps.process_type_order() method on barbican/queue/server.py’s
Tasks class. Note the method is named the same as the
TaskClient method above by convention.process_and_suppress_exceptions() on
the barbican/tasks/resources.py’s BeginTypeOrder class. This
class is responsible for processing all newly-POST-ed orders.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.