X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docs%2Fplatform%2Fcookbook.rst;h=0a834b40acd2edee70f5e990c04918534d51fc9a;hb=ffd7241c7bfa8d8b68b504406fc6ed4cc299ffe6;hp=a93f66be8a0c494b34c4ad0ddb033f35e9f0b385;hpb=e53bd66cc71fcc3f7dff762054790c382d7dd499;p=policy%2Fengine.git diff --git a/docs/platform/cookbook.rst b/docs/platform/cookbook.rst index a93f66be8..0a834b40a 100644 --- a/docs/platform/cookbook.rst +++ b/docs/platform/cookbook.rst @@ -2,15 +2,15 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 -******************************* -Policy Cookbook |cookbooklogo| -******************************* +*************** +Policy Cookbook +*************** -Policy VM/Docker Recipes -^^^^^^^^^^^^^^^^^^^^^^^^ +Openstack Heat Installation - Policy VM/Docker Recipes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash - :caption: Get latest images in an already setup policy VM + :caption: Get the latest images in an already setup policy VM :linenos: /opt/policy_vm_init.sh @@ -31,60 +31,106 @@ Policy VM/Docker Recipes # This is the current default mode of instantiation. # These operations are unnecessary unless PRELOAD_POLICIES # was previously set to true - + echo "PRELOAD_POLICIES=true" > /opt/policy/.env /opt/policy_vm_init.sh .. code-block:: bash - :caption: Access the PDP-D container as a policy user + :caption: Access the PDP-D container as the policy user :linenos: docker exec -it drools bash .. code-block:: bash - :caption: Access the PDP-X container as a policy user + :caption: Access the PDP-X container as the policy user :linenos: docker exec -it -u 0 pdp su - policy .. code-block:: bash - :caption: Access the BRMSGW container as a policy user + :caption: Access the BRMSGW container as the policy user :linenos: docker exec -it -u 0 brmsgw su - policy .. code-block:: bash - :caption: Access PAP container as a policy user + :caption: Access PAP container as the policy user :linenos: docker exec -it -u 0 pap su - policy .. code-block:: bash - :caption: Access the CONSOLE container as a policy user + :caption: Access the CONSOLE container the a policy user :linenos: docker exec -it -u 0 console su - policy .. code-block:: bash - :caption: Manual Healthcheck invokation + :caption: Command line Healthcheck invokation :linenos: - # Assuming the healthcheck service credentials have not been changed - # post-installation within the drools container - source /opt/app/policy/config/feature-healthcheck.conf.environment - curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" - -X GET http://localhost:6969/healthcheck | python -m json.tool + curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" + -X GET https://localhost:6969/healthcheck | python -m json.tool + + +OOM Installation - Policy Kubernetes Recipes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + .. code-block:: bash + :caption: List the policy pods + :linenos: + + kubectl get pods -n onap -o wide | grep policy + + + .. code-block:: bash + :caption: Access the PAP container + :linenos: + + kubectl exec -it -c pap -n onap -- bash --login + + + .. code-block:: bash + :caption: Access a PDPD-D container + :linenos: + # depends on the deployment configuration + + kubectl exec -it -drools-0 -c drools -n onap bash + + + .. code-block:: bash + :caption: Access the PDP container + :linenos: + + # depends on the deployment configuration + + kubectl exec -it -pdp-0 -c pdp -n onap -- bash --login + + + .. code-block:: bash + :caption: Push Default Policies + :linenos: + + kubectl exec -it -c pap -n onap -- bash -c "export PRELOAD_POLICIES=true; /tmp/policy-install/config/push-policies.sh" -PDP-D Recipes ("drools" container) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + .. code-block:: bash + :caption: Standalone Policy Web UI URL access + :linenos: + + http://:30219/onap/login.htm + + +PDP-D Recipes (inside the "drools" container) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash :caption: Stop the PDP-D @@ -104,21 +150,61 @@ PDP-D Recipes ("drools" container) :caption: Manual Healthcheck Invokation :linenos: - # Assuming the healthcheck service credentials have not been changed - # post-installation within the drools container - source ${POLICY_HOME}/config/feature-healthcheck.conf - curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" - -X GET http://localhost:6969/healthcheck | python -m json.tool + curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" + -X GET https://localhost:6969/healthcheck | python -m json.tool + + + .. code-block:: bash + :caption: Start a telemetry shell + :linenos: + + telemetry + + + .. code-block:: bash + :caption: See all the configured loggers + :linenos: + + curl -k --silent --user "${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" + https://localhost:9696/policy/pdp/engine/tools/loggers + + + .. code-block:: bash + :caption: See the logging level for a given logger (for example the network logger): + :linenos: + curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" + https://localhost:9696/policy/pdp/engine/tools/loggers/network + + + .. code-block:: bash + :caption: Modify the logging level for a given logger (for example the network logger): + :linenos: + + curl -k --silent --user"${ENGINE_MANAGEMENT_USER}:${ENGINE_MANAGEMENT_PASSWORD}" + -X PUT https://localhost:9696/policy/pdp/engine/tools/loggers/network/WARN + + +PAP Recipes (inside the "pap" container) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + .. code-block:: bash + :caption: Bypass Portal Authentication with the Policy Web UI + :linenos: + + sed -i "s/^role_access_centralized.*$/#role_access_centralized=remote/g" /opt/app/policy/servers/console/webapps/onap/WEB-INF/classes/portal.properties + cd /opt/app/policy/servers/pap + /opt/app/policy/etc/init.d/pap stop; /opt/app/policy/etc/init.d/pap start + policy.sh status + + + .. code-block:: bash + :caption: Access the Policy Web UI without going through the Portal UI + :linenos: -.. |recipelogo| image:: recipecard.png - :width: 80pt - :height: 80pt + https://policy.api.simpledemo.onap.org:30219/onap/policy (Kubernetes) -.. |cookbooklogo| image:: cookbook.gif - :width: 80pt - :height: 80pt End of Document