Removing host from genernated doc 39/116339/1
authorPatrikBuhr <patrik.buhr@est.tech>
Mon, 14 Dec 2020 12:33:06 +0000 (13:33 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Mon, 14 Dec 2020 12:33:47 +0000 (13:33 +0100)
Change-Id: If25daa12d270a43928f583d3a5cbc2258bb426d9
Issue-ID: CCSDK-2966
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
a1-policy-management/api/pms-api.json
a1-policy-management/api/pms-api.yaml
a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java

index b1bea44..173d8df 100644 (file)
             "summary": "Query Near-RT RIC information",
             "deprecated": false,
             "produces": ["*/*"],
-            "operationId": "getRicsUsingGET_1",
+            "operationId": "getRicsUsingGET",
             "responses": {
                 "200": {
                     "schema": {
             "deprecated": false,
             "produces": ["application/json"],
             "description": "The call returns all Near-RT RICs that supports a given policy type identity",
-            "operationId": "getRicsUsingGET",
+            "operationId": "getRicsUsingGET_1",
             "responses": {
                 "200": {
                     "schema": {"$ref": "#/definitions/ric_info_list_v2"},
             "summary": "Returns the name of a RIC managing one Mananged Element",
             "deprecated": false,
             "produces": ["*/*"],
-            "operationId": "getRicUsingGET_1",
+            "operationId": "getRicUsingGET",
             "responses": {
                 "200": {
                     "schema": {"type": "string"},
             "deprecated": false,
             "produces": ["application/json"],
             "description": "Either a Near-RT RIC identity or a Mananged Element identity can be specified.<br>The intention with Mananged Element identity is the ID used in O1 for accessing the traffical element (such as the ID of CU).",
-            "operationId": "getRicUsingGET",
+            "operationId": "getRicUsingGET_1",
             "responses": {
                 "200": {
                     "schema": {"$ref": "#/definitions/ric_info_v2"},
             }
         }
     },
-    "host": "localhost:46233",
     "definitions": {
         "error_information": {
             "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
index 665c9b6..8f2a040 100644 (file)
@@ -14,7 +14,7 @@ info:
   x-audience: external-partner
   x-api-id: 60f9a0e7-343f-43bf-9194-d8d65688d465
 servers:
-- url: //localhost:46233/
+- url: /
 tags:
 - name: A1 Policy Management Version 1.0
   description: Policy Controller
@@ -529,7 +529,7 @@ paths:
       tags:
       - A1 Policy Management Version 1.0
       summary: Query Near-RT RIC information
-      operationId: getRicsUsingGET_1
+      operationId: getRicsUsingGET
       parameters:
       - name: policyType
         in: query
@@ -633,7 +633,7 @@ paths:
       summary: Query Near-RT RIC information
       description: The call returns all Near-RT RICs that supports a given policy
         type identity
-      operationId: getRicsUsingGET
+      operationId: getRicsUsingGET_1
       parameters:
       - name: policytype_id
         in: query
@@ -947,7 +947,7 @@ paths:
       tags:
       - A1 Policy Management Version 1.0
       summary: Returns the name of a RIC managing one Mananged Element
-      operationId: getRicUsingGET_1
+      operationId: getRicUsingGET
       parameters:
       - name: managedElementId
         in: query
@@ -1077,7 +1077,7 @@ paths:
       description: Either a Near-RT RIC identity or a Mananged Element identity can
         be specified.<br>The intention with Mananged Element identity is the ID used
         in O1 for accessing the traffical element (such as the ID of CU).
-      operationId: getRicUsingGET
+      operationId: getRicUsingGET_1
       parameters:
       - name: managed_element_id
         in: query
index ab3e89e..6449e48 100644 (file)
@@ -81,26 +81,31 @@ public class ApplicationConfig {
 
     private Map<String, ControllerConfig> controllerConfigs = new HashMap<>();
 
+    private WebClientConfig webClientConfig = null;
+
     public synchronized Collection<RicConfig> getRicConfigs() {
         return this.ricConfigs.values();
     }
 
     public WebClientConfig getWebClientConfig() {
-        HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
-                .httpProxyHost(this.httpProxyHost) //
-                .httpProxyPort(this.httpProxyPort) //
-                .build();
-
-        return ImmutableWebClientConfig.builder() //
-                .keyStoreType(this.sslKeyStoreType) //
-                .keyStorePassword(this.sslKeyStorePassword) //
-                .keyStore(this.sslKeyStore) //
-                .keyPassword(this.sslKeyPassword) //
-                .isTrustStoreUsed(this.sslTrustStoreUsed) //
-                .trustStore(this.sslTrustStore) //
-                .trustStorePassword(this.sslTrustStorePassword) //
-                .httpProxyConfig(httpProxyConfig) //
-                .build();
+        if (this.webClientConfig == null) {
+            HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
+                    .httpProxyHost(this.httpProxyHost) //
+                    .httpProxyPort(this.httpProxyPort) //
+                    .build();
+
+            this.webClientConfig = ImmutableWebClientConfig.builder() //
+                    .keyStoreType(this.sslKeyStoreType) //
+                    .keyStorePassword(this.sslKeyStorePassword) //
+                    .keyStore(this.sslKeyStore) //
+                    .keyPassword(this.sslKeyPassword) //
+                    .isTrustStoreUsed(this.sslTrustStoreUsed) //
+                    .trustStore(this.sslTrustStore) //
+                    .trustStorePassword(this.sslTrustStorePassword) //
+                    .httpProxyConfig(httpProxyConfig) //
+                    .build();
+        }
+        return this.webClientConfig;
     }
 
     public synchronized ControllerConfig getControllerConfig(String name) throws ServiceException {
index 2170b3c..5edee15 100644 (file)
@@ -217,7 +217,9 @@ class ApplicationTest {
         String url = "https://localhost:" + this.port + "/v2/api-docs";
         ResponseEntity<String> resp = restClient("", false).getForEntity(url).block();
         assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
-        String indented = (new JSONObject(resp.getBody())).toString(4);
+        JSONObject jsonObj = new JSONObject(resp.getBody());
+        jsonObj.remove("host");
+        String indented = (jsonObj).toString(4);
         String docDir = "api/";
         Files.createDirectories(Paths.get(docDir));
         try (PrintStream out = new PrintStream(new FileOutputStream(docDir + "pms-api.json"))) {