Versions Compared

Key

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

...

  1. Periodically check policy (e.g. every 20 minutes) to see if there have been any changes that were not received over the dmaap
  2. If either a matching dmaap notification arrives or the periodic check reveals updates, it will pull the latest policies from the PDP using the rest api and dump them to a file for consumption by the microservice.


Drawio
bordertrue
viewerToolbardiagramNametrueUntitled Diagram
fitWindowsimpleViewerfalse
diagramNamePolicy sync container
simpleViewerfalse
widthwidth
linksauto
tbstyletop
lboxtrue
diagramWidth361
revision51

Configuration

configuration is done via environment variables to support varied environments easily. 

ENV_VARIABLE

flag

Description

Example

POLICY_SYNC_PDP_URL--pdpPDP URL to queryhttps://policy-conexus-ist-02.ecomp.cci.att.com:30281
POLICY_SYNC_FILTER--filter

A regular expression or full policy name that the puller should track and query the PDP

DCAE.Config_MS_AGING_UVERSE_.*
POLICY_SYNC_ID--idThis just brings back a specific policy name for those who don't need or want a regular expression.XYZ
POLICY_SYNC_OUTFILE--outfileThe output file to write the policy inventory to/opt/etc/policies.json
POLICY_SYNC_CHECKINTERVAL--checkintervalHow often to check the PDP periodically for resiliency purposes20m
POLICY_SYNC_USER--userOptional Username to use as part of basic auth for the PDPuserxyz
POLICY_SYNC_PASS--passwordOptional Password to use as part of basic auth for the PDPpassword123

Interface with Policy

Sidecar to use ONAP's policy API to interface and retrieve policies as described: Policy Life Cycle API — onap master documentation

GET /policy/api/v1/policies (For Policy Filter based queries). 

Note: Current policy API does not offer regex based querying...so the only way to implement this is to pull all policies and filter accordingly on client side. 

Retrieve all versions of available policies

  • Description: Returns all version of available policies
  • Consumes: [‘application/json’, ‘application/yaml’]
  • Produces: [‘application/json’, ‘application/yaml’]


Parameters

NamePositionDescriptionType
X-ONAP-RequestIDheaderRequestID for http transactionstring
modequeryFetch mode for policies, BARE for bare policies (default), REFERENCED for fully referenced policiesstring


Responses

200 - successful operation

401 - Authentication Error

403 - Authorization Error

404 - Resource Not Found

500 - Internal Server Error


GET /policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/latest (For policy id based queries). 

Retrieve the latest version of a particular policy

  • Description: Returns the latest version of specified policy
  • Produces: [‘application/json’, ‘application/yaml’]


Parameters

NamePositionDescriptionType
policyTypeIdpathID of policy typestring
policyTypeVersionpathVersion of policy typestring
policyIdpathID of policystring
X-ONAP-RequestIDheaderRequestID for http transactionstring


Responses

200 - successful operation; Latest version of specified policy matching specified policy type will be returned.

401 - Authentication Error

403 - Authorization Error

404 - Resource Not Found

500 - Internal Server Error

DMaaP Notifications

Utilize the PAP's DMaaP Notification URL to identify changes to policy and act accordingly: https://docs.onap.org/projects/onap-policy-parent/en/latest/pap/pap.html#dmaap-api

...