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
Merge branch 'nocomponent' into geni-v3
[sfa.git]
/
sfa
/
methods
/
Delete.py
diff --git
a/sfa/methods/Delete.py
b/sfa/methods/Delete.py
index
74ff838
..
dd594c6
100644
(file)
--- a/
sfa/methods/Delete.py
+++ b/
sfa/methods/Delete.py
@@
-1,33
+1,41
@@
from sfa.util.xrn import urn_to_hrn
from sfa.util.method import Method
from sfa.util.xrn import urn_to_hrn
from sfa.util.method import Method
+from sfa.util.sfalogging import logger
+
from sfa.storage.parameter import Parameter, Mixed
from sfa.trust.auth import Auth
from sfa.trust.credential import Credential
from sfa.storage.parameter import Parameter, Mixed
from sfa.trust.auth import Auth
from sfa.trust.credential import Credential
+
class Delete(Method):
"""
class Delete(Method):
"""
- Remove the slice or slivers and free the allocated resources
+ Remove the slice or slivers and free the allocated resources
@param xrns human readable name of slice to instantiate (hrn or urn)
@param creds credential string specifying the rights of the caller
@param xrns human readable name of slice to instantiate (hrn or urn)
@param creds credential string specifying the rights of the caller
- @return 1 is successful, faults otherwise
+ @return 1 is successful, faults otherwise
"""
"""
- interfaces = ['aggregate'
, 'slicemgr', 'component'
]
-
+ interfaces = ['aggregate']
+
accepts = [
accepts = [
- Parameter(type([str]), "Human readable name of slice to delete (hrn or urn)"),
- Parameter(dict, "Credentials"),
+ Parameter(
+ type([str]), "Human readable name of slice to delete (hrn or urn)"),
+ Parameter(type([dict]), "Credentials"),
Parameter(dict, "options"),
Parameter(dict, "options"),
-
]
+ ]
returns = Parameter(int, "1 if successful")
returns = Parameter(int, "1 if successful")
-
+
def call(self, xrns, creds, options):
def call(self, xrns, creds, options):
- valid_creds = self.api.auth.checkCredentials(creds, 'deletesliver', xrns)
+ valid_creds = self.api.auth.checkCredentialsSpeaksFor(
+ creds, 'deletesliver', xrns,
+ check_sliver_callback=self.api.driver.check_sliver_credentials,
+ options=options)
- #log the call
- 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))
+ # log the call
+ origin_hrn = Credential(cred=valid_creds[0]).get_gid_caller().get_hrn()
+ logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" %
+ (self.api.interface, origin_hrn, xrns, self.name))
return self.api.manager.Delete(self.api, xrns, creds, options)
return self.api.manager.Delete(self.api, xrns, creds, options)