aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Closset <christophe.closset@intl.att.com>2020-04-23 08:49:36 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-23 08:49:36 +0000
commit6c42be8a5b9a90c3a2c2907174d4264cf5606ac4 (patch)
tree1fa699ffdd06a65c79cf1e76103429d3bf347f81 /src
parente57ccc972e080ce039d7a1325332fcae3b75bbf1 (diff)
parentab9bc444f84f2cbb89747543657de3a54e4554b8 (diff)
Merge "Fix entityId bug"
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java11
-rw-r--r--src/main/resources/META-INF/resources/swagger.html19
-rw-r--r--src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json4
-rw-r--r--src/test/resources/tosca/operational-policy-cds-payload-with-list.json4
-rw-r--r--src/test/resources/tosca/operational-policy-json-schema.json6
5 files changed, 39 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
index 690b7ae1..8bd8aac7 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java
@@ -138,6 +138,15 @@ public class OperationalPolicyRepresentationBuilder {
return vnfSchemaArray;
}
+ private static JsonArray createBlankEntry() {
+ JsonArray result = new JsonArray();
+ JsonObject blankObject = new JsonObject();
+ blankObject.addProperty("title", "User defined");
+ blankObject.add("properties", new JsonObject());
+ result.add(blankObject);
+ return result;
+ }
+
private static JsonArray createVfModuleSchema(Service modelService, boolean generateType) {
JsonArray vfModuleOneOfSchemaArray = new JsonArray();
JsonObject modelVfModules = modelService.getResourceByType("VFModule");
@@ -190,6 +199,8 @@ public class OperationalPolicyRepresentationBuilder {
*/
public static JsonArray createAnyOfArray(Service modelJson, boolean generateType) {
JsonArray targetOneOfStructure = new JsonArray();
+ // First entry must be user defined
+ targetOneOfStructure.addAll(createBlankEntry());
targetOneOfStructure.addAll(createVnfSchema(modelJson, generateType));
targetOneOfStructure.addAll(createVfModuleSchema(modelJson, generateType));
return targetOneOfStructure;
diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html
index 1f8cc9eb..6bce8367 100644
--- a/src/main/resources/META-INF/resources/swagger.html
+++ b/src/main/resources/META-INF/resources/swagger.html
@@ -566,7 +566,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_produces_17">2.18.3. Produces</a></li>
</ul>
</li>
-<li><a href="#_route56">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a>
+<li><a href="#_route56">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a>
<ul class="sectlevel3">
<li><a href="#_parameters_13">2.19.1. Parameters</a></li>
<li><a href="#_responses_19">2.19.2. Responses</a></li>
@@ -737,13 +737,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="sect2">
<h3 id="_version_information"><a class="anchor" href="#_version_information"></a><a class="link" href="#_version_information">1.1. Version information</a></h3>
<div class="paragraph">
-<p><em>Version</em> : 5.0.2-SNAPSHOT</p>
+<p><em>Version</em> : 5.0.5-SNAPSHOT</p>
</div>
</div>
<div class="sect2">
<h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3>
<div class="paragraph">
-<p><em>Host</em> : localhost:34889<br>
+<p><em>Host</em> : localhost:40065<br>
<em>BasePath</em> : /restservices/clds/<br>
<em>Schemes</em> : HTTP</p>
</div>
@@ -1764,7 +1764,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
</div>
<div class="sect2">
-<h3 id="_route56"><a class="anchor" href="#_route56"></a><a class="link" href="#_route56">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}</a></h3>
+<h3 id="_route56"><a class="anchor" href="#_route56"></a><a class="link" href="#_route56">2.19. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}</a></h3>
<div class="sect3">
<h4 id="_parameters_13"><a class="anchor" href="#_parameters_13"></a><a class="link" href="#_parameters_13">2.19.1. Parameters</a></h4>
<table class="tableblock frame-all grid-all stretch">
@@ -1789,6 +1789,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</tr>
<tr>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyName</strong><br>
+<em>required</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>Path</strong></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>policyType</strong><br>
<em>required</em></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
@@ -4095,6 +4101,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_jsonobject">JsonObject</a></p></td>
</tr>
<tr>
+<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>legacy</strong><br>
+<em>optional</em></p></td>
+<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
+</tr>
+<tr>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><strong>loopElementModel</strong><br>
<em>optional</em></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="#_loopelementmodel">LoopElementModel</a></p></td>
diff --git a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
index ad985292..e03e48fc 100644
--- a/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
+++ b/src/test/resources/tosca/new-converter/tosca_apex_with_metadata.json
@@ -258,6 +258,10 @@
"description": "Map of values that identify the resource. If none are provided, it is assumed that the\nentity that generated the ONSET event will be the target.\n",
"anyOf": [
{
+ "title": "User defined",
+ "properties": {}
+ },
+ {
"title": "VNF-vLoadBalancerMS 0",
"properties": {
"resourceID": {
diff --git a/src/test/resources/tosca/operational-policy-cds-payload-with-list.json b/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
index d9b5aee9..190636c4 100644
--- a/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
+++ b/src/test/resources/tosca/operational-policy-cds-payload-with-list.json
@@ -371,6 +371,10 @@
}
},
{
+ "title": "User defined",
+ "properties": {}
+ },
+ {
"title": "VNF-vLoadBalancerMS 0",
"properties": {
"type": {
diff --git a/src/test/resources/tosca/operational-policy-json-schema.json b/src/test/resources/tosca/operational-policy-json-schema.json
index 081e0f25..32adce9b 100644
--- a/src/test/resources/tosca/operational-policy-json-schema.json
+++ b/src/test/resources/tosca/operational-policy-json-schema.json
@@ -729,6 +729,10 @@
}
},
{
+ "title": "User defined",
+ "properties": {}
+ },
+ {
"title": "VNF-vLoadBalancerMS 0",
"properties": {
"type": {
@@ -941,4 +945,4 @@
}
}
}
-}
+} \ No newline at end of file