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):
- Device and device port types and names
- Device location, owner, hardware and software versions
- Wether components are allowed or denied inclusion in the network model
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.
- A subject is a reference to, or a placeholder for, an object to be configured via this subsystem. Example: a
DeviceIdfor a network device, or a
ConnectPointfor a device port.
- A config is a set of exposed tunables for a given object. Example: A
BasicDeviceConfigallows a device’s type and southbound driver to be set/changed.
- A key, or subject key, is a string name for a subject. It is used as the key for the JSON field containing the configuration values. Example: Device configurations can be found in the field with key “devices”.
- A config key is a string name for a configuration class. It is also used as a JSON field key. Example: the key “basic” refers to the general configurations allowed for a device. The value associated with it may be a JSON representation of config values.
Configsubclasses implement the tunables for a subject as a set of getters and setters (attribute accessors) to JSON object constructs (
ObjectNodes). Example: An
OpticalPortConfigis defined as:
meaning that it manipulates the configurations associated with
ConnectPointsubjects (optical ports). Some of its attribute accessors include the port’s string and numeric names, and the number of channels that the port supports.
SubjectFactoryties a subject to its subject key, and generates objects that represent the subject. Example: the factory that generates
ConnectPointsis instantiated as:
meaning that the key for the JSON field containing port information is keyed on string “ports”, and the factory can create
ConnectPoints from a “deviceId:port” string (the argument to
ConfigFactoryties a subject to its config and config key, and generates
Configs. Example: The ConfigFactory for
OpticalPortConfigis defined as:
indicating that the
OpticalPortConfigs, and the configuration information for a given optical port can be fetched from the subsystem’s manager using its associated subject (a
ConnectPointin this case). In the JSON structure, the key “basic” can be used to fetch out the values set by the
- ConfigFactory required for what needs to be parsed
- ConfigFactory registered with
NetworkConfigManager, either by adding it to
BasicNetworkConfigswhich will load it when it starts up, or by manually invoking
NetworkConfigManager.registerConfigFactory()from the application
- Register application as a
- Via CLI or REST API
- By loading a file from a fixed location using the Network Configuration Loader