velocity templates for A1 Adapter DG's 41/101841/2
authorSandeep Shah <sandeeplinux1068@gmail.com>
Mon, 17 Feb 2020 15:41:23 +0000 (09:41 -0600)
committerDan Timoney <dtimoney@att.com>
Tue, 18 Feb 2020 20:48:14 +0000 (15:48 -0500)
New velocity templates to address JSON array
response from A1 mediator

Issue-ID: SDNC-1074
Signed-off-by: SandeepLinux <Sandeep.Shah@ibm.com>
Change-Id: I697b43e90762c5a1c5c7b51a2ae410763a6c61cf
Signed-off-by: Dan Timoney <dtimoney@att.com>
Former-commit-id: 09e4e9963d0214b795fab5bfe0d704945cab553d

platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policies.vtl [new file with mode: 0644]
platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy-instances.vtl [new file with mode: 0644]
platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy.vtl [new file with mode: 0644]

diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policies.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policies.vtl
new file mode 100644 (file)
index 0000000..8282c7b
--- /dev/null
@@ -0,0 +1,7 @@
+## Velocity template for creating payload getPolicyTypes response
+#set($begCntr=0)
+#set($endCntr=0)
+#set($entries=$ctx.getAttribute("a1MediatorRsp._length"))
+#set($endCntr=$endCntr.parseInt($entries))
+#set( $endCntr = $endCntr - 1)
+[#foreach($no in [$begCntr..$endCntr])$ctx.getAttribute("a1MediatorList.[$no]")#if( $foreach.count < $endCntr+1), #end #end]
diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy-instances.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy-instances.vtl
new file mode 100644 (file)
index 0000000..89bc370
--- /dev/null
@@ -0,0 +1,7 @@
+## Velocity template for creating payload getPolicyInstances response
+#set($begCntr=0)
+#set($endCntr=0)
+#set($entries=$ctx.getAttribute("a1MediatorRsp._length"))
+#set($endCntr=$endCntr.parseInt($entries))
+#set( $endCntr = $endCntr - 1)
+[#foreach($no in [$begCntr..$endCntr])$ctx.getAttribute("a1MediatorPolicyInstancesList.[$no]")#if( $foreach.count < $endCntr+1), #end #end]
diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-get-policy.vtl
new file mode 100644 (file)
index 0000000..452fa13
--- /dev/null
@@ -0,0 +1,2 @@
+## Velocity template for creating payload getPolicyType response
+$ctx.getAttribute("a1MediatorgetPolicyType")