diff options
author | 2020-12-09 09:36:03 +0100 | |
---|---|---|
committer | 2020-12-14 18:31:15 +0000 | |
commit | 108011551bb81e3465d1bd6087a81110967df9e0 (patch) | |
tree | 85915c777976517a0142b8c38654571ef0a1d776 /ms/blueprintsprocessor/modules/inbounds/configs-api/src/main | |
parent | b4bbb70118f3406ffc7bdd7df557a9b0d9d63f21 (diff) |
CDS add Swagger annotations for Resource, Template, Dictionary and Config API
Issue-ID: CCSDK-3014
Change-Id: I380c38cde52a748a9b797c573b7651a766e8b496
Signed-off-by: Piotr Stanior <piotr.stanior@t-mobile.pl>
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/configs-api/src/main')
-rw-r--r-- | ms/blueprintsprocessor/modules/inbounds/configs-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotController.kt | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotController.kt b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotController.kt index d285fe52d..584df27ed 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotController.kt @@ -48,7 +48,7 @@ import org.springframework.web.bind.annotation.RestController @RestController @RequestMapping("/api/v1/configs") @Api( - value = "/api/v1/configs", + value = "Resource configuration", description = "Interaction with stored configurations." ) open class ResourceConfigSnapshotController(private val resourceConfigSnapshotService: ResourceConfigSnapshotService) { @@ -67,7 +67,6 @@ open class ResourceConfigSnapshotController(private val resourceConfigSnapshotSe } @RequestMapping( - path = [""], method = [RequestMethod.GET], produces = [MediaType.TEXT_PLAIN_VALUE, MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE] ) @@ -79,10 +78,10 @@ open class ResourceConfigSnapshotController(private val resourceConfigSnapshotSe @ResponseBody @PreAuthorize("hasRole('USER')") fun get( - @ApiParam(value = "Resource Type associated of the resource configuration snapshot.", required = false) + @ApiParam(value = "Resource Type associated of the resource configuration snapshot.", required = false, example = "\"PNF\"") @RequestParam(value = "resourceType", required = true) resourceType: String, - @ApiParam(value = "Resource Id associated of the resource configuration snapshot.", required = false) + @ApiParam(value = "Resource Id associated of the resource configuration snapshot.", required = false, example = "\"1\"") @RequestParam(value = "resourceId", required = true) resourceId: String, @ApiParam(value = "Status of the snapshot being retrieved.", defaultValue = "RUNNING", required = false) @@ -142,18 +141,18 @@ open class ResourceConfigSnapshotController(private val resourceConfigSnapshotSe value = "Store a resource configuration snapshot identified by resourceId, resourceType, status.", notes = "Store a resource configuration snapshot, identified by its resourceId and resourceType, " + "and optionally its status, either RUNNING or CANDIDATE.", - response = ResourceConfigSnapshot::class, produces = MediaType.APPLICATION_JSON_VALUE + response = ResourceConfigSnapshot::class ) @ResponseBody @PreAuthorize("hasRole('USER')") fun postWithResourceIdAndResourceType( - @ApiParam(value = "Resource Type associated with the resolution.", required = false) + @ApiParam(value = "Resource Type associated with the resolution.", required = false, example = "\"PNF\"") @PathVariable(value = "resourceType", required = true) resourceType: String, - @ApiParam(value = "Resource Id associated with the resolution.", required = false) + @ApiParam(value = "Resource Id associated with the resolution.", required = false, example = "\"1\"") @PathVariable(value = "resourceId", required = true) resourceId: String, @ApiParam(value = "Status of the snapshot being retrieved.", defaultValue = "RUNNING", required = true) @PathVariable(value = "status", required = true) status: String, - @ApiParam(value = "Config snapshot to store.", required = true) + @ApiParam(value = "Config snapshot to store.", required = true, example = "\"config_snapshot\"") @RequestBody snapshot: String ): ResponseEntity<ResourceConfigSnapshot> = runBlocking { @@ -178,7 +177,7 @@ open class ResourceConfigSnapshotController(private val resourceConfigSnapshotSe @ResponseBody @PreAuthorize("hasRole('USER')") fun getAllByID( - @ApiParam(value = "Resource Id associated of the resource configuration snapshots.", required = false) + @ApiParam(value = "Resource Id associated of the resource configuration snapshots.", required = false, example = "\"1\"") @RequestParam(value = "resourceId", required = true) resourceId: String, @ApiParam(value = "Status of the snapshot being retrieved.", defaultValue = "ANY", required = false) @RequestParam(value = "status", required = false, defaultValue = "ANY") status: String @@ -223,7 +222,7 @@ open class ResourceConfigSnapshotController(private val resourceConfigSnapshotSe @ResponseBody @PreAuthorize("hasRole('USER')") fun getAllByType( - @ApiParam(value = "Resource Type associated of the resource configuration snapshot.", required = false) + @ApiParam(value = "Resource Type associated of the resource configuration snapshot.", required = false, example = "\"PNF\"") @RequestParam(value = "resourceType", required = true) resourceType: String, @ApiParam(value = "Status of the snapshot being retrieved.", defaultValue = "ANY", required = false) @RequestParam(value = "status", required = false, defaultValue = "ANY") status: String |