git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed create_slice into CreateSliver on the managers side
[sfa.git]
/
sfa
/
rspecs
/
aggregates
/
rspec_manager_openflow.py
diff --git
a/sfa/rspecs/aggregates/rspec_manager_openflow.py
b/sfa/rspecs/aggregates/rspec_manager_openflow.py
index
314f21a
..
2eeeacc
100755
(executable)
--- a/
sfa/rspecs/aggregates/rspec_manager_openflow.py
+++ b/
sfa/rspecs/aggregates/rspec_manager_openflow.py
@@
-1,9
+1,3
@@
-from sfa.util.faults import *
-from sfa.util.misc import *
-from sfa.util.rspec import Rspec
-from sfa.server.registry import Registries
-from sfa.util.config import Config
-from sfa.plc.nodes import *
import sys
#The following is not essential
import sys
#The following is not essential
@@
-14,7
+8,13
@@
import sys
import socket
import struct
import socket
import struct
-# Message IDs for all the GENI light calls
+from sfa.util.faults import *
+from sfa.util.rspec import RSpec
+from sfa.server.registry import Registries
+from sfa.util.config import Config
+from sfa.plc.nodes import *
+
+# Message IDs for all the SFA light calls
# This will be used by the aggrMgr controller
SFA_GET_RESOURCES = 101
SFA_CREATE_SLICE = 102
# This will be used by the aggrMgr controller
SFA_GET_RESOURCES = 101
SFA_CREATE_SLICE = 102
@@
-105,8
+105,8
@@
def reset_slices(cred, hrn):
if DEBUG: print "Received reset_slices call"
return msg_aggrMgr(SFA_RESET_SLICES)
if DEBUG: print "Received reset_slices call"
return msg_aggrMgr(SFA_RESET_SLICES)
-def
create_slice
(cred, hrn, rspec):
- if DEBUG: print "Received
create_slice
call"
+def
CreateSliver
(cred, hrn, rspec):
+ if DEBUG: print "Received
CreateSliver
call"
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds%ds' % (len(slice_id)+1, len(rspec)), SFA_CREATE_SLICE, slice_id, rspec)
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds%ds' % (len(slice_id)+1, len(rspec)), SFA_CREATE_SLICE, slice_id, rspec)
@@
-126,8
+126,8
@@
def create_slice(cred, hrn, rspec):
print "IO error"
return 0
print "IO error"
return 0
-def
get_rspec
(cred, hrn=None):
- if DEBUG: print "Received
get_rspec
call"
+def
ListResources
(cred, hrn=None):
+ if DEBUG: print "Received
ListResources
call"
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds' % len(slice_id), SFA_GET_RESOURCES, slice_id)
slice_id = generate_slide_id(cred, hrn)
msg = struct.pack('> B%ds' % len(slice_id), SFA_GET_RESOURCES, slice_id)
@@
-147,14
+147,20
@@
def get_rspec(cred, hrn=None):
print "IO error"
return None
print "IO error"
return None
+"""
+Returns the request context required by sfatables. At some point, this mechanism should be changed
+to refer to "contexts", which is the information that sfatables is requesting. But for now, we just
+return the basic information needed in a dict.
+"""
def fetch_context(slice_hrn, user_hrn, contexts):
def fetch_context(slice_hrn, user_hrn, contexts):
- return None
+ base_context = {'sfa':{'user':{'hrn':user_hrn}}}
+ return base_context
def main():
def main():
- r = R
s
pec()
+ r = R
S
pec()
r.parseFile(sys.argv[1])
rspec = r.toDict()
r.parseFile(sys.argv[1])
rspec = r.toDict()
-
create_slice
(None,'plc',rspec)
+
CreateSliver
(None,'plc',rspec)
if __name__ == "__main__":
main()
if __name__ == "__main__":
main()