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')
24 def call(self, auth, attribute_type_id_or_name):
25 attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name]).values()
26 if not attribute_types:
27 raise PLCInvalidArgument, "No such slice attribute type"
28 attribute_type = attribute_types[0]
30 attribute_type.delete()