<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
- Licensed Materials - Property of IBM Corp.
- IBM UrbanCode Deploy
- (c) Copyright IBM Corporation 2011, 2016. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-->

<plugin xmlns="http://www.urbancode.com/PluginXMLSchema_v1" xmlns:server="http://www.urbancode.com/PluginServerXMLSchema_v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <header>
    <identifier id="com.urbancode.air.plugin.bigfix" name="BigFix" version="1"/>
    <description>
      BigFix Integration with UrbanCode Deploy for security and management solutions. 
    </description>
    <tag>IT Management/BigFix</tag>
  </header>
  <step-type name="Start Action">
    <description>Create and Start a new Action</description>
    <properties>
      <property name="xmlAction" required="true">
        <property-ui type="textAreaBox"
                     label="XML Action"
                     description="The XML Action in BES.xsd format to create and start. A full file path containing the XML is also allowed."/>
      </property>
      <property name="hostname" required="true">
        <property-ui type="textBox"
                     label="Hostname"
                     description="The hostname to connect to the BigFix server. Example: https://bigfix-server:8080"/>
      </property>
      <property name="username" required="true">
        <property-ui type="textBox"
                     label="Username"
                     description="The username used to access the BigFix server."/>
      </property>
      <property name="password" required="true">
        <property-ui type="secureBox"
                     label="Password"
                     description="The password used to access the BigFix server."/>
      </property>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${GROOVY_HOME}/bin/groovy">
      <arg value="-cp"/>
      <arg path="classes:lib/commons-codec.jar:lib/log4j.jar:lib/httpcore.jar:lib/httpclient.jar:lib/HttpComponents-Util.jar:lib/CommonsUtil.jar"/>
      <arg file="startAction.groovy"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>
</plugin>
