Policy Cookbook¶
Openstack Heat Installation - Policy VM/Docker Recipes¶
1 /opt/policy_vm_init.sh
1 echo "PRELOAD_POLICIES=false" > /opt/policy/.env 2 /opt/policy_vm_init.sh1 # 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.sh1 docker exec -it drools bash1 docker exec -it -u 0 pdp su - policy1 docker exec -it -u 0 brmsgw su - policy1 docker exec -it -u 0 pap su - policy1 docker exec -it -u 0 console su - policy1 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¶
1 kubectl get pods -n onap -o wide | grep policy1 kubectl exec -it <pap-pod> -c pap -n onap -- bash --login1 # <policy-deployment-prefix> depends on the deployment configuration 2 3 kubectl exec -it <policy-deployment-prefix>-drools-0 -c drools -n onap bash1 # <policy-deployment-prefix> depends on the deployment configuration 2 3 kubectl exec -it <policy-deployment-prefix>-pdp-0 -c pdp -n onap -- bash --login1 kubectl exec -it <pap-pod> -c pap -n onap -- bash -c "export PRELOAD_POLICIES=true; /tmp/policy-install/config/push-policies.sh"1 http://<pap-vm>:30219/onap/login.htm
PDP-D Recipes (inside the “drools” container)¶
1 policy stop
1 policy start
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.tool1 telemetry
1curl -k --silent --user "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" 2 https://localhost:9696/policy/pdp/engine/tools/loggers1curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" 2 https://localhost:9696/policy/pdp/engine/tools/loggers/network1curl -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)¶
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 status1https://policy.api.simpledemo.onap.org:30219/onap/policy (Kubernetes)
End of Document