cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1912
Views
15
Helpful
3
Replies

How to to request Action with parameters by Python in an NSO action

yongz2
Cisco Employee
Cisco Employee

We want to call an action with parameters by Python in an NSO action, There is an maapi.requestAction(parms,"url") in Java, like : maapi.requestAction(params, "/ncs:devices/ncs:partial-sync-from")
Do we have an similarity method in Python? It's would be really appreciate for your idea.

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee

There are two options:

 

1. You have a _ncs.maapi.request_action call, there is an example in 

./service-provider/mpls-vpn-layered-service-architecture/create-vpn.py

2. With maagic you can call actions directly on on the objects, if you have a device node dev you can simply do:

 

        r = dev.sync_from()

 

View solution in original post

3 Replies 3

vleijon
Cisco Employee
Cisco Employee

There are two options:

 

1. You have a _ncs.maapi.request_action call, there is an example in 

./service-provider/mpls-vpn-layered-service-architecture/create-vpn.py

2. With maagic you can call actions directly on on the objects, if you have a device node dev you can simply do:

 

        r = dev.sync_from()

 

Hi vleijon,

 

It's worked, thanks for your help!

Hi, I was looking for syntax for partial sync_from in maagic, couldn't figure out so far. Does anyone have it handy?
Thanks