cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
527
Views
5
Helpful
1
Replies

write action to external system based on service CRUD & commit status

AnhTrinh
Level 1
Level 1

Hi all,

 

I'm having a L3VPN service with python template. I'm trying to implement some actions to an external system based on the operation and commit status of my service.

 

For example:

- If service is created and the commit is successful -> action A

- If service is modified and the commit is successful -> action B

- If service is deleted and the commit is successful -> action C

 

I know that I can get the create/update/delete info from the "op" argument in pre_modification or post_modification functions inside the service python code. But those functions can't distinguish between a real commit and a commit dry-run. 

 

Really appreciate if someone can recommend a solution to my problem.

1 Accepted Solution

Accepted Solutions

snovello
Cisco Employee
Cisco Employee
You should look at kickers or subscribers, both of these happen after the transaction is complete, so you won’t see dry runs, and both can see the set of changes so they can distinguish between create/modify/delete cases.

View solution in original post

1 Reply 1

snovello
Cisco Employee
Cisco Employee
You should look at kickers or subscribers, both of these happen after the transaction is complete, so you won’t see dry runs, and both can see the set of changes so they can distinguish between create/modify/delete cases.