+ # xxx - fixme
+ (ret, output) = call_am_apiclient("GetResourceTopology", ['all', slice_id,], 5)
+ # parse output into rspec XML
+ if output.find("No resouce found") > 0:
+ rspec = "<RSpec type=\"SFA\"> <Fault>No resource found</Fault> </RSpec>"
+ else:
+ comp_rspec = get_xml_by_tag(output, 'computeResource')
+ sfa_logger().debug("#### computeResource %s" % comp_rspec)
+ topo_rspec = get_xml_by_tag(output, 'topology')
+ sfa_logger().debug("#### topology %s" % topo_rspec)
+ rspec = "<RSpec type=\"SFA\"> <network name=\"" + Config().get_interface_hrn() + "\">";
+ if comp_rspec != None:
+ rspec = rspec + get_xml_by_tag(output, 'computeResource')
+ if topo_rspec != None:
+ rspec = rspec + get_xml_by_tag(output, 'topology')
+ rspec = rspec + "</network> </RSpec>"
+
+ return (rspec)
+
+def start_slice(api, xrn, cred):
+ # service not supported
+ return None
+
+def stop_slice(api, xrn, cred):
+ # service not supported
+ return None
+
+def reset_slices(api, xrn):
+ # service not supported
+ 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):
+ base_context = {'sfa':{'user':{'hrn':user_hrn}}}
+ return base_context