fault/fm-rest-api/fm
Joao Victor Portal 7fd26e0d15 Fault Management API request audit logging
Here is added a hook to the WSGI compliant Pecan server that receives
the Fault Management API requests. This hook logs the needed request
data to "/var/log/fm-api.log". All requests are logged except the
ones of "GET" type.

The code is a port from the same hook that exists in
"starlingx/config" repository, also called "AuditLogging".

Note: there are no "POST" or "PUT" requests available in Fault
Management API v1.

Test Plan:

PASS: Successfully deploy an AIO-SX and verify that the logs of
"fm-api" service are present in file "/var/log/fm-api.log".
PASS: In the deployed AIO-SX, execute command "fm alarm-list" and
check that no GET requests was logged in "fm-api.log".
PASS: In the deployed AIO-SX, execute command "fm alarm-delete 1111"
and check that a "DELETE /v1/alarms/1111" request was logged in
"fm-api.log" with status "404".
PASS: In the deployed AIO-SX, execute command
"fm event-suppress --alarm_id <alarm_id>" and check that a
"PATCH /v1/event_suppression/<uuid>" request was logged in
"fm-api.log" with status "200".
PASS: Successfully build all packages of this repository as Debian
packages: fm-api, fm-common, fm-doc, fm-mgr, fm-rest-api and
python-fmclient.

Story: 2009824
Task: 44468

Depends-On: https://review.opendev.org/c/starlingx/config-files/+/828200
Signed-off-by: Joao Victor Portal <Joao.VictorPortal@windriver.com>
Change-Id: I25bf662ed9e792b30ae1f90329bd35b918f0a5f7
2022-02-18 00:39:43 -03:00
..
fm Fault Management API request audit logging 2022-02-18 00:39:43 -03:00
scripts Fault Management API request audit logging 2022-02-18 00:39:43 -03:00
.coveragerc Adding a tox coverage target for fm-rest-api. 2020-02-20 15:52:05 -06:00
.stestr.conf Create test framework for python with stestr. 2020-01-16 16:45:45 +08:00
LICENSE fm-rest-api: Fix LICENSE Permissions 2019-06-13 10:25:41 -07:00
fm-api-pmond.conf Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
requirements.txt [DevStack] WSME doesn't always get installed, force it 2019-04-02 23:27:27 +00:00
setup.cfg Decouple Fault Management from stx-config 2018-08-16 13:23:33 -04:00
setup.py add migrate.cfg to wheel package to install image 2019-05-02 07:58:58 +08:00
test-requirements.txt Merge "py3: Add support for python 3.9" 2021-09-09 13:30:22 +00:00
tox.ini Add debian package infra for fm-api 2021-09-27 12:53:01 -04:00