06-06-2023 05:52 AM
Hello Community
I do have the next basic service in my NSO which create a custom loopback. Using the CLI works well
admin@ncs(config)# my_std_mgmt_loopback TEST_FOR_CISCO_COMUNNITY device my_sw loopback-intf 77 ip-address 77.77.77.77 net_mask 255.255.255.0
but I would like to use this service and create a loopback thru the API. Is that possible? Can you give me an insight ?
NSO version: 6.1
Solved! Go to Solution.
06-06-2023 09:08 AM
Python is the best!
06-06-2023 06:10 AM
Check out the NSO Postman collection HERE this will show you how to create a loopback, edit the loopback and also delete the IP and the loopback itself via the API.
Hope this helps.
06-06-2023 06:22 AM
thanks for that. Im able to create the loopback using RESTCONF. However how can I consume my service thru the NSO API?
06-06-2023 06:51 AM
The specific method that you use to consume a service through an API will depend on your programming language of choice and your preferred development environment. Which is that?
06-06-2023 07:08 AM
Im using python and request module to make API calls
06-06-2023 09:08 AM
Python is the best!
06-08-2023 08:16 AM
Thanks!
06-09-2023 04:37 AM
See the new $NCS_DIR/examples.ncs/development-guide/nano-services/netsim-sshkey/showcase_maapi.py for an intro example. Used by the NSO Getting Started Guide https://developer.cisco.com/docs/nso/guides/#!developing-and-deploying-a-nano-service
There are corresponding Python requests RESTCONF and CLI showcase variants too in the example.
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