git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed sfaticket from util/ to trust/
[sfa.git]
/
sfa
/
managers
/
component_manager_pl.py
diff --git
a/sfa/managers/component_manager_pl.py
b/sfa/managers/component_manager_pl.py
index
c26ca4d
..
ec5e24c
100644
(file)
--- a/
sfa/managers/component_manager_pl.py
+++ b/
sfa/managers/component_manager_pl.py
@@
-1,8
+1,14
@@
import os
import xmlrpclib
import os
import xmlrpclib
+
from sfa.util.faults import *
from sfa.util.faults import *
-from sfa.util.namespace import *
-from sfa.util.sfaticket import SfaTicket
+from sfa.util.plxrn import PlXrn
+from sfa.trust.sfaticket import SfaTicket
+from sfa.util.version import version_core
+
+def GetVersion(api):
+ return version_core({'interface':'component',
+ 'testbed':'myplc'})
def init_server():
from sfa.server import sfa_component_setup
def init_server():
from sfa.server import sfa_component_setup
@@
-15,12
+21,7
@@
def init_server():
sfa_component_setup.get_credential(force=True)
sfa_component_setup.get_trusted_certs()
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):
+def SliverStatus(api, slice_xrn, creds):
result = {}
result['geni_urn'] = slice_xrn
result['geni_status'] = 'unknown'
result = {}
result['geni_urn'] = slice_xrn
result['geni_status'] = 'unknown'
@@
-28,28
+29,25
@@
def slice_status(api, slice_xrn, creds):
return result
def start_slice(api, xrn, creds):
return result
def start_slice(api, xrn, creds):
- hrn, type = urn_to_hrn(xrn)
- slicename = hrn_to_pl_slicename(hrn)
+ slicename = PlXrn(xrn, type='slice').pl_slicename()
api.nodemanger.Start(slicename)
def stop_slice(api, xrn, creds):
api.nodemanger.Start(slicename)
def stop_slice(api, xrn, creds):
- hrn, type = urn_to_hrn(xrn)
- slicename = hrn_to_pl_slicename(hrn)
+ slicename = PlXrn(xrn, type='slice').pl_slicename()
api.nodemanager.Stop(slicename)
api.nodemanager.Stop(slicename)
-def delete_slice(api, xrn, creds):
- hrn, type = urn_to_hrn(xrn)
- slicename = hrn_to_pl_slicename(hrn)
+def DeleteSliver(api, xrn, creds, call_id):
+ slicename = PlXrn(xrn, type='slice').pl_slicename()
api.nodemanager.Destroy(slicename)
def reset_slice(api, xrn):
api.nodemanager.Destroy(slicename)
def reset_slice(api, xrn):
- hrn, type = urn_to_hrn(xrn)
- slicename = hrn_to_pl_slicename(hrn)
+ slicename = PlXrn(xrn, type='slice').pl_slicename()
if not api.sliver_exists(slicename):
raise SliverDoesNotExist(slicename)
api.nodemanager.ReCreate(slicename)
if not api.sliver_exists(slicename):
raise SliverDoesNotExist(slicename)
api.nodemanager.ReCreate(slicename)
-def get_slices(api):
+# xxx outdated - this should accept a credential & call_id
+def ListSlices(api):
# 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
# 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
@@
-62,7
+60,7
@@
def redeem_ticket(api, ticket_string):
ticket = SfaTicket(string=ticket_string)
ticket.decode()
hrn = ticket.attributes['slivers'][0]['hrn']
ticket = SfaTicket(string=ticket_string)
ticket.decode()
hrn = ticket.attributes['slivers'][0]['hrn']
- slicename =
hrn_to_pl_slicename(hrn
)
+ slicename =
PlXrn (hrn).pl_slicename(
)
if not api.sliver_exists(slicename):
raise SliverDoesNotExist(slicename)
if not api.sliver_exists(slicename):
raise SliverDoesNotExist(slicename)