Command Central 10.1 | Command Central Developer Reference | Using the Command Line Interface | Invoking Commands from Scripts | Creating Ant Scripts that Execute Commands
 
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:
1. Use the following fragment to declare cc Ant tasks:
<property environment="os" />   
<property="cc.home" value="${os.CC_CLI_HOME}" />   
    
<taskdef resource="com/softwareag/platform/management/client/ant/antlib.xml"             
         <classpath>   
            <fileset dir="${cc.home}/lib">   
                 <include name="*.jar" />   
            </fileset>   
         </classpath>   
</taskdef>
2. Create one or more targets that use the ccsetup and cc tasks. 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>   
 ...