1 Copyright 2020 AT&T Intellectual Property. All rights reserved.
3 This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
4 Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
8 The Policy Enforcement Tutorial can be built:
12 # Start the Policy Framework components
14 Be sure to start the Policy Framework application components in *docker* if you are not testing this in a lab.
15 - Ensure you have docker and docker-compose installed
16 - Check out the *policy/docker* repo from the ONAP gerrit or from github: https://github.com/onap/policy-docker
17 - In a console, change directory into the *compose* directory of the *policy/docker* repo
18 - Start *xacml-pdp* by running the *start-compose.sh* script
20 start-compose.sh xacml-pdp
22 - Run python script ```kafka_producer.py``` under docker repository with topic name and message as parameters.
23 i.e. ```python3 /docker/csit/resources/tests/kafka_producer.py POLICY-PDP-PAP "message"```
24 (update "message" to the usual json body)
26 - Run the xacml-pdp health check
28 curl -u 'policyadmin:zb!XztG34' 'http://0.0.0.0:30441/policy/pdpx/v1/healthcheck'
29 Should return JSON similar to this:
30 {"name":"Policy Xacml PDP","url":"self","healthy":true,"code":200,"message":"alive"}
32 - Run the api health check
34 curl -u 'policyadmin:zb!XztG34' 'http://0.0.0.0:30440/policy/api/v1/healthcheck'
35 Should return JSON similar to this:
44 - Run the pap health check
46 curl -u 'policyadmin:zb!XztG34' 'http://0.0.0.0:30442/policy/pap/v1/healthcheck'
47 Should return JSON similar to this:
58 You can run the application via code by running the *App.main* method with command line argument with IP then Port
59 of the XACML PDP, followed by the IP then Port of kafka.
61 App.main(new String[] {"0.0.0.0", "6969", "0.0.0.0", "9092"});
63 or from Eclipse by right-clicking App.java and selecting *Run As* and select *Java Application*. Edit the
64 configuration by adding these command line arguments: "0.0.0.0" "6969" "0.0.0.0" "9092"
66 Quit the application by typing 'q' into stdin.