diff options
Diffstat (limited to 'docs/development')
-rw-r--r-- | docs/development/devtools/devtools.rst | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/docs/development/devtools/devtools.rst b/docs/development/devtools/devtools.rst index 787af683..5b75d328 100644 --- a/docs/development/devtools/devtools.rst +++ b/docs/development/devtools/devtools.rst @@ -253,9 +253,10 @@ running MariaDb database instance. The easiest way to do this is to run the dock information on doing so. Once the mariadb is up and running, a configuration file must be provided to the api in order for it to know how to connect to the mariadb. You can locate the default configuration file in the packaging of the api component: -`Default API Configuration <https://gerrit.onap.org/r/gitweb?p=policy/api.git;a=blob;f=packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json;h=042fb9d54c79ce4dad517e2564636632a8ecc550;hb=refs/heads/master>`_ +`Default Policy API Configuration <https://gerrit.onap.org/r/gitweb?p=policy/api.git;a=blob;f=packages/policy-api-tarball/src/main/resources/etc/apiParameters.yaml;h=2c19199a8a889cb0ab203334182662fe15e1635e;hb=refs/heads/master>`_ -You will want to change the fields pertaining to "host", "port" and "databaseUrl" to your local environment settings. +You will want to change the fields pertaining to "host", "port" and "databaseUrl" to your local environment settings and start the +policy-api springboot application either using your IDE of choice or using the run goal from Spring Boot Maven plugin: *mvn spring-boot:run*. Running the API component using Docker Compose ++++++++++++++++++++++++++++++++++++++++++++++ @@ -264,6 +265,20 @@ An example of running the api using a docker compose script is located in the Po `Policy CSIT API Docker Compose <https://gerrit.onap.org/r/gitweb?p=integration/csit.git;a=blob;f=scripts/policy/docker-compose-api.yml;h=e32190f1e6cb6d9b64ddf53a2db2c746723a0c6a;hb=refs/heads/master>`_ +Running the PAP component standalone ++++++++++++++++++++++++++++++++++++++ + +Once you have successfully built the PAP codebase, a running MariaDb database and DMaaP instance will also be required to start up the application. +For MariaDb instance, the easiest way is to run the docker image, please see the mariadb documentation for the latest +information on doing so. For DMaaP, the easiest way during development is to run the DMaaP simulator which is explained in the below sections. +Once the mariadb and DMaaP are running, a configuration file must be provided to the PAP component in order for it to know how to +connect to the mariadb and DMaaP along with other relevant configuration details. You can locate the default configuration file in the packaging of the PAP component: + +`Default PAP Configuration <https://gerrit.onap.org/r/gitweb?p=policy/pap.git;a=blob;f=packages/policy-pap-tarball/src/main/resources/etc/papParameters.yaml;h=06dd45f4946fd0a11ed8ef859f8fc5bcf409a3f0;hb=HEAD>`_ + +Update the fields related to MariaDB, DMaaP and the RestServer for the application as per your local environment settings. +Then to start the application, just run the Spring Boot application using IDE or command line. + Running the Smoke Tests *********************** @@ -347,6 +362,10 @@ the Policy Framework works in a full ONAP deployment. Generating Swagger Documentation ******************************** + +1. Using Swagger2Markup maven plugin from Policy Parent Integration POM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + The `Policy Parent Integration POM <https://github.com/onap/policy-parent/blob/master/integration/pom.xml>`_ contains a *generateSwaggerDocs* profile. This profile can be activated on any module that has a Swagger endpoint. When active, this profile creates a tarball in Nexus with the name *<project-artifactId>-swagger-docs.tar.gz*. The tarball contains the following files: @@ -394,6 +413,16 @@ of such a test case. See `this unit test case <https://github.com/onap/policy-clamp/blob/master/runtime/src/test/java/org/onap/policy/clamp/clds/it/HttpsItCase.java>`_ for the full example. +2. Accessing Swagger documentation for springboot based policy applications ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Springfox Swagger2 maven dependency aids with auto-generation of Swagger documentation. + +Using the Swagger-UI maven dependency Swagger HTML documentation can be accessed at the root url. + +- The generated swagger.json can be accessed at: *https://service_IP:service_port/v2/api-docs* +- Swagger UI can be accessed at: *https://service_IP:service_port/swagger-ui/index.html* + Running the DMaaP Simulator during Development ********************************************** It is sometimes convenient to run the DMaaP simulator during development. You can run it from the command line using Maven or from within your IDE. |