cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
104
Views
0
Helpful
3
Replies
Highlighted

show service output in a table format in NSO cli

Customer asked me to create a service in NSO with java in order to  show in a table format some data in the cli either in the webUi. These data in table format should be the input to another service.

I don'think this is possible in NSO: as for me it'is only possible to write data in a file and read it as input in another service, but I'm new in NSO programming. Besides I have no idea how I can show table formatted data in the cli with a service. Could anyone help me to find a solution?

3 REPLIES 3
Beginner

Re: show service output in a table format in NSO cli

I don't think it is possible for a service to have output.  As you say, you could write it to a file.  But perhaps a better possibility is to write it to the CDB itself so that other services could read it directly.  If you really want to return output to the CLI, you could use an action instead of a service.

 

-Allen

 

Re: show service output in a table format in NSO cli

Thank you for reply, it's very helpful for me.

Can you suggest  any example or best practice in the web to implement the action?

Cisco Employee

Re: show service output in a table format in NSO cli

Hello,

 

Regarding the "using service output as input to another service" - as it was suggested to you the second service can have access to the stored values of the initial service in the CDB so there is no real need for an output.

If the second service will always be created after the initial one you can have a look at stacked services (not saying it matches your use case but it is possible).

 

Regarding the "seeing the values of a service as a table" - in CLI you have the option after the show command to add tab after a pipe - of course if your service has many leaves it may become unreadable but you can filter on the leaves using select:

admin@ncs# show running-config test
test 42
 dummy 1.1.1.1
!
test 43
 dummy 2.2.2.2
!
admin@ncs# show running-config test | tab
NAME  DEVICE  DUMMY
-----------------------
42    -       1.1.1.1
43    -       2.2.2.2

admin@ncs# show running-config test | select dummy | tab
NAME  DUMMY
---------------
42    1.1.1.1
43    2.2.2.2

Regards,