The nova.api.openstack.extensions Module¶
-
class
ControllerExtension(extension, collection, controller)¶ Bases:
objectExtend core controllers of nova OpenStack API.
Provide a way to extend existing nova OpenStack API core controllers.
-
class
ExtensionDescriptor(ext_mgr)¶ Bases:
objectBase 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.
-
alias= None¶
-
get_controller_extensions()¶ List of extensions.ControllerExtension extension objects.
Controller extensions are used to extend existing controllers.
-
get_resources()¶ List of extensions.ResourceExtension extension objects.
Resources define new nouns, and are accessible through URLs.
-
is_valid()¶ Validate required fields for extensions.
Raises an attribute error if the attr is not defined
-
name= None¶
-
updated= None¶
-
-
class
ExtensionManager¶ Bases:
objectLoad extensions from the configured extension path.
See nova/tests/api/openstack/compute/extensions/foxinsocks.py or an example extension implementation.
-
get_controller_extensions()¶ Returns a list of ControllerExtension objects.
-
get_resources()¶ Returns a list of ResourceExtension objects.
-
is_loaded(alias)¶
-
load_extension(ext_factory)¶ Execute an extension factory.
Loads an extension. The ‘ext_factory’ is the name of a callable that will be imported and called with one argument–the extension manager. The factory callable is expected to call the register() method at least once.
-
register(ext)¶
-
sorted_extensions()¶
-
-
class
ExtensionsController(extension_manager)¶ Bases:
nova.api.openstack.wsgi.Resource-
create(req, body)¶
-
delete(req, id)¶
-
index(req)¶
-
show(req, id)¶
-
-
class
ResourceExtension(collection, controller=None, parent=None, collection_actions=None, member_actions=None, custom_routes_fn=None, inherits=None, member_name=None)¶ Bases:
objectAdd top level resources to the OpenStack API in nova.
-
class
V21APIExtensionBase(extension_info)¶ Bases:
objectAbstract base class for all v2.1 API extensions.
All v2.1 API extensions must derive from this class and implement the abstract methods get_resources and get_controller_extensions even if they just return an empty list. The extensions must also define the abstract properties.
-
alias¶ Alias for the extension.
-
get_controller_extensions()¶ Return a list of controller extensions.
The extensions should return a list of ControllerExtension objects. This list may be empty.
-
get_resources()¶ Return a list of resources extensions.
The extensions should return a list of ResourceExtension objects. This list may be empty.
-
is_valid()¶ Validate required fields for extensions.
Raises an attribute error if the attr is not defined
-
name¶ Name of the extension.
-
version¶ Version of the extension.
-
-
check_compute_policy(context, action, target, scope='compute')¶
-
expected_errors(errors)¶ Decorator for v2.1 API methods which specifies expected exceptions.
Specify which exceptions may occur when an API method is called. If an unexpected exception occurs then return a 500 instead and ask the user of the API to file a bug report.
-
load_standard_extensions(ext_mgr, logger, path, package, ext_list=None)¶ Registers all standard API extensions.