diff options
author | Sandeep Shah <sandeeplinux1068@gmail.com> | 2019-12-17 11:21:38 -0600 |
---|---|---|
committer | Sandeep Shah <sandeeplinux1068@gmail.com> | 2019-12-19 06:03:30 -0600 |
commit | 3b13ec30b442b68fd757065fa65d049e7db26774 (patch) | |
tree | dffd48159a9f3cefc744b053dd5bc2c01c928771 /platform-logic/restapi-templates/src/main | |
parent | f5a63c57879141bd9e1054de41a901cdbd802e7f (diff) |
Velocity templates for A1 Adapter DG's
Velocity templates used in DG's for A1 policy type
and policy instance creation
Issue-ID: SDNC-1011
Signed-off-by: SandeepLinux <Sandeep.Shah@ibm.com>
Change-Id: Ie16d89271a9ce058e47f879ad107545df8da03c8
Former-commit-id: febc82515ae59dc9247d78914fc1a00066d20568
Diffstat (limited to 'platform-logic/restapi-templates/src/main')
7 files changed, 41 insertions, 0 deletions
diff --git a/platform-logic/restapi-templates/src/main/velocity/a1-policy-instance-property-payload-template.vtl b/platform-logic/restapi-templates/src/main/velocity/a1-policy-instance-property-payload-template.vtl new file mode 100644 index 00000000..c743d2b5 --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1-policy-instance-property-payload-template.vtl @@ -0,0 +1,10 @@ +## Velocity template for creating payload for creating A1 Policy instance +#set($begCntr=0) +#set($endCntr=0) +#set($entries=$ctx.getAttribute("create-policy-instance-input.properties_length")) +#set($endCntr=$endCntr.parseInt($entries)) +#set( $endCntr = $endCntr - 1) +{#foreach($no in [$begCntr..$endCntr]) +"$ctx.getAttribute("create-policy-instance-input.properties[$no].property-name")" : +$ctx.getAttribute("create-policy-instance-input.properties[$no].property-value") +#if( $foreach.count < $endCntr+1), #end #end} diff --git a/platform-logic/restapi-templates/src/main/velocity/a1-policy-type-create-schema-property-payload-template.vtl b/platform-logic/restapi-templates/src/main/velocity/a1-policy-type-create-schema-property-payload-template.vtl new file mode 100644 index 00000000..0230addd --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1-policy-type-create-schema-property-payload-template.vtl @@ -0,0 +1,26 @@ +## Velocity template for creating the payload for creating A1 policy type +#set($begCntr1=0) +#set($endCntr1=0) +#set($entries=$ctx.getAttribute("create-policy-type-input.properties_length")) +#set($endCntr1=$endCntr1.parseInt($entries)) +#set( $endCntr1 = $endCntr1 - 1) +{ + "description": "$ctx.getAttribute("create-policy-type-input.description")", + "name": "$ctx.getAttribute("create-policy-type-input.name")", + "policy_type_id": $ctx.getAttribute("create-policy-type-input.policy-type-id"), + "create_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "type": "object", + "properties": {#foreach($no1 in [$begCntr1..$endCntr1]) + "$ctx.getAttribute("create-policy-type-input.properties[$no1].property-name")" : { + #set($begCntr2=0) + #set($endCntr2=0) + #set($entries=$ctx.getAttribute("create-policy-type-input.properties[$no1].policy-statements_length")) + #set($endCntr2=$endCntr2.parseInt($entries)) + #set( $endCntr2 = $endCntr2 - 1) + #foreach($no2 in [$begCntr2..$endCntr2]) + "$ctx.getAttribute("create-policy-type-input.properties[$no1].policy-statements[$no2].policy-statement")" : + "$ctx.getAttribute("create-policy-type-input.properties[$no1].policy-statements[$no2].policy-statement-value")" + #if( $no2 < $endCntr2), #end#end}#if( $no1 < $endCntr1), #end #end +}}} diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getNearRT-RICs-payload.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getNearRT-RICs-payload.vtl new file mode 100644 index 00000000..cfe7f03e --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getNearRT-RICs-payload.vtl @@ -0,0 +1 @@ +## Velocity template for getNearRT-RICs DMAAP response payload diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyInstances-payload.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyInstances-payload.vtl new file mode 100644 index 00000000..0d007ac9 --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyInstances-payload.vtl @@ -0,0 +1 @@ +## Velocity template for getPolicyInstances DMAAP response payload diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyType-payload.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyType-payload.vtl new file mode 100644 index 00000000..19449d08 --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyType-payload.vtl @@ -0,0 +1 @@ +## Velocity template for getPolicyType DMAAP response payload diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyTypes-payload.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyTypes-payload.vtl new file mode 100644 index 00000000..cf396f0f --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getPolicyTypes-payload.vtl @@ -0,0 +1 @@ +## Velocity template for getPolicyTypes DMAAP response payload diff --git a/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getStatus-payload.vtl b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getStatus-payload.vtl new file mode 100644 index 00000000..3af64402 --- /dev/null +++ b/platform-logic/restapi-templates/src/main/velocity/a1Mediator-dmaap-publish-getStatus-payload.vtl @@ -0,0 +1 @@ +## Velocity template for getStatus DMAAP response payload |