aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src/datasources
diff options
context:
space:
mode:
authorNirvan Ramjuttun <nirvan.ramjuttun@amdocs.com>2019-05-07 12:39:19 -0400
committerNirvan Ramjuttun <nirvan.ramjuttun@amdocs.com>2019-05-07 12:40:03 -0400
commit087d4b667a9c5517ac7d014c2bbdad994b927147 (patch)
tree1c0f7eb856794a3a161ebdb3029fba4eb48a6f3e /cds-ui/server/src/datasources
parent0924c4da768d1119a17936933606a38de6526b52 (diff)
Modify CDS-UI server to allow communicating with external blueprint mS
Issue-ID: CCSDK-1292 Change-Id: I3536437bad334841d7c7ecd577c092cd13f42a9b Signed-off-by: Nirvan Ramjuttun <nirvan.ramjuttun@amdocs.com>
Diffstat (limited to 'cds-ui/server/src/datasources')
-rw-r--r--cds-ui/server/src/datasources/blueprint.datasource-template.ts (renamed from cds-ui/server/src/datasources/blueprint.datasource.json)14
-rw-r--r--cds-ui/server/src/datasources/blueprint.datasource.ts2
-rw-r--r--cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts (renamed from cds-ui/server/src/datasources/resource-dictionary.datasource.json)38
-rw-r--r--cds-ui/server/src/datasources/resource-dictionary.datasource.ts2
4 files changed, 30 insertions, 26 deletions
diff --git a/cds-ui/server/src/datasources/blueprint.datasource.json b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
index 86b1c2c15..3cbf09576 100644
--- a/cds-ui/server/src/datasources/blueprint.datasource.json
+++ b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
@@ -1,22 +1,24 @@
-{
+import {controllerApiConfig} from '../../config/app-config';
+
+export default {
"name": "blueprint",
"connector": "rest",
- "baseURL": "http://localhost:8080/api/v1/",
+ "baseURL": controllerApiConfig.url,
"crud": false,
"operations": [{
"template": {
"method": "GET",
- "url": "http://localhost:8080/api/v1/blueprint-model/",
+ "url": controllerApiConfig.url + "/blueprint-model/",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"responsePath": "$.*"
},
"functions": {
- "getAllblueprints": ["authtoken"]
+ "getAllblueprints": []
}
}]
-} \ No newline at end of file
+}; \ No newline at end of file
diff --git a/cds-ui/server/src/datasources/blueprint.datasource.ts b/cds-ui/server/src/datasources/blueprint.datasource.ts
index 008612693..ce901b6d7 100644
--- a/cds-ui/server/src/datasources/blueprint.datasource.ts
+++ b/cds-ui/server/src/datasources/blueprint.datasource.ts
@@ -1,6 +1,6 @@
import {inject} from '@loopback/core';
import {juggler} from '@loopback/repository';
-import * as config from './blueprint.datasource.json';
+import config from './blueprint.datasource-template';
export class BlueprintDataSource extends juggler.DataSource {
static dataSourceName = 'blueprint';
diff --git a/cds-ui/server/src/datasources/resource-dictionary.datasource.json b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
index 9bf5f30c4..b987e588c 100644
--- a/cds-ui/server/src/datasources/resource-dictionary.datasource.json
+++ b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
@@ -1,89 +1,91 @@
-{
+import {controllerApiConfig} from '../../config/app-config';
+
+export default {
"name": "resourceDictionary",
"connector": "rest",
- "baseURL": "http://localhost:8080/api/v1/dictionary",
+ "baseURL": controllerApiConfig.url + "/dictionary",
"crud": false,
"operations": [{
"template": {
"method": "GET",
- "url": "http://localhost:8080/api/v1/dictionary/{name}",
+ "url": controllerApiConfig.url + "/dictionary/{name}",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"responsePath": "$.*"
},
"functions": {
- "getByName": ["name", "authtoken"]
+ "getByName": ["name"]
}
},
{
"template": {
"method": "GET",
- "url": "http://localhost:8080/api/v1/dictionary/source-mapping",
+ "url": controllerApiConfig.url + "/dictionary/source-mapping",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"responsePath": "$.*"
},
"functions": {
- "getSourceMapping": ["authtoken"]
+ "getSourceMapping": []
}
},
{
"template": {
"method": "GET",
- "url": "http://localhost:8080/api/v1/dictionary/search/{tags}",
+ "url": controllerApiConfig.url + "/dictionary/search/{tags}",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"responsePath": "$.*"
},
"functions": {
- "getByTags": ["tags", "authtoken"]
+ "getByTags": ["tags"]
}
},
{
"template": {
"method": "POST",
- "url": "http://localhost:8080/api/v1/dictionary",
+ "url": controllerApiConfig.url + "/dictionary",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"body": "{resourceDictionary}",
"responsePath": "$.*"
},
"functions": {
- "save": ["authtoken", "resourceDictionary"]
+ "save": ["resourceDictionary"]
}
},
{
"template": {
"method": "POST",
- "url": "http://localhost:8080/api/v1/dictionary/by-names",
+ "url": controllerApiConfig.url + "/dictionary/by-names",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
- "authorization": "{authtoken}"
+ "authorization": controllerApiConfig.authToken
},
"body": "{resourceDictionaryList}",
"responsePath": "$.*"
},
"functions": {
- "searchbyNames": ["authtoken", "resourceDictionaryList"]
+ "searchbyNames": ["resourceDictionaryList"]
}
}
]
-} \ No newline at end of file
+}; \ No newline at end of file
diff --git a/cds-ui/server/src/datasources/resource-dictionary.datasource.ts b/cds-ui/server/src/datasources/resource-dictionary.datasource.ts
index 381ab9a78..ba12c78e2 100644
--- a/cds-ui/server/src/datasources/resource-dictionary.datasource.ts
+++ b/cds-ui/server/src/datasources/resource-dictionary.datasource.ts
@@ -1,6 +1,6 @@
import {inject} from '@loopback/core';
import {juggler} from '@loopback/repository';
-import * as config from './resource-dictionary.datasource.json';
+import config from './resource-dictionary.datasource-template';
export class ResourceDictionaryDataSource extends juggler.DataSource {
static dataSourceName = 'resourceDictionary';