from sfa.util.sfalogging import logger
from sfa.util.defaultdict import defaultdict
from sfa.util.sfatime import utcparse, datetime_to_string, datetime_to_epoch
-from sfa.util.xrn import hrn_to_urn, get_leaf, urn_to_sliver_id
+from sfa.util.xrn import hrn_to_urn, get_leaf
from sfa.util.cache import Cache
# one would think the driver should not need to mess with the SFA db, but..
# first 2 args are None in case of resource discovery
def list_resources (self, creds, options):
aggregate = PlAggregate(self)
- rspec = aggregate.get_rspec(version=rspec_version, options=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 sliver_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)
if node['last_contact'] is not None:
res['pl_last_contact'] = datetime_to_string(utcparse(node['last_contact']))
- sliver_id = urn_to_sliver_id(slice_urn, slice['slice_id'], node['node_id'], authority=self.hrn)
- res['geni_urn'] = sliver_id
+ sliver_id = "%s:%s" % (slice['slice_id'], node['node_id'])
+ sliver_xrn = Xrn(slice_urn, id = sliver_id)
+ sliver_xrn.set_authority(self.hrn)
+ res['geni_urn'] = sliver_xrn.get_urn()
if node['boot_state'] == 'boot':
res['geni_status'] = 'ready'
else:
# only used by plc and ple.
slices.handle_peer(site, slice, persons, peer)
- return aggregate.get_rspec(slice_xrn=slice_urn, version=rspec.version)
+ return aggregate.describe_rspec(slice_xrn=slice_urn, version=rspec.version)
def delete_sliver (self, slice_urn, slice_hrn, creds, options):
slicename = hrn_to_pl_slicename(slice_hrn)