了解 Citrix ADC 应用程序模板和部署文件

导出 Citrix ADC 应用程序时,会自动创建以下两个文件:

  • Citrix ADC 应用程序模板文件。包含应用程序配置信息,如应用程序单元、规则和配置的策略。
  • 部署文件。包含特定于部署的信息,例如公共端点、服务、关联的 IP 地址和配置的变量。

在模板文件或部署文件中,每个应用程序配置信息单元封装在用于该单元类型的特定 XML 元素中。例如,每个公用端点和关联端点详细信息都封装在 <appendpoint> 和 </appendpoint> 标签中,所有端点元素都封装在 <appendpoint_list> 和 </appendpoint_list> 标签中。

注意:导出 Citrix ADC 应用程序后,可以在将应用程序导入 Citrix ADC 设备之前添加元素、移除元素和修改现有元素。

Citrix ADC 应用程序模板示例

下面是从名为 SharePoint_Team_Site 的 Citrix ADC 应用程序创建的模板文件的示例:

<?xml version="1.0" encoding="UTF-8" ?>
<template>
<template_info>
   <application_name>SharePoint_Team_Site</application_name>
   <templateversion_major>1</templateversion_major>
   <templateversion_minor>1</templateversion_minor>
   <author>Ed</author>
   <introduction>An application for managing a SharePoint team site with images, reports, and, XML content.</introduction>
   <summary>This template includes variables</summary>
   <version_major>9</version_major>
   <version_minor>3</version_minor>
   <build_number>38</build_number>
</template_info>
<apptemplate>
   <rewrite>
      <rewriteaction_list>
         <rewriteaction>
            <name>Rw_name</name>
            <type>replace</type>
            <target>HTTP.REQ.BODY(10000).AFTER_REGEX(re/number/).BEFORE_REGEX(re/address/)</target>
            <stringbuilderexpr>"NA"</stringbuilderexpr>
            <allow_unsafe_pi1>NO</allow_unsafe_pi1>
         </rewriteaction>
         <rewriteaction>
            .
            .
            .
         </rewriteaction>
         .
         .
         .
      </rewriteaction_list>
      <rewritepolicy_list>
         <rewritepolicy>
            <name>Rw_number_NA</name>
            <rule>HTTP.REQ.BODY(100000).CONTAINS("admin")</rule>
            <action>Rw_name</action>
         </rewritepolicy>
         <rewritepolicy>
            .
            .
            .
         </rewritepolicy>
         .
         .
         .
      </rewritepolicy_list>
   </rewrite>
   <appunit_list>
      <appunit>
         <name>SharePoint_Team_Sitedefault</name>
         <rule />
         <expressiontype>PE</expressiontype>
         <servicetype>HTTP</servicetype>
         <ipv46>0.0.0.0</ipv46>
         <ipmask>*</ipmask>
         <port>0</port>
         <range>1</range>
         <persistencetype>NONE</persistencetype>
         <timeout>2</timeout>
         <persistencebackup>NONE</persistencebackup>
         <backuppersistencetimeout>2</backuppersistencetimeout>
         <lbmethod>LEASTCONNECTION</lbmethod>
         <persistmask>255.255.255.255</persistmask>
         <v6persistmasklen>128</v6persistmasklen>
         <pq>OFF</pq>
         <sc>OFF</sc>
         <m>IP</m>
         <datalength>0</datalength>
         <dataoffset>0</dataoffset>
         <sessionless>DISABLED</sessionless>
         <state>ENABLED</state>
         <connfailover>DISABLED</connfailover>
         <clttimeout>180</clttimeout>
         <somethod>NONE</somethod>
         <sopersistence>DISABLED</sopersistence>
         <redirectportrewrite>DISABLED</redirectportrewrite>
         <downstateflush>DISABLED</downstateflush>
         <gt2gb>DISABLED</gt2gb>
         <ipmapping>0.0.0.0</ipmapping>
         <disableprimaryondown>DISABLED</disableprimaryondown>
         <insertvserveripport>OFF</insertvserveripport>
         <authentication>OFF</authentication>
         <authn401>OFF</authn401>
         <push>DISABLED</push>
         <pushlabel>none</pushlabel>
         <l2conn>OFF</l2conn>
      </appunit>
      <appunit>
         .
         .
         .
      </appunit>
      .
      .
      .
   </appunit_list>
   </apptemplate>
   <parameters>
      <property_list>
         <property>
            <variable_definition_list>
               <variable_definition>
                  <name>body_size</name>
                  <defaultvalue>10000</defaultvalue>
                  <description>Evaluation Scope</description>
                  <startindex>14</startindex>
                  <length>5</length>
               </variable_definition>
               .
               .
               .
            </variable_definition_list>
            <object_type>rewriteaction</object_type>
            <object_name>Rw_name</object_name>
            <name>target</name>
         </property>
         .
         .
         .
      </property_list>
   </parameters>
</template>

部署文件示例

下面是与上述示例中的 SharePoint_Team_Site 应用程序关联的部署文件:

<?xml version="1.0" encoding="UTF8" ?>
<template_deployment>
   <template_info>
      <application_name>SharePoint_Team_Site</application_name>
      <templateversion_major>1</templateversion_major>
      <templateversion_minor>1</templateversion_minor>
      <author>Ed</author>
      <introduction>An application for managing a SharePoint team site with images, reports, and, XML content.</introduction>
      <summary>This template includes variables</summary>
      <version_major>9</version_major>
      <version_minor>3</version_minor>
      <build_number>38</build_number>
   </template_info>
   <appendpoint_list>
      <appendpoint>
         <ipv46>10.111.111.1</ipv46>
         <port>80</port>
         <servicetype>HTTP</servicetype>
      </appendpoint>
   </appendpoint_list>
   <service_list>
      <service>
         <ip>10.102.29.5</ip>
         <port>80</port>
         <servicetype>HTTP</servicetype>
      </service>
      <service>
         .
         .
         .
      </service>
      .
      .
      .
   </service_list>
   <variable_list>
      <variable>
         <name>body_size</name>
         <description>Evaluation Scope</description>
         <value>10000</value>
      </variable>
      <variable>
         .
         .
         .
      </variable>
      .
      .
      .
   </variable_list>
</template_deployment>

了解 Citrix ADC 应用程序模板和部署文件