Add Alarm Service Configuration API 22/13822/2
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Thu, 5 Dec 2024 15:32:04 +0000 (23:32 +0800)
committerZhang Rong(Jon) <rong.zhang@windriver.com>
Tue, 10 Dec 2024 03:34:02 +0000 (11:34 +0800)
commit26e9f039966cdd7bc62b36155cbbd8f883fad8dc
tree5257d052040125f54e8758f958c5be8724799e7a
parent27d022acc2272235192df0bc73061d98c64bb29d
Add Alarm Service Configuration API

This commit introduces support for the GET, PUT, and PATCH methods for
a new API URI.
The API enables clients to query and modify the Alarm Service
Configuration.

Test Plan:
- Query the Alarm Service Configuration and verify it returns the
  default values as expected.
- Use the PUT method to update the Alarm Service Configuration values.
- Use the PATCH method to update the retentionPeriod parameter of the
  Alarm Service Configuration.
- Attempt to update using a value below the minimum allowed threshold
  and confirm it fails as expected.
- Confirm the POST and DELETE methods return a 405 Method Not Allowed
  response as expected.

Issue-ID: INF-482

Change-Id: Id70d6d301ffd6f278b9989a04f45a416fbfad241
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
13 files changed:
configs/o2app.conf
o2app/adapter/unit_of_work.py
o2app/bootstrap.py
o2common/config/config.py
o2ims/adapter/alarm_repository.py
o2ims/adapter/orm.py
o2ims/domain/alarm_obj.py
o2ims/domain/alarm_repo.py
o2ims/views/alarm_dto.py
o2ims/views/alarm_route.py
o2ims/views/alarm_view.py
o2ims/views/api_ns.py
tests/unit/test_alarm.py