3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 class CMAlarmWork(object):
20 OPER_NAMES = ('NONE', 'RAISE', 'CANCEL')
22 def __init__(self, operation, alarm_id, dn, supplementary_info):
23 self.operation = operation
24 self.alarm_id = alarm_id
26 self.supplementary_info = supplementary_info
29 return '(%r %r %r %r)' % (self._get_operation_name(),
32 self.supplementary_info)
34 def _get_operation_name(self):
35 return CMAlarmWork.OPER_NAMES[self.operation]
37 def get_operation(self):
40 def get_alarm_id(self):
46 def get_supplementary_info(self):
47 return self.supplementary_info