diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/designer-api')
2 files changed, 53 insertions, 9 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt index ff9aed664..1f01d1ce3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt @@ -211,24 +211,28 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint } @PostMapping( - path = arrayOf("/workflow-spec"), produces = arrayOf(MediaType - .APPLICATION_JSON_VALUE), - consumes = arrayOf(MediaType.APPLICATION_JSON_VALUE) + path = arrayOf("/workflow-spec"), produces = arrayOf( + MediaType + .APPLICATION_JSON_VALUE + ), + consumes = arrayOf(MediaType.APPLICATION_JSON_VALUE) ) @ResponseBody @Throws(BluePrintException::class) @PreAuthorize("hasRole('USER')") suspend fun workflowSpec(@RequestBody workFlowSpecReq: WorkFlowSpecRequest): - ResponseEntity<String> = mdcWebCoroutineScope { + ResponseEntity<String> = mdcWebCoroutineScope { var json = bluePrintModelHandler.prepareWorkFlowSpec(workFlowSpecReq) - .asJsonString() + .asJsonString() ResponseEntity(json, HttpStatus.OK) } @GetMapping( - path = arrayOf("/workflows/blueprint-name/{name}/version/{version" + - "}"), - produces = arrayOf(MediaType.APPLICATION_JSON_VALUE) + path = arrayOf( + "/workflows/blueprint-name/{name}/version/{version" + + "}" + ), + produces = arrayOf(MediaType.APPLICATION_JSON_VALUE) ) @ResponseBody @Throws(BluePrintException::class) @@ -240,7 +244,7 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint @PathVariable(value = "version") version: String ): ResponseEntity<String> = mdcWebCoroutineScope { var json = bluePrintModelHandler.getWorkflowNames(name, version) - .asJsonString() + .asJsonString() ResponseEntity(json, HttpStatus.OK) } } diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ErrorHandling.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ErrorHandling.kt new file mode 100644 index 000000000..ae91246fe --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/ErrorHandling.kt @@ -0,0 +1,40 @@ +/* + * Copyright © 2018-2019 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.cds.blueprintsprocessor.designer.api + +object DesignerApiDomains { + // Designer Api Domains Constants + const val DESIGNER_API = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api" + const val DESIGNER_API_ENHANCER = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer" + const val DESIGNER_API_HANDLER = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler" + const val DESIGNER_API_LOAD = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.load" + const val DESIGNER_API_SERVICE = "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.service" +} + +object DesignerApiHttpErrorCodes { + init { + // Register HttpErrorCodes + // HttpErrorCodes.register("", 200) + } +} + +object DesignerGrpcErrorCodes { + init { + // Register GrpcErrorCodes + // GrpcErrorCodes.register("", 3) + } +} |