return self.driver.describe(urns, rspec_version, options)
- def Status (self, api, urns, options):
+ def Status (self, api, urns, creds, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return {}
return self.driver.status (urns, options=options)
if Callids().already_handled(call_id): return ""
return self.driver.allocate(xrn, creds, rspec_string, options)
- def Provision(self, api, xrns, options):
+ def Provision(self, api, xrns, creds, options):
"""
Create the sliver[s] (slice) at this aggregate.
Verify HRN and initialize the slice record in PLC if necessary.
if Callids().already_handled(call_id): return ""
return self.driver.provision(xrns, creds, options)
- def Delete(self, api, xrns, options):
+ def Delete(self, api, xrns, creds, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return True
return self.driver.delete_sliver (xrns, options)
- def Renew(self, api, xrns, expiration_time, options):
+ def Renew(self, api, xrns, creds, expiration_time, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return True
return self.driver.renew(xrns, expiration_time, options)
- def PerformOperationalAction(self, api, xrns, action, options={}):
+ def PerformOperationalAction(self, api, xrns, creds, action, options={}):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return True
return self.driver.performOperationalAction(xrns, action, options)
- def Shutdown(self, api, xrn, options={}):
+ def Shutdown(self, api, xrn, creds, options={}):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return True
return self.driver.shutdown(xrn, options)
threads.get_results()
return 1
- def stop_slice(self, api, xrn, creds):
- hrn, type = urn_to_hrn(xrn)
-
+ def Shutdown(self, api, xrn, creds, options={}):
+ xrn = Xrn(xrn)
# get the callers hrn
- valid_cred = api.auth.checkCredentials(creds, 'stopslice', hrn)[0]
+ valid_cred = api.auth.checkCredentials(creds, 'stopslice', xrn.hrn)[0]
caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
# attempt to use delegated credential first
continue
interface = api.aggregates[aggregate]
server = api.server_proxy(interface, cred)
- threads.run(server.Stop, xrn, cred)
+ threads.run(server.Shutdown, xrn.urn, cred)
threads.get_results()
return 1
- def reset_slice(self, api, xrn):
- """
- Not implemented
- """
- return 1
-
- def shutdown(self, api, xrn, creds):
- """
- Not implemented
- """
- return 1
-
- def status(self, api, xrn, creds):
- """
- Not implemented
- """
- return 1
-
accepts = [
Parameter([str], "Human readable name of slice to delete (hrn or urn)"),
- Mixed(Parameter(str, "Credential string"),
- Parameter(type([str]), "List of credentials")),
+ Parameter(dict), "Credentials")),
Parameter(dict, "options"),
]
origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, xrns, self.name))
- self.api.manager.Delete(self.api, xrns, options)
+ self.api.manager.Delete(self.api, xrns, creds, options)
return 1
raise InsufficientRights('Renewsliver: Credential expires before requested expiration time')
if requested_time > datetime.datetime.utcnow() + datetime.timedelta(days=max_renew_days):
raise Exception('Cannot renew > %s days from now' % max_renew_days)
- return self.api.manager.Renew(self.api, urns, expiration_time, options)
+ return self.api.manager.Renew(self.api, urns, creds, expiration_time, options)
interfaces = ['aggregate', 'slicemgr']
accepts = [
Parameter(str, "Slice URN"),
- Parameter(type([str]), "List of credentials"),
+ Parameter(type(dict), "Credentials"),
]
returns = Parameter(bool, "Success or Failure")
"""
interfaces = ['aggregate', 'slicemgr', 'component']
accepts = [
- Parameter(str, "Slice URN"),
- Mixed(Parameter(str, "Credential string"),
- Parameter(type([str]), "List of credentials")),
+ Parameter([str], "Slice or sliver URNs"),
+ Parameter(dict), "credentials")),
Parameter(dict, "Options")
]
returns = Parameter(dict, "Status details")
- def call(self, slice_xrn, creds, options):
- hrn, type = urn_to_hrn(slice_xrn)
- valid_creds = self.api.auth.checkCredentials(creds, 'sliverstatus', hrn)
+ def call(self, xrns, creds, options):
+ valid_creds = self.api.auth.checkCredentials(creds, 'sliverstatus', xrns)
- self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, hrn, self.name))
-
- status = self.api.manager.Status(self.api, hrn, valid_creds, options)
-
- return status
+ self.api.logger.info("interface: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, xrns, self.name))
+ return self.api.manager.Status(self.api, xrns, creds, options)