plus the other AMs should be OK except openflow that's outdated
from sfa.trust.credential import Credential
from sfa.plc.api import SfaAPI
from sfa.util.plxrn import hrn_to_pl_slicename, slicename_to_hrn
from sfa.trust.credential import Credential
from sfa.plc.api import SfaAPI
from sfa.util.plxrn import hrn_to_pl_slicename, slicename_to_hrn
+from sfa.util.callids import Callids
##
# The data structure used to represent a cloud.
##
# The data structure used to represent a cloud.
-def get_rspec(api, creds, options):
+def get_rspec(api, creds, options, call_id):
+ if not Callids().should_handle_call_id(call_id): return ""
global cloud
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
global cloud
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
# theRSpec = xml.read()
#create_slice(None, 'planetcloud.pc.test', theRSpec)
# theRSpec = xml.read()
#create_slice(None, 'planetcloud.pc.test', theRSpec)
- #rspec = get_rspec('euca', 'planetcloud.pc.test', 'planetcloud.pc.marcoy')
+ #rspec = get_rspec('euca', 'planetcloud.pc.test', 'planetcloud.pc.marcoy', 'test_euca')
#print rspec
print getKeysForSlice('gc.gc.test1')
#print rspec
print getKeysForSlice('gc.gc.test1')
-from sfa.util.rspec import RSpec
+import xml.dom.minidom
+
+from sfa.util.rspec import RSpec
from sfa.util.xrn import urn_to_hrn, hrn_to_urn, get_authority
from sfa.util.plxrn import hrn_to_pl_slicename
from sfa.util.plxrn import hrn_to_pl_slicename
from sfa.util.xrn import urn_to_hrn, hrn_to_urn, get_authority
from sfa.util.plxrn import hrn_to_pl_slicename
from sfa.util.plxrn import hrn_to_pl_slicename
from sfa.server.aggregate import Aggregates
from sfa.server.registry import Registries
from sfa.util.faults import *
from sfa.server.aggregate import Aggregates
from sfa.server.registry import Registries
from sfa.util.faults import *
+from sfa.util.callids import Callids
SFA_MAX_CONF_FILE = '/etc/sfa/max_allocations'
SFA_MAX_DEFAULT_RSPEC = '/etc/sfa/max_physical.xml'
SFA_MAX_CONF_FILE = '/etc/sfa/max_allocations'
SFA_MAX_DEFAULT_RSPEC = '/etc/sfa/max_physical.xml'
-def get_rspec(api, creds, options):
+def get_rspec(api, creds, options, call_id):
+ if not Callids().should_handle_call_id(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
from sfa.server.registry import Registries
from sfa.util.config import Config
from sfa.plc.nodes import *
from sfa.server.registry import Registries
from sfa.util.config import Config
from sfa.plc.nodes import *
+from sfa.util.callids import Callids
# Message IDs for all the SFA light calls
# This will be used by the aggrMgr controller
# Message IDs for all the SFA light calls
# This will be used by the aggrMgr controller
print "IO error"
return 0
print "IO error"
return 0
+# Thierry : this would need to handle call_id like the other AMs but is outdated...
def get_rspec(cred, xrn=None):
hrn = urn_to_hrn(xrn)[0]
if DEBUG: print "Received get_rspec call"
def get_rspec(cred, xrn=None):
hrn = urn_to_hrn(xrn)[0]
if DEBUG: print "Received get_rspec call"
def main():
api = SfaAPI()
"""
def main():
api = SfaAPI()
"""
- rspec = get_rspec(api, "plc.princeton.sapan", None)
- #rspec = get_rspec(api, "plc.princeton.coblitz", None)
- #rspec = get_rspec(api, "plc.pl.sirius", None)
+ rspec = get_rspec(api, "plc.princeton.sapan", None, 'pl_test_sapan')
+ #rspec = get_rspec(api, "plc.princeton.coblitz", None, 'pl_test_coblitz')
+ #rspec = get_rspec(api, "plc.pl.sirius", None, 'pl_test_sirius')
print rspec
"""
f = open(sys.argv[1])
print rspec
"""
f = open(sys.argv[1])
from sfa.plc.slices import *
from sfa.managers.aggregate_manager_pl import __get_registry_objects, __get_hostnames
from sfa.util.version import version_core
from sfa.plc.slices import *
from sfa.managers.aggregate_manager_pl import __get_registry_objects, __get_hostnames
from sfa.util.version import version_core
+from sfa.util.callids import Callids
# VINI aggregate is almost identical to PLC aggregate for many operations,
# so lets just import the methods form the PLC manager
# VINI aggregate is almost identical to PLC aggregate for many operations,
# so lets just import the methods form the PLC manager
-def get_rspec(api, creds, options):
+def get_rspec(api, creds, options,call_id):
+ if not Callids().should_handle_call_id(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
def main():
api = SfaAPI()
"""
def main():
api = SfaAPI()
"""
- #rspec = get_rspec(api, None, None)
- rspec = get_rspec(api, "plc.princeton.iias", None)
+ #rspec = get_rspec(api, None, None,)
+ rspec = get_rspec(api, "plc.princeton.iias", None, 'vini_test')
print rspec
"""
f = open(sys.argv[1])
print rspec
"""
f = open(sys.argv[1])
accepts = [
Mixed(Parameter(str, "Credential string"),
Parameter(type([str]), "List of credentials")),
accepts = [
Mixed(Parameter(str, "Credential string"),
Parameter(type([str]), "List of credentials")),
- Parameter(dict, "Options")
+ Parameter(dict, "Options"),
+ Parameter(str, "call_id"),
]
returns = Parameter(str, "List of resources")
]
returns = Parameter(str, "List of resources")
- def call(self, creds, options):
+ def call(self, creds, options, call_id=""):
self.api.logger.info("interface: %s\tmethod-name: %s" % (self.api.interface, self.name))
# get slice's hrn from options
self.api.logger.info("interface: %s\tmethod-name: %s" % (self.api.interface, self.name))
# get slice's hrn from options
origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
# get manager for this interface
manager = self.api.get_interface_manager()
origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
# get manager for this interface
manager = self.api.get_interface_manager()
- rspec = manager.get_rspec(self.api, creds, options)
+ rspec = manager.get_rspec(self.api, creds, options, call_id)
# filter rspec through sfatables
if self.api.interface in ['aggregate']:
# filter rspec through sfatables
if self.api.interface in ['aggregate']: