aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/application
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-27 17:29:51 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-27 17:29:51 +0000
commit208cb6ae94922c0198648aea817085793ce8bc47 (patch)
tree9dd0a599ec52c4ee3baac207980729383a2cb1d7 /ms/controllerblueprints/application
parent522a86b6dc2d08b16ba6aba682d5d1fd8558ad25 (diff)
Controller Blueprints Microservice
Optimise model type repository search for DB and file in blueprint repo service. Change-Id: If5458e218b723d3fff451789a73a667dd75bc91c Issue-ID: CCSDK-487 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/application')
-rw-r--r--ms/controllerblueprints/application/load/model_type/node_type/source-db.json44
-rw-r--r--ms/controllerblueprints/application/load/model_type/node_type/source-default.json18
-rw-r--r--ms/controllerblueprints/application/load/model_type/node_type/source-input.json18
-rw-r--r--ms/controllerblueprints/application/load/model_type/node_type/source-rest.json61
-rw-r--r--ms/controllerblueprints/application/load/model_type/node_type/tosca.nodes.ResourceSource.json5
-rw-r--r--ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationExceptionHandler.java5
6 files changed, 151 insertions, 0 deletions
diff --git a/ms/controllerblueprints/application/load/model_type/node_type/source-db.json b/ms/controllerblueprints/application/load/model_type/node_type/source-db.json
new file mode 100644
index 00000000..661a9503
--- /dev/null
+++ b/ms/controllerblueprints/application/load/model_type/node_type/source-db.json
@@ -0,0 +1,44 @@
+{
+ "description": "This is Database Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
+ "required": true,
+ "type": "string",
+ "constraints": [
+ {
+ "valid_values": [
+ "SQL",
+ "PLSQL"
+ ]
+ }
+ ]
+ },
+ "query": {
+ "required": true,
+ "type": "string"
+ },
+ "input-key-mapping": {
+ "required": false,
+ "type": "map",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "output-key-mapping": {
+ "required": false,
+ "type": "map",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "key-dependencies": {
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/load/model_type/node_type/source-default.json b/ms/controllerblueprints/application/load/model_type/node_type/source-default.json
new file mode 100644
index 00000000..13e234e1
--- /dev/null
+++ b/ms/controllerblueprints/application/load/model_type/node_type/source-default.json
@@ -0,0 +1,18 @@
+{
+ "description": "This is Default Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "key": {
+ "required": false,
+ "type": "string"
+ },
+ "key-dependencies": {
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/load/model_type/node_type/source-input.json b/ms/controllerblueprints/application/load/model_type/node_type/source-input.json
new file mode 100644
index 00000000..126ea30b
--- /dev/null
+++ b/ms/controllerblueprints/application/load/model_type/node_type/source-input.json
@@ -0,0 +1,18 @@
+{
+ "description": "This is Input Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "key": {
+ "required": false,
+ "type": "string"
+ },
+ "key-dependencies": {
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/load/model_type/node_type/source-rest.json b/ms/controllerblueprints/application/load/model_type/node_type/source-rest.json
new file mode 100644
index 00000000..f8dd8b6f
--- /dev/null
+++ b/ms/controllerblueprints/application/load/model_type/node_type/source-rest.json
@@ -0,0 +1,61 @@
+{
+ "description": "This is Rest Resource Source Node Type",
+ "version": "1.0.0",
+ "properties": {
+ "type": {
+ "required": false,
+ "type": "string",
+ "default": "JSON",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON"
+ ]
+ }
+ ]
+ },
+ "url-path": {
+ "required": true,
+ "type": "string"
+ },
+ "path": {
+ "required": true,
+ "type": "string"
+ },
+ "expression-type": {
+ "required": false,
+ "type": "string",
+ "default": "JSON_PATH",
+ "constraints": [
+ {
+ "valid_values": [
+ "JSON_PATH",
+ "JSON_POINTER"
+ ]
+ }
+ ]
+ },
+ "input-key-mapping": {
+ "required": false,
+ "type": "map",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "output-key-mapping": {
+ "required": false,
+ "type": "map",
+ "entry_schema": {
+ "type": "string"
+ }
+ },
+ "key-dependencies": {
+ "required": true,
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.ResourceSource"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/load/model_type/node_type/tosca.nodes.ResourceSource.json b/ms/controllerblueprints/application/load/model_type/node_type/tosca.nodes.ResourceSource.json
new file mode 100644
index 00000000..2ef553e2
--- /dev/null
+++ b/ms/controllerblueprints/application/load/model_type/node_type/tosca.nodes.ResourceSource.json
@@ -0,0 +1,5 @@
+{
+ "description": "TOSCA base type for Resource Sources",
+ "version": "1.0.0",
+ "derived_from": "tosca.nodes.Root"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationExceptionHandler.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationExceptionHandler.java
index d02be5c2..d9380a2f 100644
--- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationExceptionHandler.java
+++ b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/apps/controllerblueprints/ApplicationExceptionHandler.java
@@ -16,6 +16,8 @@
package org.onap.ccsdk.apps.controllerblueprints;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
import org.onap.ccsdk.apps.controllerblueprints.service.common.ErrorMessage;
import org.springframework.http.HttpStatus;
@@ -28,14 +30,17 @@ import org.springframework.web.context.request.WebRequest;
@ControllerAdvice
@RestController
public class ApplicationExceptionHandler {
+ private static EELFLogger log = EELFManager.getInstance().getLogger(ApplicationExceptionHandler.class);
@ExceptionHandler(Exception.class)
public final ResponseEntity<ErrorMessage> handleAllExceptions(Exception ex, WebRequest request) {
+ log.error("Application Exception", ex);
ErrorMessage exceptionResponse = new ErrorMessage( ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value(), ex.getLocalizedMessage());
return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);
}
@ExceptionHandler(BluePrintException.class)
public final ResponseEntity<ErrorMessage> handleBlueprintException(BluePrintException ex, WebRequest request) {
+ log.error("Application Blueprint Exception", ex);
ErrorMessage exceptionResponse = new ErrorMessage( ex.getMessage(), ex.getCode(), ex.getLocalizedMessage());
return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);
}