from sfa.util.method import Method
from sfa.util.parameter import Parameter, Mixed
from sfa.util.sfatablesRuntime import run_sfatables
-import sys
from sfa.trust.credential import Credential
-from sfa.util.sfalogging import logger
class CreateSliver(Method):
"""
@param rspec (string) rspec to allocate
"""
- interfaces = ['aggregate', 'slicemgr', 'geni_am']
+ interfaces = ['aggregate', 'slicemgr']
accepts = [
Parameter(str, "Slice URN"),
Mixed(Parameter(str, "Credential string"),
]
returns = Parameter(str, "Allocated RSpec")
-
-
def call(self, slice_xrn, creds, rspec, users):
hrn, type = urn_to_hrn(slice_xrn)
manager = self.api.get_interface_manager()
# flter rspec through sfatables
- if self.api.interface in ['aggregate', 'geni_am']:
- chain_name = 'OUTGOING'
+ if self.api.interface in ['aggregate']:
+ chain_name = 'INCOMING'
elif self.api.interface in ['slicemgr']:
- chain_name = 'FORWARD-OUTGOING'
+ chain_name = 'FORWARD-INCOMING'
rspec = run_sfatables(chain_name, hrn, origin_hrn, rspec)
- allocated = manager.create_slice(self.api, slice_xrn, valid_creds, rspec, users)
- if allocated:
- return rspec
+ allocated = manager.create_slice(self.api, slice_xrn, creds, rspec, users)
- return ''
-
+ return rspec