Add the PATCH method for the monitoring API 98/12898/7
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Thu, 25 Apr 2024 15:12:19 +0000 (23:12 +0800)
committerZhang Rong(Jon) <rong.zhang@windriver.com>
Sat, 25 May 2024 06:43:47 +0000 (14:43 +0800)
commit54ca64640ce149364fcfa91666c01edfe5c02e72
treea746a512af8a827875ae13580ad8d5e658f53549
parent874ff786f1180878d74de7c4d85034247703112b
Add the PATCH method for the monitoring API

In the specification release R003-v05.00, a new API has been
added to the monitoring interface, which is an acknowledge/clear
operation for the alarm event.

This commit implements the O2IMS API to support SMO's requests of
alarm event acknowledgment or clearing.
The acknowledge operation will update the alarmEventRecord object,
mark the acknowledged field as True.
The clear operation will call the fault client asynchronously to
delete the alarm of the O-Cloud.

Test Plan:
1. Request the API to acknowledge/clear the alarm.
2. Request with both "alarmAcknowledged" and "perceivedSeverity"
   attribute failed since it only supports one, not both.
3. Request with "perceivedSeverity" only support "5" as expected
   which is "CLEARED".
4. After SMO requests the alarm clear to IMS via IMS monitoring API,
   FM(Fault Management) client is requested to delete the alarm
   from the O-Cloud.

Issue-ID: INF-449

Change-Id: I71419a9d467687d6708bfd3e9cd201dbce5e36c5
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
13 files changed:
o2app/entrypoints/redis_eventconsumer.py
o2app/service/handlers.py
o2ims/adapter/alarm_repository.py
o2ims/adapter/clients/fault_client.py
o2ims/domain/alarm_obj.py
o2ims/domain/commands.py
o2ims/domain/events.py
o2ims/service/command/purge_alarm_handler.py [new file with mode: 0644]
o2ims/service/event/alarm_event.py
o2ims/views/alarm_dto.py
o2ims/views/alarm_route.py
o2ims/views/alarm_view.py
tests/conftest.py