call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
- # get the rspec's return format from options
version_manager = VersionManager()
rspec_version = version_manager.get_version(options.get('geni_rspec_version'))
- return self.driver.describe(creds, urns, rspec, options)
+ return self.driver.describe(creds, urns, rspec_version, options)
- def SliverStatus (self, api, xrn, creds, options):
+ def Status (self, api, urns, creds, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return {}
-
- xrn = Xrn(xrn,'slice')
- slice_urn=xrn.get_urn()
- slice_hrn=xrn.get_hrn()
- return self.driver.sliver_status (slice_urn, slice_hrn)
+ return self.driver.status (urns, options=options)
def CreateSliver(self, api, xrn, creds, rspec_string, users, options):
"""
origin_hrn = options.get('origin_hrn', None)
if not origin_hrn:
origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
- rspec = self.api.manager.ListResources(self.api, creds, options)
+ desc = self.api.manager.Describe(self.api, creds, urns, options)
# filter rspec through sfatables
if self.api.interface in ['aggregate']:
elif self.api.interface in ['slicemgr']:
chain_name = 'FORWARD-OUTGOING'
self.api.logger.debug("ListResources: sfatables on chain %s"%chain_name)
- filtered_rspec = run_sfatables(chain_name, '', origin_hrn, rspec)
+ desc['geni_rspec'] = run_sfatables(chain_name, '', origin_hrn, desc['geni_rspec'])
if options.has_key('geni_compressed') and options['geni_compressed'] == True:
- filtered_rspec = zlib.compress(filtered_rspec).encode('base64')
+ desc['geni_rspec'] = zlib.compress(desc['geni_rspec']).encode('base64')
- return filtered_rspec
+ return desc
aggregate = OSAggregate(self)
return aggregate.describe(urns, version=version, options=options)
- def status (self, urns):
+ def status (self, urns, options={}):
aggregate = OSAggregate(self)
- desc = aggregate.describe(urns, version=version, options=options)
+ desc = aggregate.describe(urns)
return desc['geni_slivers']
def create_sliver (self, slice_urn, slice_hrn, creds, rspec_string, users, options):
rspec = aggregate.list_resources(version=rspec_version, options=options)
return rspec
- def describe(self, creds, urns, options):
- return {}
+ def describe(self, creds, urns, version, options):
+ aggregate = PlAggregate(self)
+ return aggregate.describe(urns, version=version, options=options)
- def status (self, slice_urn, slice_hrn):
+ def status (self, urns, options={}):
+ aggregate = PlAggregate(self)
+ desc = aggregate.describe(urns)
+ return desc['geni_slivers']
+
# find out where this slice is currently running
slicename = hrn_to_pl_slicename(slice_hrn)