aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src
diff options
context:
space:
mode:
authorBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>2019-11-07 14:12:47 +0000
committerGerrit Code Review <gerrit@onap.org>2019-11-07 14:12:47 +0000
commit1e1ac926da3bc75e55a435a4b71b53642c0ccca8 (patch)
tree4d292fa9864263eee83b45033730597066ca9714 /cds-ui/server/src
parent88e3ef2d396bc91051b182d11a2d490bf37abf08 (diff)
parent7cfca9c44b6465d7eb88d64e3fa38c7f1a09c096 (diff)
Merge "add search by meta data in cds-ui server and blueprint processor Issue-ID: CCSDK-1770"
Diffstat (limited to 'cds-ui/server/src')
-rw-r--r--cds-ui/server/src/controllers/blueprint-rest.controller.ts16
-rw-r--r--cds-ui/server/src/datasources/blueprint.datasource-template.ts18
-rw-r--r--cds-ui/server/src/services/blueprint.service.ts3
3 files changed, 34 insertions, 3 deletions
diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
index 1eef6fbcb..b52952826 100644
--- a/cds-ui/server/src/controllers/blueprint-rest.controller.ts
+++ b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
@@ -69,6 +69,20 @@ export class BlueprintRestController {
return await this.bpservice.getAllblueprints();
}
+ @get('/controllerblueprint/meta-data/{keyword}', {
+ responses: {
+ '200': {
+ description: 'Blueprint model instance',
+ content: { 'application/json': { schema: { 'x-ts-type': Blueprint } } },
+ },
+ },
+ })
+ async getAllPacakgesByKeword(@param.path.string('keyword') keyword: string) {
+ return await this.bpservice.getBlueprintsByKeyword(keyword);
+ }
+
+
+
@get('/controllerblueprint/searchByTags/{tags}', {
responses: {
'200': {
@@ -344,4 +358,4 @@ export class BlueprintRestController {
});
});
}
-} \ No newline at end of file
+}
diff --git a/cds-ui/server/src/datasources/blueprint.datasource-template.ts b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
index 85e0aa342..b0aaf01eb 100644
--- a/cds-ui/server/src/datasources/blueprint.datasource-template.ts
+++ b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
@@ -38,5 +38,21 @@ export default {
}
},
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/meta-data/{keyword}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getBlueprintsByKeyword": ["keyword"]
+
+ }
+ },
]
-}; \ No newline at end of file
+};
diff --git a/cds-ui/server/src/services/blueprint.service.ts b/cds-ui/server/src/services/blueprint.service.ts
index 0545faca8..7952859d1 100644
--- a/cds-ui/server/src/services/blueprint.service.ts
+++ b/cds-ui/server/src/services/blueprint.service.ts
@@ -4,6 +4,7 @@ import {BlueprintDataSource} from '../datasources';
export interface BlueprintService {
getAllblueprints(): Promise<any>;
+ getBlueprintsByKeyword(keyword: string): Promise<any>;
getByTags(tags: string): Promise<JSON>;
}
@@ -17,4 +18,4 @@ export class BlueprintServiceProvider implements Provider<BlueprintService> {
value(): Promise<BlueprintService> {
return getService(this.dataSource);
}
-} \ No newline at end of file
+}