X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fcontrollerblueprints%2Fmodules%2Fservice%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fapps%2Fcontrollerblueprints%2Fservice%2Frs%2FBlueprintModelRest.java;fp=ms%2Fcontrollerblueprints%2Fmodules%2Fservice%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fccsdk%2Fapps%2Fcontrollerblueprints%2Fservice%2Frs%2FBlueprintModelRest.java;h=255137bf5a308ec3035c5f0fdbd16f27095d2bea;hb=41897b1434755fd8b5faa3c9ba548b89c2105d6a;hp=9d0b1e3e4b2abb19f0925f44c60be8b060c6ed22;hpb=0740179ce999ac162a5b4dd7f0940d97c0ac1095;p=ccsdk%2Fapps.git diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/BlueprintModelRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/BlueprintModelRest.java index 9d0b1e3e..255137bf 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/BlueprintModelRest.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/BlueprintModelRest.java @@ -42,31 +42,38 @@ public class BlueprintModelRest { @PostMapping(path = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public @ResponseBody - Mono saveBluePrint(@RequestPart("file") FilePart file) throws BluePrintException{ + Mono saveBlueprint(@RequestPart("file") FilePart file) throws BluePrintException{ return blueprintModelService.saveBlueprintModel(file); } @DeleteMapping(path = "/{id}") - public void deleteBluePrint(@PathVariable(value = "id") String id) throws BluePrintException { + public void deleteBlueprint(@PathVariable(value = "id") String id) throws BluePrintException { this.blueprintModelService.deleteBlueprintModel(id); } @GetMapping(path = "/by-name/{name}/version/{version}", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody - BlueprintModelSearch getBluePrintByNameAndVersion(@PathVariable(value = "name") String name, - @PathVariable(value = "version") String version) throws BluePrintException { - return this.blueprintModelService.getBlueprintModelByNameAndVersion(name, version); + BlueprintModelSearch getBlueprintByNameAndVersion(@PathVariable(value = "name") String name, + @PathVariable(value = "version") String version) throws BluePrintException { + return this.blueprintModelService.getBlueprintModelSearchByNameAndVersion(name, version); + } + + @GetMapping(path = "/download/by-name/{name}/version/{version}", produces = MediaType.APPLICATION_JSON_VALUE) + public @ResponseBody + ResponseEntity downloadBlueprintByNameAndVersion(@PathVariable(value = "name") String name, + @PathVariable(value = "version") String version) throws BluePrintException { + return this.blueprintModelService.downloadBlueprintModelFileByNameAndVersion(name, version); } @GetMapping(path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody - BlueprintModelSearch getCBA(@PathVariable(value = "id") String id) throws BluePrintException { + BlueprintModelSearch getBlueprintModel(@PathVariable(value = "id") String id) throws BluePrintException { return this.blueprintModelService.getBlueprintModelSearch(id); } @GetMapping(path = "", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody - List getAllCBA() { + List getAllBlueprintModel() { return this.blueprintModelService.getAllBlueprintModel(); } @@ -76,7 +83,7 @@ public class BlueprintModelRest { return this.blueprintModelService.downloadBlueprintModelFile(id); } - @GetMapping(path = "/publish/{id}", produces = MediaType.APPLICATION_JSON_VALUE) + @PutMapping(path = "/publish/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody BlueprintModelSearch publishBlueprintModel(@PathVariable(value = "id") String id) throws BluePrintException { return this.blueprintModelService.publishBlueprintModel(id);