This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.1 docs or all OpenStack docs too.

The nova.api.openstack.extensions Module

class nova.api.openstack.extensions.ActionExtension(collection, action_name, handler)

Bases: object

Add custom actions to core nova OpenStack API controllers.

class nova.api.openstack.extensions.ActionExtensionController(application)

Bases: nova.api.openstack.common.OpenstackController

action(req, id)
add_action(action_name, handler)
class nova.api.openstack.extensions.ExtensionController(extension_manager)

Bases: nova.api.openstack.common.OpenstackController

create(req)
delete(req, id)
index(req)
show(req, id)
class nova.api.openstack.extensions.ExtensionDescriptor

Bases: object

Base class that defines the contract for extensions.

Note that you don’t have to derive from this class to have a valid extension; it is purely a convenience.

get_actions()

List of extensions.ActionExtension extension objects.

Actions are verbs callable from the API.

get_alias()

The alias for the extension.

e.g. ‘FOXNSOX’

get_description()

Friendly description for the extension.

e.g. ‘The Fox In Socks Extension’

get_name()

The name of the extension.

e.g. ‘Fox In Socks’

get_namespace()

The XML namespace for the extension.

e.g. ‘http://www.fox.in.socks/api/ext/pie/v1.0

get_resources()

List of extensions.ResourceExtension extension objects.

Resources define new nouns, and are accessible through URLs.

get_response_extensions()

List of extensions.ResponseExtension extension objects.

Response extensions are used to insert information into existing response data.

get_updated()

The timestamp when the extension was last updated.

e.g. ‘2011-01-22T13:25:27-06:00’

class nova.api.openstack.extensions.ExtensionManager(path)

Bases: object

Load extensions from the configured extension path.

See nova/tests/api/openstack/extensions/foxinsocks/extension.py for an example extension implementation.

get_actions()

Returns a list of ActionExtension objects.

get_resources()

Returns a list of ResourceExtension objects.

get_response_extensions()

Returns a list of ResponseExtension objects.

class nova.api.openstack.extensions.ExtensionMiddleware(application, ext_mgr=None)

Bases: nova.wsgi.Middleware

Extensions middleware for WSGI.

classmethod factory(global_config, **local_config)

Paste factory.

class nova.api.openstack.extensions.ResourceExtension(collection, controller, parent=None, collection_actions={}, member_actions={})

Bases: object

Add top level resources to the OpenStack API in nova.

class nova.api.openstack.extensions.ResponseExtension(method, url_route, handler)

Bases: object

Add data to responses from core nova OpenStack API controllers.

class nova.api.openstack.extensions.ResponseExtensionController(application)

Bases: nova.api.openstack.common.OpenstackController

add_handler(handler)
process(req, *args, **kwargs)