mktime should be time.mktime
[sfa.git] / sfa / managers / component_manager_pl.py
index 2e1b3c3..c26ca4d 100644 (file)
@@ -14,18 +14,30 @@ def init_server():
         sfa_component_setup.get_node_key()
         sfa_component_setup.get_credential(force=True)
         sfa_component_setup.get_trusted_certs()
+
+def get_version():
+    version = {}
+    version['geni_api'] = 1
+    return version
+
+def slice_status(api, slice_xrn, creds):
+    result = {}
+    result['geni_urn'] = slice_xrn
+    result['geni_status'] = 'unknown'
+    result['geni_resources'] = {}
+    return result
            
-def start_slice(api, xrn):
+def start_slice(api, xrn, creds):
     hrn, type = urn_to_hrn(xrn)
     slicename = hrn_to_pl_slicename(hrn)
     api.nodemanger.Start(slicename)
 
-def stop_slice(api, xrn):
+def stop_slice(api, xrn, creds):
     hrn, type = urn_to_hrn(xrn)
     slicename = hrn_to_pl_slicename(hrn)
     api.nodemanager.Stop(slicename)
 
-def delete_slice(api, xrn):
+def delete_slice(api, xrn, creds):
     hrn, type = urn_to_hrn(xrn)
     slicename = hrn_to_pl_slicename(hrn)
     api.nodemanager.Destroy(slicename)
@@ -38,11 +50,13 @@ def reset_slice(api, xrn):
     api.nodemanager.ReCreate(slicename)
  
 def get_slices(api):
-    slicenames = api.nodemanager.GetXIDs().keys()
-    return slicenames
-
-def roboot():
-    os.system("/sbin/reboot")        
+    # this returns a tuple, the data we want is at index 1 
+    xids = api.nodemanager.GetXIDs()
+    # unfortunately the data we want is given to us as 
+    # a string but we really want it as a dict
+    # lets eval it
+    slices = eval(xids[1])
+    return slices.keys()
 
 def redeem_ticket(api, ticket_string):
     ticket = SfaTicket(string=ticket_string)