diff options
author | Julien Fontaine <julien.fontaine@bell.ca> | 2020-03-04 16:09:26 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-03-09 14:15:44 +0000 |
commit | 8a782f62ec996be8ac8e1807fbe7276192fdc02d (patch) | |
tree | f265079acf55f23cd1f64d1e3431042d6492904e /ms/blueprintsprocessor/modules | |
parent | 88929cf6c21023328644fc637627371733b085d8 (diff) |
add a rest endpoint to remove resources
Issue-ID: CCSDK-2159
Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
Change-Id: I504fa0aad6f4e7105a53e793d08d08d92bbb8df4
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r-- | ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceController.kt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceController.kt b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceController.kt index b49ca68ed..264cd23ff 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/ResourceController.kt @@ -103,6 +103,28 @@ open class ResourceController(private var resourceResolutionDBService: ResourceR } @RequestMapping( + path = [""], + method = [RequestMethod.DELETE], produces = [MediaType.APPLICATION_JSON_VALUE] + ) + @ApiOperation(value = "Delete resources using resolution key", + notes = "Delete all the resources associated to a resolution-key using blueprint metadata, artifact name and the resolution-key.", + produces = MediaType.APPLICATION_JSON_VALUE) + @PreAuthorize("hasRole('USER')") + fun deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey( + @ApiParam(value = "Name of the CBA.", required = true) + @RequestParam(value = "bpName", required = true) bpName: String, + @ApiParam(value = "Version of the CBA.", required = true) + @RequestParam(value = "bpVersion", required = true) bpVersion: String, + @ApiParam(value = "Artifact name for which to retrieve a resolved resource.", required = true) + @RequestParam(value = "artifactName", required = false, defaultValue = "") artifactName: String, + @ApiParam(value = "Resolution Key associated with the resolution.", required = true) + @RequestParam(value = "resolutionKey", required = true) resolutionKey: String + ) = runBlocking { + ResponseEntity.ok() + .body(resourceResolutionDBService.deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey(bpName, bpVersion, artifactName, resolutionKey)) + } + + @RequestMapping( path = ["/resource"], method = [RequestMethod.GET], produces = [MediaType.APPLICATION_JSON_VALUE] |