<implementations> element

The <implementations> element is a container that includes rules, local parameters, and the operations for the NSM service template.

The purpose of the <implementations> element is to ensure that the NSM client user is presented with the correct implementation in a particular NSM service template based on the device that the NSM client user has selected to run the service on. Local client parameters such as inject, SQL, and HTTP parameters can also be contained in the <implementations> element and executed at this stage. For example, if SQL parameters are configured, the SQL statement is executed on the database connection that is specified in the <databaseConnection> element.

Operations are also contained in the <implementations> element. Operations can contain individual operations, all of which are selected for service execution.

The following XML shows the full implementation details to create zones for a firewall service. Note that the <implementations> and </implementations> elements encapsulate the XML elements and tags that define the zones for a firewall service with separate implementations for Juniper and CISCO Routers. Thus, if the NSM client user wants the Firewall service to run on a CISCO device, the operation ITNCM/FirewallCreateZones-Cisco-Router (<operation name="ITNCM/FirewallCreateZones-Cisco-Router") will run. If the NSM client user wants to execute the Firewall service on a Juniper router, then the operation ITNCM/FirewallCreateZones (<operation name="ITNCM/FirewallCreateZones") will run.

<implementations>
	<implementation description="Implementation Rule for all Cisco Routers">
		<rules>
			<rule type="DeviceType">
				<ruleProperty name="Vendor" value="Cisco"/>
				<ruleProperty name="Type" value="Router"/>
				<ruleProperty name="Model" value=".*"/>
				<ruleProperty name="OS" value=".*"/>
			</rule>
		</rules>
		<databaseConnection>
			<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
			<url>jdbc:oracle:thin:@test.example.com:testdb2</url>
			<username>oracleuser</username>
			<password>password</password>
		</databaseConnection>
    <clientParameterLists>
     <clientParameterList name="ZONEID">
 	      <parameter name="ZONE_NAME"/>
    </clientParameterList>
     <clientParameterList name="ROUTEDETAILS">
	      <parameter name="SOURCEROUTETABLE"/>
  	    <parameter name="TARGETROUTETABLE"/>
	      <parameter name="VIRTUALROUTERNAME"/> 
     </clientParameterList>
   </clientParameterLists>
		<sqlParameters>
			<sqlParameter>
				<name>SOURCEROUTETABLE</name>
				<sql>select servername from task where id = 3</sql>
			</sqlParameter>
		</sqlParameters>
    <serviceOperations>
    <serviceOperation name="createOperation" type="Create">
		<operations>
			<operation name="ITNCM/FirewallCreateZones-Cisco-Router" rollback="true" 
      type="COMMANDSET">
				<parameters>
					<parameter name="VIRTUALROUTERNAME"/>
					<parameter name="NAME"/>
					<parameter name="SOURCEROUTETABLE"/>
					<parameter name="TARGETROUTETABLE"/>
         <parameter name="ZONEID"/>
         <parameter name="ROUTEDETAILS"/>
		    </parameters>
			</operation>
		</operations>
    </serviceOperation>
   </serviceOperations>
	</implementation>
	<implementation description="Implementation Rule for all Juniper Routers">
		<rules>
			<rule type="DeviceType">
				<ruleProperty name="Vendor" value="Juniper"/>
				<ruleProperty name="Type" value="Router"/>
				<ruleProperty name="Model" value=".*"/>
				<ruleProperty name="OS" value=".*"/>
			</rule>
		</rules>
		<clientParameters>
			<clientParameter>
				<name>RIBGROUPNAME</name>
			</clientParameter>
		</clientParameters>
    <serviceOperations>
   <serviceOperation name="createOperation" type="Create"> 
		<operations>
			<operation name="ITNCM/FirewallCreateZones" rollback="true" type="COMMANDSET">
				<parameters>
					<parameter name="VIRTUALROUTERNAME"/>
					<parameter name="NAME"/>
					<parameter name="SOURCEROUTETABLE"/>
					<parameter name="TARGETROUTETABLE"/>
					<parameter name="RIBGROUPNAME"/>
				</parameters>
			</operation>
		</operations>
    </serviceOperation>
   </serviceOperations>
	</implementation>
</implementations>