Creating Ant Scripts that Execute Commands
You can create Apache Ant scripts that execute Command Central and Platform Manager command line interface commands.
When creating your Ant script, you must:
- Use the following fragment to declare
ccAnt tasks:<property environment="os" /> <property="cc.home" value="${os.CC_CLI_HOME}" /> <taskdef resource="com/webmethods/platform/management/client/ant/antlib.xml" <classpath> <fileset dir="${cc.home}/lib"> <include name="*.jar" /> </fileset> </classpath> </taskdef> - Create one or more targets that use the
ccsetupandcctasks. The following shows a sample:<target name="execute-commands-set1" description="Executes sagcc commands." > <ccsetup server="http://localhost:8090/cce" username="Administrator" password="manage" /> <cc command="list landscape nodes" outputFormat="xml" /> <cc ... /> ... </target> <target name="execute-commands-set2" description="Executes sagcc commands."> <ccsetup server="http://localhost:8092/spm" username="Administrator" password="manage" /> <cc command="list inventory products" outputFormat="json" /> <cc ... /> ... </target> ...