How much effort is required to implement a new resource (or to extend the capabilities of an already existing one)?

This question really depends on the components to develop.

A resource from scratch:

As explained in “Create a new resource section”, the required components to add support for a new resource type are:

  • ResourceRepository
  • ResourceBootstrapper
  • Model: Fabric independent representation of the status of a resource.

The model is the piece that varies the most between resources, and the on that takes more effort. Once the model is in place, the rest may be developed in a day or two.

With these components in place, a new resource type is supported. However, there is no way a user can interact with it unless capabilities are present.

A new capability:

To create a new capability, following components are required:

  • Capability API: one must come an API expressing the functionality in a fabric independent fashion.
  • Capability implementation using actions
  • Driver: Capabilities require a fabric aware implementation for the actions it defines. A driver for desired fabric must be present for the capability to be functional.

Capability API and its implementation using actions may be implemented in a day or two. However, having a useful API is what really provides value, and to come up with the desired one is a design task that is to be done before implementing.

A new driver:

The most complex component is the driver. In order to use an existing capability in a particular device, a driver providing a specific implementation for that device of required actions must be present. A driver consists of actions implementations that make use of protocol session(s) to communicate with the device. Most of driver complexity is in having a client to manages the device remotely. This step may take weeks or even months.  However, once that is accomplished, developing desired actions uses to be quite straightforward if the client has similar features, although it may be tiring depending on the number of actions to implement. Just to put some edge samples, it is not the same developing a driver calling a defined REST API, than another connecting to the device CLI over SSH and trying to parse from it. But, once you have a client that does what you want to do in the device, one should be able to integrate in into a driver in a week or two.

So the golden rule for creating a capability with its driver would be something like:

  1. Select the device you want to support.
  2. Tell the community what you want to do and if someone else is interested.
  3. Define what is the API you want to work with in OpenNaaS. The community is a very good place to gather ideas and suggestions about that.
  4. Create a java client that remotely connects to the device and performs atomic actions that applied together cause all desired transformations.
  5. Save a month to integrate that into OpenNaaS.
  6. Announce your results and share them with us! 😉

Posted in: Developers