1- Install the basic packages
basic_packages
$ sudo apt-get update $ sudo apt-get install -y openjdk-8-jdk docker docker-compose zip unzip curl wget ssh telnet maven # make sure docker can be launched with normal user $ sudo groupadd docker $ sudo gpasswd -a $USER docker $ newgrp docker
2- Download and build policy API and its docker image.
Policy API Docker Image Build
cd ~/ git clone https://gerrit.onap.org/r/oparent cd oparent/ mvn clean install cd ../ git clone https://gerrit.onap.org/r/policy/parent cd parent/ mvn clean install cd ../ git clone https://gerrit.onap.org/r/policy/api cd api/ mvn clean install -Pdocker # Run policy-api container docker run -d --name policy-api -p 6969:6969 -it onap/policy-api:2.0.0-SNAPSHOT-latest
3- Check health status of the API service with following command. Please ensure to
Health Check
curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://<VM_IP_ADDRESS>:6969/healthcheck e.g, curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://10.12.6.93:6969/healthcheck
4- Health Check should return following output:
Health Check Output
{"name":"Policy API","url":"self","healthy":true,"code":200,"message":"alive"}
5- Check for statistics API
Statistics API
curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://10.12.6.93:6969/statistics
6- Sample output:
Statistics output
{"code":200,"totalApiCallCount":0,"apiCallSuccessCount":0,"apiCallFailureCount":0,"totalPolicyGetCount":0,"totalPolicyPostCount":0,"totalTemplateGetCount":0,"totalTemplatePostCount":0,"policyGetSuccessCount":0,"policyGetFailureCount":0,"policyPostSuccessCount":0,"policyPostFailureCount":0,"templateGetSuccessCount":0,"templateGetFailureCount":0,"templatePostSuccessCount":0,"templatePostFailureCount":0}