- POLICY-2899Getting issue details... STATUS
Summary:
Develop a solution for storing information when policies are deployed or undeployed through the PAP deploy APIs.
What will this be used for?
For checking when policies were deployed or undeployed - mostly for this action as it deletes the policy - and these changes are not tracked anywhere.
Endpoints used for deploy/undeploy:
- https://docs.onap.org/projects/onap-policy-parent/en/latest/pap/pap.html#Deployments%20Update
- https://docs.onap.org/projects/onap-policy-parent/en/latest/pap/pap.html#Deploy%20Policy
- https://docs.onap.org/projects/onap-policy-parent/en/latest/pap/pap.html#Undeploy%20Policy
Ongoing proposal:
models:
Have a new entity/table for storing the policy (name and version), pdp group and type, action (DEPLOYMENT/UNDEPLOYMENT) and timestamp of action.
- User is also added on this for future reference when policy can have more users to access the services.
Have dao methods for creating and retrieving row(s) from aforementioned table.
Questions on models changes:
How many records could this return? may want to force a limit on the record count and maximum time window. may want to require starting timestamp
what sort of filters should be allowed? pdpGroup, policy name and version and a timestamp limit (until that timestamp).
even with the timestamp, should we have a record limit? what number would be appropriate?
could it also be a filter? have specified a default limit (i.e 50 records) but can be informed on usage.
wonder if we could use a different term than "Tracker"? That term is already used within PAP with a different meaning
suggestions: PdpPolicyDeploymentAudit or PdpDeploymentAudit
policy-pap:
have the endpoints for deploy/undeploy updated with the call for storing the process for tracking.
Possibly have methods for creating a track object for each deploy/undeploy on /pap-main/src/main/java/org/onap/policy/pap/main/rest/SessionData.java
- there are two methods - trackDeploy and trackUndeploy - where the call for new method(s) would be added
- have a map list of trackers (similar to create/update groups)
- the new method(s) would create a track object and add to a trackMap for when the updateDb method is called
have a new endpoint to get the audit on policy (need to confirm which fields would be used for filter - assuming pdp group or policy name/version, and begin/end times)