summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java12
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ModelType.java3
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java3
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java10
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json4
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json15
-rw-r--r--ms/controllerblueprints/parent/pom.xml2
7 files changed, 25 insertions, 24 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
index 81f7d7018..77de8e7cf 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/common/SwaggerGenerator.java
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2018 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,6 +41,7 @@ import java.util.*;
public class SwaggerGenerator {
private ServiceTemplate serviceTemplate;
+ public static final String INPUTS="inputs";
/**
* This is a SwaggerGenerator constructor
@@ -54,8 +56,7 @@ public class SwaggerGenerator {
* @return String
*/
public String generateSwagger() {
- String swaggerContent = null;
-
+
Swagger swagger = new Swagger().info(getInfo());
swagger.setPaths(getPaths());
@@ -86,7 +87,7 @@ public class SwaggerGenerator {
List<Parameter> parameters = new ArrayList<>();
Parameter in = new BodyParameter().schema(new RefModel("#/definitions/inputs"));
in.setRequired(true);
- in.setName("inputs");
+ in.setName(INPUTS);
parameters.add(in);
post.setParameters(parameters);
@@ -107,18 +108,17 @@ public class SwaggerGenerator {
Map<String, Model> models = new HashMap<>();
ModelImpl inputmodel = new ModelImpl();
- inputmodel.setTitle("inputs");
+ inputmodel.setTitle(INPUTS);
serviceTemplate.getTopologyTemplate().getInputs().forEach((propertyName, property) -> {
Property defProperty = getPropery(propertyName, property);
inputmodel.property(propertyName, defProperty);
});
- models.put("inputs", inputmodel);
+ models.put(INPUTS, inputmodel);
if (MapUtils.isNotEmpty(serviceTemplate.getDataTypes())) {
serviceTemplate.getDataTypes().forEach((name, dataType) -> {
ModelImpl model = new ModelImpl();
model.setDescription(dataType.getDescription());
- // model.setType("object");
if (dataType != null && MapUtils.isNotEmpty(dataType.getProperties())) {
dataType.getProperties().forEach((propertyName, property) -> {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ModelType.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ModelType.java
index d8fea60e5..33c7ae42b 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ModelType.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ModelType.java
@@ -84,7 +84,7 @@ public class ModelType implements Serializable {
@Override
public String toString() {
- String buffer = "[" + ", modelName = " + modelName +
+ return "[" + ", modelName = " + modelName +
", derivedFrom = " + derivedFrom +
", definitionType = " + definitionType +
", description = " + description +
@@ -93,7 +93,6 @@ public class ModelType implements Serializable {
", updatedBy = " + updatedBy +
", tags = " + tags +
"]";
- return buffer;
}
public String getModelName() {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java
index 42c8e83b2..5352d9c96 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/ResourceDictionary.java
@@ -78,7 +78,7 @@ public class ResourceDictionary implements Serializable {
@Override
public String toString() {
- String buffer = "[" + ", name = " + name +
+ return "[" + ", name = " + name +
", dataType = " + dataType +
", entrySchema = " + entrySchema +
", definition =" + definition +
@@ -87,7 +87,6 @@ public class ResourceDictionary implements Serializable {
", tags = " + tags +
", creationDate = " + creationDate +
"]";
- return buffer;
}
public String getName() {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
index 287d413cc..9b2209e8b 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ResourceDictionaryRest.java
@@ -47,13 +47,12 @@ public class ResourceDictionaryRest {
@PostMapping(path = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody
- ResourceDictionary saveResourceDictionary(@RequestBody ResourceDictionary dataDictionary)
- throws BluePrintException {
+ ResourceDictionary saveResourceDictionary(@RequestBody ResourceDictionary dataDictionary) {
return resourceDictionaryService.saveResourceDictionary(dataDictionary);
}
@DeleteMapping(path = "/{name}")
- public void deleteResourceDictionaryByName(@PathVariable(value = "name") String name) throws BluePrintException {
+ public void deleteResourceDictionaryByName(@PathVariable(value = "name") String name) {
resourceDictionaryService.deleteResourceDictionary(name);
}
@@ -65,14 +64,13 @@ public class ResourceDictionaryRest {
@PostMapping(path = "/by-names", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody
- List<ResourceDictionary> searchResourceDictionaryByNames(@RequestBody List<String> names)
- throws BluePrintException {
+ List<ResourceDictionary> searchResourceDictionaryByNames(@RequestBody List<String> names) {
return resourceDictionaryService.searchResourceDictionaryByNames(names);
}
@GetMapping(path = "/search/{tags}", produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody
- List<ResourceDictionary> searchResourceDictionaryByTags(@PathVariable(value = "tags") String tags) throws BluePrintException {
+ List<ResourceDictionary> searchResourceDictionaryByTags(@PathVariable(value = "tags") String tags) {
return resourceDictionaryService.searchResourceDictionaryByTags(tags);
}
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
index 782ed505c..b066dad63 100644
--- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
+++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
@@ -64,7 +64,7 @@
}
},
"interfaces": {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": {
+ "NetconfExecutorComponent": {
"operations": {
"process": {
"inputs": {
@@ -114,7 +114,7 @@
"component-node": {}
},
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
index d49ab8fec..5e41a507e 100644
--- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
+++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
@@ -336,7 +336,7 @@
}
},
"interfaces" : {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : {
+ "ResourceAssignmentComponent" : {
"operations" : {
"process" : {
"inputs" : {
@@ -395,6 +395,11 @@
},
"derived_from" : "tosca.nodes.Component"
},
+ "tosca.nodes.component.Jython" : {
+ "description" : "This is Jython Component",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
"tosca.nodes.DG" : {
"description" : "This is Directed Graph Node Type",
"version" : "1.0.0",
@@ -548,7 +553,7 @@
}
},
"interfaces" : {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode" : {
+ "NetconfExecutorComponent" : {
"operations" : {
"process" : {
"inputs" : {
@@ -609,7 +614,7 @@
}
}
},
- "derived_from" : "tosca.nodes.Component"
+ "derived_from" : "tosca.nodes.component.Jython"
}
},
"topology_template" : {
@@ -671,7 +676,7 @@
}
},
"interfaces" : {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode" : {
+ "NetconfExecutorComponent" : {
"operations" : {
"process" : {
"implementation" : {
@@ -715,7 +720,7 @@
"component-node" : { }
},
"interfaces" : {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : {
+ "ResourceAssignmentComponent" : {
"operations" : {
"process" : {
"inputs" : {
diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml
index e69a947b4..4f6a316b9 100644
--- a/ms/controllerblueprints/parent/pom.xml
+++ b/ms/controllerblueprints/parent/pom.xml
@@ -31,7 +31,7 @@
<spring.boot.version>2.0.6.RELEASE</spring.boot.version>
<spring.version>5.0.10.RELEASE</spring.version>
<kotlin.version>1.3.10</kotlin.version>
- <kotlin.maven.version>1.3.0</kotlin.maven.version>
+ <kotlin.maven.version>1.3.10</kotlin.maven.version>
<kotlin.couroutines.version>1.0.1</kotlin.couroutines.version>
<eelf.version>1.0.0</eelf.version>
<guava.version>26.0-jre</guava.version>