Remove Controller API url and use blueprintProcessorApi url instead 53/96953/1
authorShaaban Ebrahim <shaaban.eltanany.ext@orange.com>
Wed, 9 Oct 2019 16:12:44 +0000 (18:12 +0200)
committerDan Timoney <dtimoney@att.com>
Fri, 11 Oct 2019 15:30:45 +0000 (15:30 +0000)
Issue-ID: CCSDK-1793

Signed-off-by: Shaaban Eltanany <shaaban.eltanany.ext@orange.com>
Change-Id: Ic22a886bb7018ec09c557166e3ebd69196713d4c
(cherry picked from commit 6c6ec71317d746bd744cd510a5da79956b8d176c)

cds-ui/server/src/config/app-config.ts
cds-ui/server/src/controllers/blueprint-rest.controller.ts
cds-ui/server/src/datasources/blueprint.datasource-template.ts
cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts

index dcca629..a2cebe5 100644 (file)
@@ -21,12 +21,12 @@ export const appConfig = Object.freeze({
     })
 });
 
-export const controllerApiConfig = Object.freeze({
-    http: Object.freeze({
-        url: process.env.API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL || "http://localhost:8081/api/v1",
-        authToken: process.env.API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN || "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=="
-    })
-});
+// export const controllerApiConfig = Object.freeze({
+//     http: Object.freeze({
+//         url: process.env.API_BLUEPRINT_PROCESSOR_HTTP_BASE_URL || "http://localhost:8081/api/v1",
+//         authToken: process.env.API_BLUEPRINT_PROCESSOR_HTTP_AUTH_TOKEN || "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=="
+//     })
+// });
 
 export const processorApiConfig = Object.freeze({
     http: Object.freeze({
index c73f7a6..7895898 100644 (file)
@@ -48,7 +48,7 @@ import { BlueprintService } from '../services';
 import * as fs from 'fs';
 import * as multiparty from 'multiparty';
 import * as request_lib from 'request';
-import { controllerApiConfig, processorApiConfig, appConfig } from '../config/app-config';
+import { processorApiConfig, appConfig } from '../config/app-config';
 import { bluePrintManagementServiceGrpcClient } from '../clients/blueprint-management-service-grpc-client';
 
 export class BlueprintRestController {
@@ -220,7 +220,7 @@ export class BlueprintRestController {
   }
 
   async uploadFileToBlueprintController(file: multiparty.File, uri: string, response: Response): Promise<Response> {
-    return this.uploadFileToBlueprintService(file, controllerApiConfig.http.url + uri, controllerApiConfig.http.authToken, response);
+    return this.uploadFileToBlueprintService(file, processorApiConfig.http.url + uri, processorApiConfig.http.authToken, response);
   }
 
   async uploadFileToBlueprintProcessor(file: multiparty.File, uri: string, response: Response): Promise<Response> {
@@ -267,7 +267,7 @@ export class BlueprintRestController {
   }
 
   async downloadFileFromBlueprintController(uri: string, response: Response): Promise<Response> {
-    return this.downloadFileFromBlueprintService(controllerApiConfig.http.url + uri, controllerApiConfig.http.authToken, response);
+    return this.downloadFileFromBlueprintService(processorApiConfig.http.url + uri, processorApiConfig.http.authToken, response);
   }
 
   async downloadFileFromBlueprintService(url: string, authToken: string, response: Response): Promise<Response> {
index 1188d9b..85e0aa3 100644 (file)
@@ -1,19 +1,19 @@
-import {controllerApiConfig} from '../config/app-config';
+import {processorApiConfig} from '../config/app-config';
 
 export default {
     "name": "blueprint",
     "connector": "rest",
-    "baseURL": controllerApiConfig.http.url,
+    "baseURL": processorApiConfig.http.url,
     "crud": false,
     "debug": true,
     "operations": [{
         "template": {
             "method": "GET",
-            "url": controllerApiConfig.http.url + "/blueprint-model/",
+            "url": processorApiConfig.http.url + "/blueprint-model/",
             "headers": {
                 "accepts": "application/json",
                 "content-type": "application/json",
-                "authorization": controllerApiConfig.http.authToken
+                "authorization": processorApiConfig.http.authToken
             },
             "responsePath": "$.*"
         },
@@ -25,11 +25,11 @@ export default {
     {
         "template": {
             "method": "GET",
-            "url": controllerApiConfig.http.url + "/blueprint-model/search/{tags}",
+            "url": processorApiConfig.http.url + "/blueprint-model/search/{tags}",
             "headers": {
                 "accepts": "application/json",
                 "content-type": "application/json",
-                "authorization": controllerApiConfig.http.authToken
+                "authorization": processorApiConfig.http.authToken
             },
             "responsePath": "$.*"
         },
index 9f9d754..f839bb2 100644 (file)
@@ -1,19 +1,19 @@
-import {controllerApiConfig} from '../config/app-config';
+import {processorApiConfig} from '../config/app-config';
 
 export default {
     "name": "resourceDictionary",
     "connector": "rest",
-    "baseURL": controllerApiConfig.http.url + "/dictionary",
+    "baseURL": processorApiConfig.http.url + "/dictionary",
     "crud": false,
     "debug": true,
     "operations": [{
             "template": {
                 "method": "GET",
-                "url": controllerApiConfig.http.url + "/dictionary/{name}",
+                "url": processorApiConfig.http.url + "/dictionary/{name}",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "responsePath": "$.*"
             },
@@ -25,11 +25,11 @@ export default {
         {
             "template": {
                 "method": "GET",
-                "url": controllerApiConfig.http.url + "/dictionary/source-mapping",
+                "url": processorApiConfig.http.url + "/dictionary/source-mapping",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "responsePath": "$.*"
             },
@@ -41,11 +41,11 @@ export default {
         {
             "template": {
                 "method": "GET",
-                "url": controllerApiConfig.http.url + "/dictionary/search/{tags}",
+                "url": processorApiConfig.http.url + "/dictionary/search/{tags}",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "responsePath": "$.*"
             },
@@ -57,11 +57,11 @@ export default {
         {
             "template": {
                 "method": "POST",
-                "url": controllerApiConfig.http.url + "/dictionary",
+                "url": processorApiConfig.http.url + "/dictionary",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "body": "{resourceDictionary}",
                 "responsePath": "$.*"
@@ -74,11 +74,11 @@ export default {
         {
             "template": {
                 "method": "POST",
-                "url": controllerApiConfig.http.url + "/dictionary/by-names",
+                "url": processorApiConfig.http.url + "/dictionary/by-names",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "body": "{resourceDictionaryList}",
                 "responsePath": "$.*"
@@ -91,11 +91,11 @@ export default {
         {
             "template": {
                 "method": "GET",
-                "url": controllerApiConfig.http.url + "/model-type/{source}",
+                "url": processorApiConfig.http.url + "/model-type/{source}",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "responsePath": "$.*"
             },
@@ -107,11 +107,11 @@ export default {
         {
             "template": {
                 "method": "GET",
-                "url": controllerApiConfig.http.url + "/model-type/by-definition/data_type",
+                "url": processorApiConfig.http.url + "/model-type/by-definition/data_type",
                 "headers": {
                     "accepts": "application/json",
                     "content-type": "application/json",
-                    "authorization": controllerApiConfig.http.authToken
+                    "authorization": processorApiConfig.http.authToken
                 },
                 "responsePath": "$.*"
             },