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 object_type = 'SliceAttributeType'
27 def call(self, auth, attribute_type_id_or_name):
28 attribute_types = SliceAttributeTypes(self.api, [attribute_type_id_or_name])
29 if not attribute_types:
30 raise PLCInvalidArgument, "No such slice attribute type"
31 attribute_type = attribute_types[0]
33 attribute_type.delete()
34 self.object_ids = [attribute_type['attribute_type_id']]