Honeycomb/Releases/1609/Developing Honeycomb Plugins

From fd.io
< Honeycomb‎ | Releases/1609
Revision as of 10:09, 2 September 2016 by Mmarsale (Talk | contribs)

Jump to: navigation, search

Honeycomb plugin development tutorial

Honeycomb plugin development guide for 16.09 Honeycomb release.

Developing generic plugins

Since Honeycomb is a generic agent. Any plugin (translation code) can be injected into the framework, creating a custom agent providing RESTCONF/NETCONF northbound interfaces out-of-box.

Developing plugin code

Honeycomb provides a framework for plugins to participate in the data handling. The plugins use YANG modeling language to describe what:

  • data they can handle (Create, Read, Update, Delete operations)
  • notifications do they emit
  • RPCs are not supported

A plugin usually consists of:

  • YANG models - These models contain data and notification definitions that are implemented by the plugin.
  • Set of readers - Readers provide operational/state data from plugin or its underlying layer. This means that operational/state data is current state of the plugin or its underlying layer. Readers return these operational data by e.g. reading from underlying layer and transforming it into YANG modeled data.
  • Set of writers - Writers handle configuration data for the plugin or its underlying layer This means that configuration data is the intent being sent to Honeycomb, that should be passed to plugins or their underlying layers. Writers handle these configuration data by transforming YANG modeled data into e.g. underlying layer calls.
  • Set of initializers - Initializers are invoked right after Honeycomb starts. The gould here is to read current operational/state data of the plugin or its underlying layer and then transform the operational data into configuration data. This enables reconciliation in cases when Honeycomb looses it's persisted data, or is started fresh while the underlying layer already contains some configuration that is manifested as operational/state data
  • Plugin configuration - Usually configuration in json format + it's Java equivalent.
  • Set of notification producers - If there are any notifications, the producers transform the data into YANG model notifications and emit them.
  • Module - Small class instantiating & exposing plugin's components

What's good to add:

  • Unit tests
  • Documentation
  • Sample REST or NETCONF requests

Honeycomb provides an archetype

Adding notification

Bootstrapping Honeycomb plugin

Creating custom agent distribution

Adding existing plugins to the mix

Verifying agent

Full working example

Developing plugins for VPP

Honeycomb's primary use case is to provide an agent for VPP. There already are some plugins that provide the translation code for VPP, but there are still APIs that are not covered. In this section, a sample Honeycomb plugin will be created communicating with VPP.

Developing plugin code

Bootstrapping Honeycomb plugin

Creating custom agent distribution

Adding existing plugins to the mix

Verifying agent

Full working example