group-based-policy/doc/source/devref/extension-drivers.rst
Igor Duarte Cardoso ebfd92fa2d Add DevRef for all major features
This is a partially fix since it doesn't fully address the dev-side
documentation of all GBP related resources. More work needs to be done
on top of this to have a full DevRef.

Change-Id: I135a3d23a5a1df136c04a7114f94274bd4921cb6
Partial-Bug: #1571385
2016-04-22 05:41:14 +00:00

1.9 KiB

Extension Drivers

The extension driver framework in GBP works much like Neutron's ML2, allowing GBP resources to be extended with additional attributes.

Requirements

Eventual GBP documentation will need to address configuring extension drivers and the fact that different policy drivers may require different API extensions.

Database models

Extension drivers implemented within the framework each have their own data models.

Internals

An ExtensionDriver abstract base class exists within the group_policy_driver_api module and contains the following methods and properties:

  • initialize(self) - Perform driver initialization.
  • extension_alias(self) - Supported extension alias.
  • process_create<resource>(self, session, data, result) - Process extended attributes for <resource> creation.
  • process_update<resource>(self, session, data, result) - Process extended attributes for <resource> update.
  • extend<resource>_dict(self, session, result) - Add extended attributes to <resource> dictionary.

See the ML2 extension driver specification and code review listed below in the references for more details.

Developers of policy drivers are able to define any needed extensions to the GBP API by defining extension drivers.

Configuration

The extension_drivers configuration variable will need to be set to enable any extensions required driver(s) specified in the policy_drivers configuration variable.

References