OpenDaylight Controller:Neutron Interface
The Neutron interface is provided by the following three bundles:
Contains the org.opendaylight.controller.networkconfig.neutron java package with:
- JAXB annotated base Neutron object classes
- JAXB annotated subclasses implied from the Neutron API
- INeutron*CRUD interface definitions for the NB methods to use in manipulating Neutron objects
- INeutron*Aware interfaces for other bundles to use when registering services that are interested in Neutron objects (see below)
Contains the org.opendaylight.controller.networkconfig.neutron.implementation package with:
- implementations of the INeutron*CRUD interfaces for storing Neutron objects in caches
- Activator class Activator class.
A single java package: org.opendaylight.controller.networkconfig.neutron.northbound containing
- JAX-RS annotated classes for supporting the API documented in Networking API v2.0
- JAX-B annotated specific Request classes for handling singleton and bulk requests per the API.
The Neutron interface bundles use MOXy as the JAXB implementation/provider. For more details on how, see ODMC: Using MOXy as the JAXB provider
Other bundles can register services by implemented the INeutron*Aware interface (replace * with each of the base Neutron object types: Network, Subnet, Port, Router, and FloatingIP). Each interface definition contains six methods signatures (note: the router interface contains two additional method signatures for add and remove interface operations). The signatures break down into the following table:
|API Operation||Can Method||Do Method|
The northbound class for a particular Neutron object first calls the "Can" method for that operation on each registered service and expects and integer value to be returned. This return value is interpreted as an HTTP service code. If a service can honor the request, it returns a value from 200-299. If the service returns some other value, that value is returned to the client and the operation is not completed. This allows services to return specific status codes beyond those documented in the Neutron API.
Once all registered services confirm that an proposed operation is supported, the NB class completes the operation via the appropriate CRUD interface and then calls the "Do" method for that operation for each registered service so that service can take appropriate action for the just completed operation.