1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
5 from PLC.Auth import Auth
7 class DeleteSliceAttributeType(Method):
9 Deletes the specified slice attribute.
11 Returns 1 if successful, faults otherwise.
18 Mixed(SliceAttributeType.fields['attribute_type_id'],
19 SliceAttributeType.fields['name']),
22 returns = Parameter(int, '1 if successful')
25 def call(self, auth, attribute_type_id_or_name):
26 attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
27 if not attribute_types:
28 raise PLCInvalidArgument, "No such slice attribute type"
29 attribute_type = attribute_types[0]
31 attribute_type.delete()
32 self.event_objects = {'AttributeType': [attribute_type['attribute_type_id']]}