1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 The Policy Framework GUI Server
6 ###############################
8 The **gui-server** microservice serves the GUI code to the browser for Policy Framework UI. In addition, it acts as
9 a single point of reference for the REST interfaces provided by **policy-api**, **policy-pap**, and **acm-runtime**.
10 It can also be used as a HTTPS gatewy for REST references into a Policy Framework deployment in a Kubernetes cluster.
15 The **gui-server** is a regular microservice, and it is packaged, delivered and configured as a docker image. It is
16 a Spring application and therefore uses a normal Spring-style *applciation.yaml* approach to configuration.
18 Definitive example configurations are available in the codebase:
20 - `application_http.yaml <https://github.com/onap/policy-gui/blob/master/gui-server/src/test/resources/application_http.yaml>`_
21 showing how to configure gui-server for HTTP access
22 - `application_https.yaml <https://github.com/onap/policy-gui/blob/master/gui-server/src/test/resources/application_https.yaml>`_
23 showing how to configure gui-server for HTTPS access
25 The configuration parameters are explained in the sections below
30 Configuration for HTTP access to gui-server::
37 Start gui-server on port 2443 and disable SSL.
39 Configuration for HTTPS access to gui-server::
45 enabled-protocols: TLSv1.2
47 key-store: file:./src/test/resources/helloworld-keystore.jks
48 key-store-password: changeit
49 trust-store: file:./src/test/resources/helloworld-truststore.jks
50 trust-store-password: changeit
52 Start gui-server on port 2443 and enable SSL with the parameters specified above
54 Note that other standard Spring **server** configuraiton parameters as
56 `on the Spring website <https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html>`_
59 Runtime Adaptation Configuration
60 --------------------------------
62 You can configure the adaptation for **policy-api**, **policy-pap**, and **runtime-acm**. In other words, you can map
63 the URL that the GUI produced or that you want to use in a REST tool such as *postman* or *curl* in the **runtime-ui**
64 part of the aaplication.yaml file::
68 mapping-path: "/runtime-ui/policy-api/restservices/"
69 url: http://localhost:30440
70 disable-ssl-validation: true
71 disable-ssl-hostname-check: true
73 mapping-path: "/runtime-ui/policy-pap/restservices/"
74 url: http://localhost:30442
75 disable-ssl-validation: true
76 disable-ssl-hostname-check: true
78 mapping-path: "/runtime-ui/acm/restservices/"
79 url: http://localhost:30258
80 disable-ssl-validation: true
81 disable-ssl-hostname-check: true
83 The parameters under the **policy-api**, **policy-pap**, and **acm** sections are identical.
88 The **mapping-path** is the root part of the path that will be replaced by the **url**, the **url** replaces the
91 Therefore, using the configuration above for policy-api, the following mapping occurs::
93 http://localhost:2443/runtime-ui/policy-api/restservices/policy/api/v1/healthcheck
97 http://localhost:30440/policy/api/v1/healthcheck
101 https://localhost:2443/runtime-ui/acm/restservices/onap/policy/clamp/acm/v2/commission
105 http://localhost:30258/onap/policy/clamp/acm/v2/commission
107 disable-ssl-validation and disable-ssl-hostname-check
108 +++++++++++++++++++++++++++++++++++++++++++++++++++++
110 The **disable-ssl-validation** **disable-ssl-hostname-check** are boolean values. If the target server (policy-api,
111 policy-pap, or runtime-acm) is using http, these values should be set to **false**. If the target server is using
112 HTTPS, set the values as **true** so that the **gui-server** transfers and forwards certificates to target servers.
114 Spring Boot Acuator Monitoring
115 ------------------------------
117 The **gui-server** supports regular
118 `Spring Boot Actuator monitoring <https://docs.spring.io/spring-boot/docs/1.4.0.M2/reference/html/production-ready-monitoring.html>`_
119 and monitoring over `prometheus <https://prometheus.io/>`_.
121 The following section of the *application.yaml** file is an example of how to enable monitoring::
128 include: health,metrics,prometheus
129 path-mapping.metrics: plain-metrics
130 path-mapping.prometheus: metrics
132 The configuration above enables the following URLs::
135 http://localhost:2443/health
138 http://localhost:2443/plain-metrics
141 http://localhost:2443/metrics