ironic.api.hooks module

class ironic.api.hooks.ConfigHook[source]

Bases: PecanHook

Attach the config object to the request so controllers can get to it.

before(state)[source]

Override this method to create a hook that gets called after routing, but before the request gets passed to your controller.

Parameters:

state – The Pecan state object for the current request.

class ironic.api.hooks.ContextHook(public_api_routes)[source]

Bases: PecanHook

Configures a request context and attaches it to the request.

after(state)[source]

Override this method to create a hook that gets called after the request has been handled by the controller.

Parameters:

state – The Pecan state object for the current request.

before(state)[source]

Override this method to create a hook that gets called after routing, but before the request gets passed to your controller.

Parameters:

state – The Pecan state object for the current request.

class ironic.api.hooks.DBHook[source]

Bases: PecanHook

Attach the dbapi object to the request so controllers can get to it.

after(state)[source]

Override this method to create a hook that gets called after the request has been handled by the controller.

Parameters:

state – The Pecan state object for the current request.

before(state)[source]

Override this method to create a hook that gets called after routing, but before the request gets passed to your controller.

Parameters:

state – The Pecan state object for the current request.

class ironic.api.hooks.NoExceptionTracebackHook[source]

Bases: PecanHook

Workaround rpc.common: deserialize_remote_exception.

deserialize_remote_exception builds rpc exception traceback into error message which is then sent to the client. Such behavior is a security concern so this hook is aimed to cut-off traceback from the error message.

after(state)[source]

Override this method to create a hook that gets called after the request has been handled by the controller.

Parameters:

state – The Pecan state object for the current request.

class ironic.api.hooks.PublicUrlHook[source]

Bases: PecanHook

Attach the right public_url to the request.

Attach the right public_url to the request so resources can create links even when the API service is behind a proxy or SSL terminator.

before(state)[source]

Override this method to create a hook that gets called after routing, but before the request gets passed to your controller.

Parameters:

state – The Pecan state object for the current request.

class ironic.api.hooks.RPCHook[source]

Bases: PecanHook

Attach the rpcapi object to the request so controllers can get to it.

before(state)[source]

Override this method to create a hook that gets called after routing, but before the request gets passed to your controller.

Parameters:

state – The Pecan state object for the current request.

ironic.api.hooks.policy_deprecation_check()[source]