04-19-2018 12:23 AM - edited 03-01-2019 04:08 AM
Hello,
I am quite new to NSO Development. I am searching for a example for a simple stacked NSO Service. I went through the development guide but I am not quite sure how to accomplish this.
Thank you
Knut
Solved! Go to Solution.
04-22-2018 03:50 PM
Here is a very crude example just to show the mechanics of mapping between the layer.
It is exactly like mapping to device-models, except the top-level service maps to bottom-level service[s].So it is possible to have N levels of mappings. The bottom most layer would then map to a device model.
04-19-2018 02:19 AM
jump into you package directory and enter the following command in your project.
cisco@NCS:~$ cd $HOME/ncs-run/packages
cisco@NCS:~/ncs-run/packages$ ncs-make-package --service-skeleton template-based l2vpn
|-> your package name
These are the following options:-
JAVA specific options:
--java-package NAME
PYTHON specific options:
--component-class NAME (default main.Main)
--action-example
--subscriber-example
You will get to see the basic examples of NSO Service.
04-19-2018 03:42 AM
Hi Kiran,
I am searching for a example where one service instincates some other more basic services.
Kind regards
Knut
04-19-2018 06:40 AM
You can find the basic services in the Lab Guide and here are few links from github.
04-20-2018 01:33 AM
Hi,
I'm not sure if there's an example of a simple stacked service in the installation dir, but there's an example of layered service architecture which is using service stacking (nso-dir/examples.ncs/getting-started/developing-with-ncs/22-layered-service-architecture). The difference is that it's not a monolithic nso but a different architecture because of LSA.
The idea is that you split your service into upper and lower layers. Upper layers usually don't touch devices directly, but are used to manage lower level service layers. So imagine that at your lower level services you're mapping input to the templates for pushing the config to the devices - so the normal service you usually create.
Input to the higher level services will be mapped using the templates which include configuration tree of particular lower level service - so they are mapping user input not directly to the device but rather to the other services which can then process the input and apply their templates.
Higher level service will then be the point for interaction with your services.
04-20-2018 04:46 AM
Hi,
I believe Simon's reply should give you idea to create a stacked service yourself. Let me give an example from our project.
We have a service defined for our overall product which in turn will call other individual services such as mpls, internet etc.
How do you create a simple stacked service? Create all these services individually first. Then when you want to configure one service from the other one, you populate xml template of other service from the first service and apply the template. Only the last service will apply device template. Rest of them will be applying the service template of the underlying service.
Regards,
Shameer
04-20-2018 05:18 AM
Hi Shameer,
this is something I would like to do to.
I have several more basic services which should be bundled together. These higher level servies should be available via REST to our OSS/BSS system.
Regards,
Knut
04-20-2018 06:03 AM
Hi Knut,
Here is a sample.
module lower1 {
augment /ncs:services {
list lower1 {
key name;
leaf name {
type string;
}
uses ncs:service-data;
ncs:servicepoint lower1-servicepoint;
leaf device {
mandatory true;
type string;
}}}}
----
module lower2 {
augment /ncs:services {
list lower2 {
key name;
leaf name {
type string;
}
uses ncs:service-data;
ncs:servicepoint lower2-servicepoint;
leaf device {
mandatory true;
type string;
}}}}
====
module higher {
augment /ncs:services {
list higher {
key name;
leaf name {
type string;
}
uses ncs:service-data;
ncs:servicepoint higher-servicepoint;
container lower1 {
presence "lower1";
uses lower1:lower1;
}
container lower2 {
presence "lower2";
uses lower2:lower2;
}}}}
Regards,
Shameer
04-22-2018 03:48 PM
Please note that generally, when using stacked services, the idea is to have layers of abstractions. Hide some parameters/complexity at the bottom layers and not expose everything all the way to the top layer. If the top service is just a sum total of all possible parameters from the bottom services, then we are not using stacked services to its full potential. So when it makes sense, auto-generate, infer, look-up, deduce some of the parameters of the bottom services while mapping out from the top service
04-22-2018 03:50 PM
Here is a very crude example just to show the mechanics of mapping between the layer.
It is exactly like mapping to device-models, except the top-level service maps to bottom-level service[s].So it is possible to have N levels of mappings. The bottom most layer would then map to a device model.
04-25-2018 11:48 PM
Is it possible to show the dependancy between the services once it is applied.
Lets say service first uses the device facing service second. Is there a way to display that services second was instanciated from service first?
04-26-2018 12:23 AM
So with your top level service instance, you can do "get-modifications shallow" which will show it mapping to the bottom-service-instance. There is also an option to do "get-modifications deep" which expands it out to show the entire device layer mappings.
04-26-2018 12:41 AM
I wonder if this is possible the other way around?
admin@ncs# show services KS-Loopback used-by-customer-service
USED BY
CUSTOMER
DEVICE ID SERVICE
------------------------
ips1 2012 -
admin@ncs#
There is a simple example but there is a Service KS-CE which uses KS-Loopback.
02-27-2019 03:00 AM
Hi Alam,
I downloaded your example "stacked_services", but in the service "service-first" I didn't find the java code to populate xml template of other service.
Can you help me?
Thanks
02-27-2019 03:24 AM
That service is a pure template-service and has no Java-code.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide