The network configuration subsystem allows applications to inject attribute and configuration information for various network components into the models used for network representation. Examples include (but are not limited to):

The configurations may refer to a component that may or may not already exist in the network representation (i.e., the system may/may not have discovered it in the network). This implies that an application can offer hints about a yet-discovered component, as well as modify a known component’s attributes.

This subsystem likewise serves as a shim between the system’s network representation, and the means to configure it. Currently, JSON is the preferred means to describe component configurations.

Terminology

Components

Using Network Configuration Services

REST API

The NetworkConfigWebResource implements the REST calls for the network configuration subsystem. Its functionalities will eventually replace that of ConfigWebResource.

The following example uses the REST API to upload a configuration file:

 

curl --user onos:rocks -X POST -H "Content-Type: application/json" http://192.168.56.111:8181/onos/v1/network/configuration/ -d @/tmp/cfg.json

The above assumes a running instance at 192.168.56.111, and a configuration file at /tmp/cfg.json. They should be replaced with appropriate values.

Likewise, the user:password vaues may differ with your setup; Other common values are karaf:karaf and onos:onos.

 

Network Configuration Loader

The NetworkConfigLoader reads JSON files from a known location and attempts to load them as network configurations.

Currently, a file named network-cfg.json is picked up from ${ONOS_ROOT}/tools/package/config/ and placed in ${KARAF_ROOT}../config/ (currently fixed) at deployment. When the remote instance boots, its network configuration loader runtime will read this file.

The Network Configuration Loader is implemented as a listener for Network Configuration events (NetworkConfigEvents). It attempts to use the knwon Configs in order to generate or update entities in the network model once it is notified that the Configs are available.