cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1167
Views
15
Helpful
3
Replies
yongz2
Cisco Employee

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

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

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

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

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