1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Attributes import Attribute, Attributes
5 from PLC.Auth import PasswordAuth
7 class DeleteAttribute(Method):
9 Deletes the specified slice attribute.
11 Returns 1 if successful, faults otherwise.
18 Mixed(Attribute.fields['attribute_id'],
19 Attribute.fields['name']),
22 returns = Parameter(int, '1 if successful')
24 def call(self, auth, attribute_id_or_name):
25 attributes = Attributes(self.api, [attribute_id_or_name]).values()
27 raise PLCInvalidArgument, "No such attribute"
28 attribute = attributes[0]