I have an NSO Service with a few input fields. The standard way of selecting the devices to which to apply the service would be for the user to click the "+" sign in the "device" field and select the desired device(s).
I would like to implement some logic in Java which pre-populates the field with some devices. How can I control what appears in the "device" field?
The actual logic to select the correct devices will be rather complex (taking a list of all devices, running through it, checking interfaces/ACL's and depending on information found on the interfaces select or do not select the device for application of my service...or something along those lines). For a start I just want to know how I can hard code a bunch of devices to appear in the "device" field. Please help. Thanks!
Another question that comes to my mind is: What is the filed "device-list" for, if "devices" already allows me to select a list of devices to which to apply the service?
Is "devices" possibly for selecting devices to which the service should be applied to on commit and "device-list" shows devices currently (already) affected by the service (i.e. they have had some configuration done as a consequence of instantiating the service)?
You can’t really control that field with Java, That field is largely dependent on the YANG model. So typically that’s done by through leaf-refs in the YANG service model or other model constraints.
Most customers who need to implement complex interfaces such as the one you’ve described about don’t use the NSO GUI to do that. Its really not that extensible and isn’t really intended for that purpose. You can look at some of the example GUI modifications provided for some of the sample applications provided with NSO in exampls.ncs under the examples directory. The service provider mpls-vpn example might be a good one to look at.
NSO maintains the device-list as operational data for each service instance. The device-list is all the devices which have configuration changes as part of that service instance.