aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dtimoney@att.com>2019-10-01 15:14:29 -0400
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-10-02 14:36:16 -0400
commit477f27624590d68e6c64b8939dd6b00737ed3736 (patch)
tree9ca1b70be4af5195b0a9da64426f6c5a8174d1a1
parentda08df2acb625b0c318b01f366d8fe1bc8f10cf8 (diff)
Fixes for async response to SO
1) Wrong user name configured for SO interface 2) Accept header needs to be set to 'text/plain' 3) Content-Type needs to be explicitly set to 'application/json' 4) Template is missing outer "input" tag 5) Message needs to be in XML format, not JSON Change-Id: Icd06d12ff8576d2dd560ea452d0a14c3de643a00 Issue-ID: SDNC-927 Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com> Former-commit-id: 74ad4c7e51bbfa01caa2e504779b47dd86861428
-rw-r--r--installation/src/main/properties/generic-resource-api-dg.properties2
-rw-r--r--platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_send-so-response.json120
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_send-so-response.xml5
-rw-r--r--platform-logic/restapi-templates/src/main/json/so-response.json2
-rw-r--r--platform-logic/restapi-templates/src/main/xml/so-response.xml10
5 files changed, 76 insertions, 63 deletions
diff --git a/installation/src/main/properties/generic-resource-api-dg.properties b/installation/src/main/properties/generic-resource-api-dg.properties
index 48c510ba..b303d992 100644
--- a/installation/src/main/properties/generic-resource-api-dg.properties
+++ b/installation/src/main/properties/generic-resource-api-dg.properties
@@ -13,7 +13,7 @@ restapi.connection-oof-url=http://oof-osdf:8698/api/oof/v1/route
naming.gen-name.url=http://neng-serv:8080
naming.gen-name.user=ccsdkapps
naming.gen-name.pwd=ccsdkapps
-so.user=InfraPortalClient
+so.user=sdncaBpmn
so.pwd=password1$
cds.url=http://cds-blueprints-processor-http:8080
cds.user=ccsdkapps
diff --git a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_send-so-response.json b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_send-so-response.json
index 1a8e85cc..f608e97f 100644
--- a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_send-so-response.json
+++ b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_send-so-response.json
@@ -1,36 +1,36 @@
[
{
- "id": "1be7c5d.ad3cd3a",
+ "id": "55167d1e.ed2dbc",
"type": "dgstart",
"name": "DGSTART",
"outputs": 1,
- "x": 186.2630157470703,
- "y": 83.76301574707031,
- "z": "9c4d3573.f087a8",
+ "x": 142,
+ "y": 118,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "7fd0368c.d911a8"
+ "4fe16795.505a68"
]
]
},
{
- "id": "3bd2ce4a.136122",
+ "id": "12fd478e.613338",
"type": "method",
"name": "method send-so-response",
"xml": "<method rpc='send-so-response' mode='sync'>\n",
"comments": "",
"outputs": 1,
- "x": 331.2749328613281,
- "y": 148.46936988830566,
- "z": "9c4d3573.f087a8",
+ "x": 287.0119171142578,
+ "y": 182.70635414123535,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "10c7b604.2a55ba"
+ "91e959be.0046b8"
]
]
},
{
- "id": "7fd0368c.d911a8",
+ "id": "4fe16795.505a68",
"type": "service-logic",
"name": "GENERIC-RESOURCE-API ${project.version}",
"module": "GENERIC-RESOURCE-API",
@@ -38,142 +38,142 @@
"comments": "",
"xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>",
"outputs": 1,
- "x": 448.50121307373047,
- "y": 83.9535083770752,
- "z": "9c4d3573.f087a8",
+ "x": 404.23819732666016,
+ "y": 118.19049263000488,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "3bd2ce4a.136122"
+ "12fd478e.613338"
]
]
},
{
- "id": "af9d7c89.15796",
+ "id": "153e93ce.9ebf4c",
"type": "execute",
"name": "execute RestApiCallNode - POST ack-final to SO",
- "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n <parameter name='templateFileName' value=\"`$prop.restapi.templateDir + '/' + 'so-response.json'`\" />\n <parameter name='restapiUrl' value=\"`$so.notification-url`\" />\n <parameter name='restapiUser' value='`$prop.so.user`' />\n <parameter name='restapiPassword' value='`$prop.so.pwd`' />\n <parameter name='format' value='json' />\n <parameter name='httpMethod' value='POST' />\n <parameter name=\"responsePrefix\" value=\"soResponse-vnf-assign\" />\n\n",
+ "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n <parameter name='templateFileName' value=\"`$prop.restapi.templateDir + '/' + 'so-response.xml'`\" />\n <parameter name='restapiUrl' value=\"`$so.notification-url`\" />\n <parameter name='restapiUser' value='`$prop.so.user`' />\n <parameter name='restapiPassword' value='`$prop.so.pwd`' />\n <parameter name='accept' value='text/plain' />\n <parameter name='contentType' value='application/xml' />\n <parameter name='httpMethod' value='POST' />\n <parameter name=\"responsePrefix\" value=\"soResponse-vnf-assign\" />\n\n",
"comments": "",
"outputs": 1,
- "x": 788.8093566894531,
- "y": 293.73350286483765,
- "z": "9c4d3573.f087a8",
+ "x": 744.5463409423828,
+ "y": 327.97048711776733,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "d61676da.12fe28",
- "87d46700.e01758"
+ "10150aac.baf595",
+ "7abea62f.e688e"
]
]
},
{
- "id": "d61676da.12fe28",
+ "id": "10150aac.baf595",
"type": "failure",
"name": "failure",
"xml": "<outcome value='failure'>\n",
"comments": "",
"outputs": 1,
- "x": 1075.700740814209,
- "y": 270.31422758102417,
- "z": "9c4d3573.f087a8",
+ "x": 1031.4377250671387,
+ "y": 304.55121183395386,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "7e23e4c2.43ac6c"
+ "c2af9654.82f04"
]
]
},
{
- "id": "deb0a632.ae9ed8",
+ "id": "1138f7b0.eeb818",
"type": "configure",
"name": "set error-message",
"xml": "<set>\n<parameter name=\"error-message\" value=\"`'Error sending SO response. ' + $error-message`\" />\n",
"comments": "",
"outputs": 1,
- "x": 1529.511962890625,
- "y": 247.45922470092773,
- "z": "9c4d3573.f087a8",
+ "x": 1485.2489471435547,
+ "y": 281.6962089538574,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[]
]
},
{
- "id": "87d46700.e01758",
+ "id": "7abea62f.e688e",
"type": "not-found",
"name": "not-found",
"xml": "<outcome value='not-found'>\n",
"comments": "",
"outputs": 1,
- "x": 1087.0593032836914,
- "y": 317.4833388328552,
- "z": "9c4d3573.f087a8",
+ "x": 1042.796287536621,
+ "y": 351.7203230857849,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "7e23e4c2.43ac6c"
+ "c2af9654.82f04"
]
]
},
{
- "id": "10c7b604.2a55ba",
+ "id": "91e959be.0046b8",
"type": "block",
"name": "block : atomic",
"xml": "<block atomic=\"true\">",
"atomic": "true",
"outputs": 1,
- "x": 469.0129928588867,
- "y": 263.7629699707031,
- "z": "9c4d3573.f087a8",
+ "x": 424.7499771118164,
+ "y": 297.9999542236328,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "af9d7c89.15796",
- "aa7b88f3.7101b8"
+ "153e93ce.9ebf4c",
+ "de88f47c.4b8e38"
]
]
},
{
- "id": "aa7b88f3.7101b8",
+ "id": "de88f47c.4b8e38",
"type": "set",
"name": "set so.response-message",
"xml": "<set>\n<parameter name=\"so.response-message\" value=\"`$error-message`\" />",
"comments": "",
- "x": 715.0130081176758,
- "y": 243.7629656791687,
- "z": "9c4d3573.f087a8",
+ "x": 670.7499923706055,
+ "y": 277.9999499320984,
+ "z": "4c84aa17.c3c6dc",
"wires": []
},
{
- "id": "5b71151b.49bd3c",
+ "id": "aed75eca.5a9ad",
"type": "comment",
"name": "Caller must set all the params required for SO response",
"info": "so.ack-final-indicator\nso.notification-url\nso.response-code\nso.response-message\nso.svc-request-id\nso.service-instance-id\nso.service-type",
"comments": "",
- "x": 937.5130081176758,
- "y": 152.51301765441895,
- "z": "9c4d3573.f087a8",
+ "x": 893.2499923706055,
+ "y": 186.75000190734863,
+ "z": "4c84aa17.c3c6dc",
"wires": []
},
{
- "id": "535d0ddc.6a9ff4",
+ "id": "d3ee031.03b0d8",
"type": "returnFailure",
"name": "return failure",
"xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n <parameter name=\"error-message\" value=\"`$error-message`\" />\n",
"comments": "",
- "x": 1510.096477508545,
- "y": 317.67168045043945,
- "z": "9c4d3573.f087a8",
+ "x": 1465.8334617614746,
+ "y": 351.90866470336914,
+ "z": "4c84aa17.c3c6dc",
"wires": []
},
{
- "id": "7e23e4c2.43ac6c",
+ "id": "c2af9654.82f04",
"type": "block",
"name": "block : atomic",
"xml": "<block atomic=\"true\">",
"atomic": "true",
"outputs": 1,
- "x": 1303.762939453125,
- "y": 288.76298904418945,
- "z": "9c4d3573.f087a8",
+ "x": 1259.4999237060547,
+ "y": 322.99997329711914,
+ "z": "4c84aa17.c3c6dc",
"wires": [
[
- "deb0a632.ae9ed8",
- "535d0ddc.6a9ff4"
+ "1138f7b0.eeb818",
+ "d3ee031.03b0d8"
]
]
}
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_send-so-response.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_send-so-response.xml
index bf4c2641..521f40f5 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_send-so-response.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_send-so-response.xml
@@ -7,11 +7,12 @@
<parameter name="so.response-message" value="`$error-message`" />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'so-response.json'`" />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'so-response.xml'`" />
<parameter name='restapiUrl' value="`$so.notification-url`" />
<parameter name='restapiUser' value='`$prop.so.user`' />
<parameter name='restapiPassword' value='`$prop.so.pwd`' />
- <parameter name='format' value='json' />
+ <parameter name='accept' value='text/plain' />
+ <parameter name='contentType' value='application/xml' />
<parameter name='httpMethod' value='POST' />
<parameter name="responsePrefix" value="soResponse-vnf-assign" />
<outcome value='failure'>
diff --git a/platform-logic/restapi-templates/src/main/json/so-response.json b/platform-logic/restapi-templates/src/main/json/so-response.json
index 2e47fb0f..33d54c80 100644
--- a/platform-logic/restapi-templates/src/main/json/so-response.json
+++ b/platform-logic/restapi-templates/src/main/json/so-response.json
@@ -1,4 +1,5 @@
{
+ "input" : {
"service-information": {
"service-instance-id": ${so.service-instance-id},
"service-type": ${so.service-type}
@@ -7,4 +8,5 @@
"response-code": ${so.response-code},
"response-message": ${so.response-message},
"ack-final-indicator": ${so.ack-final-indicator}
+ }
}
diff --git a/platform-logic/restapi-templates/src/main/xml/so-response.xml b/platform-logic/restapi-templates/src/main/xml/so-response.xml
new file mode 100644
index 00000000..0913c1ba
--- /dev/null
+++ b/platform-logic/restapi-templates/src/main/xml/so-response.xml
@@ -0,0 +1,10 @@
+<input>
+ <service-information>
+ <service-instance-id>${so.service-instance-id}</service-instance-id>
+ <service-type>${so.service-type}</service-type>
+ </service-information>
+ <svc-request-id>${so.svc-request-id}</svc-request-id>
+ <response-code>${so.response-code}</response-code>
+ <response-message>${so.response-message}</response-message>
+ <ack-final-indicator>${so.ack-final-indicator}</ack-final-indicator>
+</input>