blob: ebc4d1260f3cdc7b5af7489f96aa686d64980979 [file] [log] [blame]
Rizwan Haider65baf552016-09-28 16:47:28 -04001import json
2from synchronizers.metronetwork.invokers.invoker import Invoker
3from services.metronetwork.models import NetworkEdgePort
4
5
6class NetworkEdgeToEdgePointInvoker(Invoker):
7 def __init__(self, **args):
8 pass
9
10 # Method for handline pre save semantics
11 # content here would be model specific but could include handling Many-to-Many relationship
12 # creation - which must occur post save
13 #
14 # obj - Whatever obj was just saved
15 # returns - None - this is a pure invoke() call, return type is None
16 #
17 def presave(self, obj):
18 # Now that the Ports are created - get a proper reference to them and update the
19 # src and dst fields
20 uni1port = NetworkEdgePort.objects.get(pid=obj.uni1_createbuffer)
21 uni2port = NetworkEdgePort.objects.get(pid=obj.uni2_createbuffer)
22 obj.uni1 = uni1port
23 obj.uni2 = uni2port
24
25 # Method for handline post save semantics
26 # content here would be model specific but could include handling Many-to-Many relationship
27 # creation - which must occur post save
28 #
29 # obj - Whatever obj was just saved
30 # returns - N/A - this is a pure invoke() call
31 #
32 def postsave(self, obj):
33 pass