summaryrefslogtreecommitdiffstats
path: root/cds-ui/server/src
diff options
context:
space:
mode:
authorAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2020-12-03 17:03:10 +0200
committerAhmedeldeeb50 <ahmed.eldeeb.ext@orange.com>2020-12-03 17:03:10 +0200
commiteafc8865d856cc282e0e0845c67ff232b1a5b805 (patch)
tree7a1f996fc36c17053456ebb14be861a5283b8d39 /cds-ui/server/src
parentd578a475277774517207c96772e221e81b6c5d25 (diff)
add Enrich&Deploy function in designer
Issue-ID: CCSDK-2900 Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I098fc6bbb35953fbf3728b3863e7990918305edb
Diffstat (limited to 'cds-ui/server/src')
-rw-r--r--cds-ui/server/src/controllers/blueprint-rest.controller.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
index 91d7e66e3..86fdeda86 100644
--- a/cds-ui/server/src/controllers/blueprint-rest.controller.ts
+++ b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
@@ -256,6 +256,32 @@ export class BlueprintRestController {
});
}
+ @post('/controllerblueprint/enrichandpublish')
+ async enrichAndPublish(
+ @requestBody({
+ description: 'multipart/form-data value.',
+ required: true,
+ content: {
+ 'multipart/form-data': {
+ // Skip body parsing
+ 'x-parser': 'stream',
+ schema: { type: 'object' },
+ },
+ },
+ })
+ request: Request,
+ @inject(RestBindings.Http.RESPONSE) response: Response,
+ ): Promise<Response> {
+ return new Promise((resolve, reject) => {
+ this.getFileFromMultiPartForm(request).then(file => {
+ if (appConfig.action.grpcEnabled)
+ return this.uploadFileToBlueprintProcessorGrpc(file, 'ENRICH', response);
+ else
+ return this.uploadFileToBlueprintController(file, '/blueprint-model/enrichandpublish/', response);
+ });
+ });
+ }
+
@get('/controllerblueprint/download-blueprint/{name}/{version}')
async download(
@param.path.string('name') name: string,