Policy Cookbook¶
Openstack Heat Installation - Policy VM/Docker Recipes¶
Get the latest images in an already setup policy VM¶1 /opt/policy_vm_init.shInstall/start docker policy containers with no policies preloaded¶1 echo "PRELOAD_POLICIES=false" > /opt/policy/.env 2 /opt/policy_vm_init.shInstall/start docker policy containers with policies preloaded¶1 # This is the current default mode of instantiation. 2 # These operations are unnecessary unless PRELOAD_POLICIES 3 # was previously set to true 4 5 echo "PRELOAD_POLICIES=true" > /opt/policy/.env 6 /opt/policy_vm_init.shAccess the PDP-D container as the policy user¶1 docker exec -it drools bashAccess the PDP-X container as the policy user¶1 docker exec -it -u 0 pdp su - policyAccess the BRMSGW container as the policy user¶1 docker exec -it -u 0 brmsgw su - policyAccess PAP container as the policy user¶1 docker exec -it -u 0 pap su - policyAccess the CONSOLE container the a policy user¶1 docker exec -it -u 0 console su - policyCommand line Healthcheck invokation¶1 source /opt/app/policy/config/feature-healthcheck.conf.environment 2 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" 3 -X GET https://localhost:6969/healthcheck | python -m json.tool
OOM Installation - Policy Kubernetes Recipes¶
List the policy pods¶1 kubectl get pods -n onap -o wide | grep policyAccess the PAP container¶1 kubectl exec -it <pap-pod> -c pap -n onap -- bash --loginAccess a PDPD-D container¶1 # <policy-deployment-prefix> depends on the deployment configuration 2 3 kubectl exec -it <policy-deployment-prefix>-drools-0 -c drools -n onap bashAccess the PDP container¶1 # <policy-deployment-prefix> depends on the deployment configuration 2 3 kubectl exec -it <policy-deployment-prefix>-pdp-0 -c pdp -n onap -- bash --loginPush Default Policies¶1 kubectl exec -it <pap-pod> -c pap -n onap -- bash -c "export PRELOAD_POLICIES=true; /tmp/policy-install/config/push-policies.sh"Standalone Policy Web UI URL access¶1 http://<pap-vm>:30219/onap/login.htm
PDP-D Recipes (inside the “drools” container)¶
Stop the PDP-D¶1 policy stopStart the PDP-D¶1 policy startManual Healthcheck Invokation¶1 source ${POLICY_HOME}/config/feature-healthcheck.conf 2 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" 3 -X GET https://localhost:6969/healthcheck | python -m json.toolStart a telemetry shell¶1 telemetrySee all the configured loggers¶1curl -k --silent --user "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" 2 https://localhost:9696/policy/pdp/engine/tools/loggersSee the logging level for a given logger (for example the network logger):¶1curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" 2 https://localhost:9696/policy/pdp/engine/tools/loggers/networkModify the logging level for a given logger (for example the network logger):¶1curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" 2 -X PUT https://localhost:9696/policy/pdp/engine/tools/loggers/network/WARN
PAP Recipes (inside the “pap” container)¶
Bypass Portal Authentication with the Policy Web UI¶1 sed -i "s/^role_access_centralized.*$/#role_access_centralized=remote/g" /opt/app/policy/servers/console/webapps/onap/WEB-INF/classes/portal.properties 2 cd /opt/app/policy/servers/pap 3 /opt/app/policy/etc/init.d/pap stop; /opt/app/policy/etc/init.d/pap start 4 policy.sh statusAccess the Policy Web UI without going through the Portal UI¶1https://policy.api.simpledemo.onap.org:30219/onap/policy (Kubernetes)
End of Document