...
Code Block |
---|
language | bash |
---|
firstline | 6 |
---|
title | Policy API Docker Image Build |
---|
|
$ cd ~/
$ git clone https://gerrit.onap.org/r/oparent
$ cd oparent/
$ cp settings.xml ~/.m2/
$ 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
|
3- Check if the images are indeed built and then run the docker image.
Code Block |
---|
language | bash |
---|
firstline | 6 |
---|
title | Policy API Docker Image Run |
---|
|
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
onap/policy-api 2.0.0-SNAPSHOT 891f162e17fc 28 hours ago 1e+03MB
onap/policy-api 2.0.0-SNAPSHOT-20190212T1205 891f162e17fc 28 hours ago 1e+03MB
onap/policy-api 2.0.0-SNAPSHOT-latest 891f162e17fc 28 hours ago 1e+03MB
onap/policy-api latest 891f162e17fc 28 hours ago 1e+03MB
# Run policy-api container
docker run -d --name policy-api -p 6969:6969 -it onap/policy-api:2.0.0-SNAPSHOT-latest
|
35- Check health status of the API service with following command:
Code Block |
---|
language | bash |
---|
title | 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
{"name":"Policy API","url":"self","healthy":true,"code":200,"message":"alive"} |
46- Check for statistics API with Sample Output
Code Block |
---|
language | bash |
---|
title | Statistics API |
---|
|
$ curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://10.12.6.93:6969/statistics
{"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} |
JMeter VM Setup: VM2
57- Install JMeter on VM2.
Code Block |
---|
language | bash |
---|
title | JMeter Install |
---|
|
$ cd ~/
$ wget http://mirrors.whoishostingthis.com/apache//jmeter/binaries/apache-jmeter-5.0.zip
$ unzip apache-jmeter-5.0.zip |
68- Run JMeter Stability Tests.
...