cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
61
Views
6
Helpful
18
Replies
Cisco Employee

NSO Rest .Net library

Anyone saw/heard/seen any .Net libraries that implement REST communication with NSO?

It would help us to jumpstart the project my team is working on.

I do not see anything on the developer.cisco.com

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: NSO Rest .Net library

Let me re-phrase.

In REST you write straight to running config, so in that way it is similar to how IOS configures routers you press enter and you fire the config change.

In JSON RPC you implement what is called a “two phase commit mechanism” which is ideal for a transaction across multiple devices: you open a transaction first, you then have a preparation phase where you can: set your changes, validate them, you can do a commit-dry-run and finally you perform a commit of the changes.

As Stefan pointed out, you could use also NETCONF thanks to our JAVA library.

The language libraries (JAVA, Erlang, Python) are also an option. However, you need to check your security requirements here as you working against an RPC socket. In NETCONF and JSON RPC you have SSH or TLS transport/authentication, encryption, etc.

View solution in original post

18 REPLIES 18
Highlighted
Cisco Employee

Re: NSO Rest .Net library

Do not know what project you work on but, just for curiosity, why REST?

Highlighted
Cisco Employee

Re: NSO Rest .Net library

I'm pretty sure there's nothing readily available specifically for NSO in dotnet. According to mr. Google there seems be loads of generic dotnet based REST libraries waiting to serve, however.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

Rest seems to be the easiest way to talk to NCS from a standalone program. Are you aware of any other libraries that talk to ncs?

Highlighted
Cisco Employee

Re: NSO Rest .Net library

Easiest is a point of view. Remember that you loose the concept off transactions.

Have you checked the other apis? JSON RPC in particular.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

That is an interesting statement “ you loose the concept of transactions” – I assume you mean with REST as it does not fully implement all the netconf capabilities.

Can you elaborate more and why the JSON RPC is better from that aspect vs. say using netconf or in the future RESTCONF?

Highlighted
Cisco Employee

Re: NSO Rest .Net library

The REST api does not implement all of netconfs capabilities, and - looking at the current draft - nor will RestConf:

(From the latest draft)

....

1.1. Simple Subset of NETCONF Functionality

...

 
   RESTCONF is not intended to replace NETCONF, but rather provide an
   additional simplified interface that follows REST principles and is
   compatible with a resource-oriented device abstraction.
...
Add to that that the current API lack even more functionality, such as event notifications.
The REST API is in no way a bad API, it just is what it is, a simple subset of NETCONF.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

I do not know what to elaborate. IMHO, I would use anything but REST. I would use REST for read only if I can.

With JSON RPC, NETCONF and others you get commits, dry run, rollbacks, etc etc.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

Let me re-phrase.

In REST you write straight to running config, so in that way it is similar to how IOS configures routers you press enter and you fire the config change.

In JSON RPC you implement what is called a “two phase commit mechanism” which is ideal for a transaction across multiple devices: you open a transaction first, you then have a preparation phase where you can: set your changes, validate them, you can do a commit-dry-run and finally you perform a commit of the changes.

As Stefan pointed out, you could use also NETCONF thanks to our JAVA library.

The language libraries (JAVA, Erlang, Python) are also an option. However, you need to check your security requirements here as you working against an RPC socket. In NETCONF and JSON RPC you have SSH or TLS transport/authentication, encryption, etc.

View solution in original post

Highlighted
Cisco Employee

Re: NSO Rest .Net library

That helps out a lot. As you know in all of our architectural documents – REST is the northbound API depicted – so one naturally starts there.

Is there a tool like Postman for REST  that can be used to exercise the JSON RPC for testing it out?

Highlighted
Cisco Employee

Re: NSO Rest .Net library

I know you can use curl for JSON RPC testing. I never tried Postman but some else in the list may know. You can use netconf-console to test NETCONF.

I think that thinking about REST by default is a bad consequence of adopting web-programming paradigms that are not necessarily best suited in service activation. Also, we must offer it even if it is only to tick a box on a customer RFP.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

I did not quite follow on what is the tool of choice would be in your opinion? I have a windows application running that needs to talk to ncs. Java is not an option. What is the best library to use?

If there is no library then what protocol to implement? (This would be tough though since I am sure REST is the easiest)

Highlighted
Cisco Employee

Re: NSO Rest .Net library

It seems that JSON-RPC is not included in the 3.4 NB interface or development documentation.

What is a good resource to understand this API?

Highlighted
Cisco Employee

Re: NSO Rest .Net library

The info is in the 3.4’s WebUI guide.

Highlighted
Cisco Employee

Re: NSO Rest .Net library

With REST, we write directly the config of NCS, not any devices/controllers/systems beneath NCS, agree?

So there are two transactions here: one for NCS config change, the other for – what's the simple word, let's say NE ? For NE, we always get the transaction which is done by NCS for us. I'm not sure but I assume NCS config change via REST is also transaction-ful.

Please someone confirm or correct.

This widget could not be displayed.