X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;ds=inline;f=cmframework%2Fsrc%2Fcmframework%2Futils%2Fcmalarmwork.py;fp=cmframework%2Fsrc%2Fcmframework%2Futils%2Fcmalarmwork.py;h=b5eca06c70da4083b8c527977dfe4918396545b1;hb=c389bdee7b3845b55f443dbf04c0ce4083a55886;hp=0000000000000000000000000000000000000000;hpb=5030f0c004701dd422c78c71c014ef60f48139fc;p=ta%2Fconfig-manager.git diff --git a/cmframework/src/cmframework/utils/cmalarmwork.py b/cmframework/src/cmframework/utils/cmalarmwork.py new file mode 100644 index 0000000..b5eca06 --- /dev/null +++ b/cmframework/src/cmframework/utils/cmalarmwork.py @@ -0,0 +1,47 @@ +# Copyright 2019 Nokia + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +class CMAlarmWork(object): + OPER_RAISE = 1 + OPER_CANCEL = 2 + + OPER_NAMES = ('NONE', 'RAISE', 'CANCEL') + + def __init__(self, operation, alarm_id, dn, supplementary_info): + self.operation = operation + self.alarm_id = alarm_id + self.dn = dn + self.supplementary_info = supplementary_info + + def __str__(self): + return '(%r %r %r %r)' % (self._get_operation_name(), + self.alarm_id, + self.dn, + self.supplementary_info) + + def _get_operation_name(self): + return CMAlarmWork.OPER_NAMES[self.operation] + + def get_operation(self): + return self.operation + + def get_alarm_id(self): + return self.alarm_id + + def get_dn(self): + return self.dn + + def get_supplementary_info(self): + return self.supplementary_info