Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This activity has been put on hold due to the reprioritization of resources. We have documented the steps we have taken so far here, for those that may want to continue this work.

Python POC Notes


This place is to document the development of the Python POC for Security Logging.

...

  1. Create a new repository for Python Logging Library
    1. You should create a ticket on LF IT Jira to create a new repository Project Support Services | Help Center (linuxfoundation.org)
  2. Create a Security Logging Python library and commit to an ONAP gerrit repository
    1. https://gerrit.onap.org
  3. Make the it available to install using pip from ONAP’s nexus
    1. I don’t know any working example of using ONAP nexus as a pip index, but for sure LF can also support on that.
    2. I think that this is the Nexus repo Michal refers to: https://nexus3.onap.org/#browse/search/pypi
  4. Integration Team (PTL Michal) will create a version of base Python image with Logging Python Library
  5. DCAE Team (PTL Vijay and Tony Hansen) will provide DCAE Integration Validation

...

Technical Approach

ONAP Related Resources

...

ONAP Related Resources

DCAE Python Based Modules


pylog (onaplogging module)

- https://git.onap.org/logging-analytics/tree/pylog/onaplogging

Interesting Functions

There is an interesting function in https://github.com/onap/dcaegen2-services/blob/master/components/pm-subscription-handler/pmsh_service/mod/__init__.py lines 39 - 50

def mdc_handler(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        request_id = str(uuid.uuid1())
        invocation_id = str(uuid.uuid1())
        MDC.put('ServiceName', getenv('HOSTNAME'))
        MDC.put('RequestID', request_id)
        MDC.put('InvocationID', invocation_id)

        kwargs['request_id'] = request_id
        kwargs['invocation_id'] = invocation_id
        return func(*args, **kwargs)