X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Fdriver.py;h=17358cfc17286d1f3ca9b476606ea3b9b0254ea2;hb=02a4a59a4a49183ec8c631cc03243b97f4602d50;hp=ae2b6248985d34fb1d6b693b6106814efc4eeaeb;hpb=e6ac86e7b51322c1f6ec3bc1f952252d28ebfe41;p=sfa.git diff --git a/sfa/managers/driver.py b/sfa/managers/driver.py index ae2b6248..17358cfc 100644 --- a/sfa/managers/driver.py +++ b/sfa/managers/driver.py @@ -2,7 +2,7 @@ # an attempt to document what a driver class should provide, # and implement reasonable defaults # - +import sys class Driver: def __init__ (self, config): @@ -29,6 +29,7 @@ class Driver: # this constraint, based on the principle that SFA should not rely on the # testbed database to perform such a core operation (i.e. getting rights right) def augment_records_with_testbed_info (self, sfa_records): + print >>sys.stderr, " \r\n \r\n DRIVER.PY augment_records_with_testbed_info sfa_records ",sfa_records return sfa_records # incoming record, as provided by the client to the Register API call @@ -71,6 +72,16 @@ class Driver: # 'geni_request_rspec_versions' and 'geni_ad_rspec_versions' are mandatory def aggregate_version (self): return {} + # the answer to ListSlices, a list of slice urns + def list_slices (self, creds, options): + return [] + + # answer to ListResources + # first 2 args are None in case of resource discovery + # expected : rspec (xml string) + def list_resources (self, slice_urn, slice_hrn, creds, options): + return "dummy Driver.list_resources needs to be redefined" + # the answer to SliverStatus on a given slice def sliver_status (self, slice_urn, slice_hrn): return {} @@ -80,9 +91,27 @@ class Driver: def create_sliver (self, slice_urn, slice_hrn, creds, rspec_string, users, options): return "dummy Driver.create_sliver needs to be redefined" + # the answer to DeleteSliver on a given slice + def delete_sliver (self, slice_urn, slice_hrn, creds, options): + return "dummy Driver.delete_sliver needs to be redefined" + # the answer to RenewSliver # expected to return a boolean to indicate success def renew_sliver (self, slice_urn, slice_hrn, creds, expiration_time, options): return False - - + + # the answer to start_slice/stop_slice + # 1 means success, otherwise raise exception + def start_slice (self, slice_urn, slice_xrn, creds): + return 1 + def stop_slice (self, slice_urn, slice_xrn, creds): + return 1 + # somehow this one does not have creds - not implemented in PL anyways + def reset_slice (self, slice_urn, slice_xrn, creds): + return 1 + + # the answer to GetTicket + # expected is a ticket, i.e. a certificate, as a string + def get_ticket (self, slice_urn, slice_xrn, creds, rspec, options): + return "dummy Driver.get_ticket needs to be redefined" +