Add example for creating apex policy in Tosca format
Change-Id: I30e7d162a2aecdfe5c51e920b48d659130ae74e4
Issue-ID: POLICY-2127
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
diff --git a/examples/examples-onap-vcpe/pom.xml b/examples/examples-onap-vcpe/pom.xml
index 89d688d..fd59094 100644
--- a/examples/examples-onap-vcpe/pom.xml
+++ b/examples/examples-onap-vcpe/pom.xml
@@ -33,6 +33,7 @@
<properties>
<policymodel.name>ONAPvCPEPolicyModel</policymodel.name>
+ <toscapolicy.name>ONAPvCPEToscaPolicy</toscapolicy.name>
<apex-domains-onap-vcpe-dir>${project.basedir}/src</apex-domains-onap-vcpe-dir>
</properties>
@@ -123,6 +124,31 @@
</execution>
</executions>
</plugin>
+ <!-- Generate the APEX ToscaPolicy JSON file-->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-tosca-policy</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain</mainClass>
+ <classpathScope>compile</classpathScope>
+ <arguments>
+ <argument>--command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex</argument>
+ <argument>--output-tosca-file=${project.build.directory}/classes/${toscapolicy.name}.json</argument>
+ <argument>--log-file=${project.build.directory}/${policymodel.name}_policygeneration.log</argument>
+ <argument>--apex-config-file=${project.basedir}/src/main/resources/examples/config/ONAPvCPE/ApexConfig.json</argument>
+ <argument>--tosca-template-file=${project.basedir}/src/main/resources/tosca/ToscaTemplate.json</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>