Non-HTTP Services

This section contains relatively simple examples of declarations that create non-HTTP services or objects, such as TCP, UDP, and so on.

Use the index on the right to locate specific examples.

Important

Most of the example declarations have been updated in the documentation for AS3 3.20 to remove any template that was specified, and rename any virtual services that used the name serviceMain to service. In AS3 3.20, the generic template is the default, which allows services to use any name.

This also means that many of these declarations on a version prior to 3.20 they will fail unless you add a template. See this FAQ entry and this Troubleshooting entry for more information.

1: UDP virtual service

This example is for a UDP DNS load balancer service, and creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_non_http_01.
  • A UDP virtual server named service on port 53.
  • A pool named Pool1 monitored by the default ICMP health monitor.
{
  "class": "AS3",
  "action": "deploy",
  "declaration": {
    "class": "ADC",
    "schemaVersion": "3.0.0",
    "id": "UDP_DNS_Sample",
    "label": "UDP_DNS_Sample",
    "remark": "Sample of a UDP DNS Load Balancer Service",
    "Sample_non_http_01": {
      "class": "Tenant",
      "DNS_Service": {
        "class": "Application",
        "service": {
          "class": "Service_UDP",
          "virtualPort": 53,
          "virtualAddresses": [
            "10.1.20.121"
          ],
          "pool": "Pool1"
        },
        "Pool1": {
          "class": "Pool",
          "monitors": [
            "icmp"
          ],
          "members": [
            {
              "servicePort": 53,
              "serverAddresses": [
                "10.1.10.100"
              ]
            },
            {
              "servicePort": 53,
              "serverAddresses": [
                "10.1.10.101"
              ]
            }
          ]
        }
      }
    }
  }
 }

Back to top

2: TCP load-balanced to ICAP with custom monitor

This example creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_non_http_02.
  • A TCP virtual server named service on port 1344 (called _A1 in the BIG-IP GUI).
  • A TCP profile using the mptcp-mobile-optimized parent.
  • A pool named svc_pool containing two members (also using port 1344).
  • A custom TCP health monitor with custom Send and Receive strings for ICAP.
{
  "class": "AS3",
  "action": "deploy",
  "persist": true,
  "declaration": {
    "class": "ADC",
    "schemaVersion": "3.0.0",
    "id": "123456abcd",
    "label": "Sample TCP 1",
    "remark": "TCP load-balanced to ICAP with custom monitor",
    "Sample_non_http_02": {
      "class": "Tenant",
      "A1": {
        "class": "Application",
        "service": {
          "class": "Service_TCP",
          "virtualAddresses": [
            "10.0.5.10"
          ],
          "virtualPort": 1344,
          "pool": "svc_pool"
        },
        "svc_pool": {
          "class": "Pool",
          "monitors": [{
            "use": "icap_monitor"
          }],
          "members": [{
            "servicePort": 1344,
            "serverAddresses": [
              "192.0.5.10",
              "192.0.5.11"
            ]
          }]
        },
        "icap_monitor": {
          "class": "Monitor",
          "monitorType": "tcp",
          "send": "OPTIONS icap://icap.example.net/ ICAP/1.0\r\nUser-Agent: f5-ADC\r\n\r\n",
          "receive": "ICAP/1.0 200 OK",
          "adaptive": false
        }
      }
    }
  }
}

Back to top

3: Using BIG-IP DNS features in a declaration

This example shows how you can use some BIG-IP DNS features (DNS profiles, TSIG keys, DNS Zones, Nameservers) in an AS3 declaration. The DNS features we use in this declaration are well-documented in the BIG-IP DNS Services: Implementations guide, so for specific information, see this documentation. Also see the Schema Reference for usage options for using these features in your AS3 declarations.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_non_http_03.
  • A virtual server named service.
  • A DNS Zone that uses DNS Express.
  • A DNS Nameserver Zone.
  • A DNS TSIG Key using the hmacmd5 algorithm.
{
    "class": "ADC",
    "updateMode": "selective",
    "schemaVersion": "3.0.0",
    "id": "DNS",
    "Sample_non_http_03": {
        "class": "Tenant",
        "TEST_DNS_Zone": {
            "class": "Application",
            "dnsZone": {
                "class": "DNS_Zone",
                "label": "dnsZone",
                "remark": "DNS Zone test",
                "dnsExpress": {
                    "enabled": true,
                    "nameserver": {
                        "use": "dnsNameserverZone"
                    },
                    "notifyAction": "consume",
                    "allowNotifyFrom": [
                        "10.1.1.1"
                    ],
                    "verifyNotifyTsig": false
                },
                "responsePolicyEnabled": true,
                "serverTsigKey": {
                    "use": "tsigKeyZone"
                },
                "transferClients": [
                    {
                        "use": "dnsNameserverZone"
                    }
                ]
            },
            "dnsNameserverZone": {
                "class": "DNS_Nameserver",
                "label": "dnsNameserverZone",
                "remark": "A DNS Nameserver",
                "address": "10.1.1.2",
                "port": 53,
                "routeDomain": {
                    "bigip": "/Common/0"
                },
                "tsigKey": {
                    "use": "tsigKeyZone"
                }
            },
            "tsigKeyZone": {
                "class": "DNS_TSIG_Key",
                "label": "tsigKeyZone",
                "remark": "TSIG Key test",
                "algorithm": "hmacmd5",
                "secret": {
                    "ciphertext": "ZjVmNQ==",
                    "miniJWE": true,
                    "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
                    "ignoreChanges": true,
                    "allowReuse": false
                }
            }
        }
    },
    "DNS_PROFILE_1": {
        "class": "Tenant", 
        "DNS_PROFILE_1": {
            "class": "Application",
            "service": {
                "class": "Service_UDP",
                "virtualPort": 80,
                "virtualAddresses": [
                    "198.19.192.210"
                ],
                "profileUDP": {
                    "use": "profileUdp"
                },

                "profileDNS": {
                    "use": "profileDnsHW"
                }
            },
            "profileDnsHW": {
                "class": "DNS_Profile",
                "label": "profileDnsHW",
                "remark": "DNS Profile test",
                "parentProfile": {
                    "bigip": "/Common/dns"
                },
                "rapidResponseEnabled": false,
                "rapidResponseLastAction": "allow",
                "hardwareQueryValidationEnabled": true,
                "hardwareResponseCacheEnabled": true,
                "dnssecEnabled": false,
                "globalServerLoadBalancingEnabled": false,
                "dnsExpressEnabled": false,
                "cacheEnabled": false,
                "dns64Mode": "secondary",
                "dns64Prefix": "0:0:0:0:0:0:0:0",
                "dns64AdditionalSectionRewrite": "any",
                "unhandledQueryAction": "drop",
                "localBindServerEnabled": false,
                "zoneTransferEnabled": true,
                "recursionDesiredEnabled": false,
                "securityEnabled": false,
                "loggingEnabled": false,
                "statisticsSampleRate": 20
            },
            "profileUdp": {
                "class": "UDP_Profile",
                "datagramLoadBalancing": true
            }

        }
    }
}


 

Back to top


4: Using a FIX profile and data groups in a declaration

This example shows how you can create a FIX (Financial Information eXchange) Profile which is commonly used for electronic trading. It also shows how the tag substitution mapping can be configured using data groups. Note: Some FIX features may require appropriate licensing. For more information, see https://www.f5.com/pdf/solution-profiles/fix-solution-profile.pdf. This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_non_http_04.
  • A standard TCP service named service with a pool named poolWeb.
  • A FIX Profile.
  • A tag substitution mapping using data groups.
  • Three types of referenced data groups: (new) internal, (new) external, and an external data group from an existing data-group file.
{
    "class": "ADC",
    "schemaVersion": "3.0.0",
    "id": "profileFix",
    "label": "sample 23 FIX profile",
    "remark": "Sample Application with FIX Profile",
    "Sample_non_http_04": {
        "class": "Tenant",
        "appWeb": {
            "class": "Application",
            "service": {
                "class": "Service_TCP",
                "virtualAddresses": [
                    "192.0.2.21"
                ],
                "virtualPort": 100,
                "pool": "poolWeb",
                "profileTCP": "normal",
                "profileFIX": {
                    "use": "profileFIXcustom"
                }
            },
            "poolWeb": {
                "class": "Pool",
                "monitors": [
                    "tcp-half-open"
                ],
                "members": [
                    {
                        "servicePort": 80,
                        "serverAddresses": [
                            "192.0.2.12",
                            "192.0.2.13"
                        ]
                    }
                ]
            },
            "profileFIXcustom": {
                "class": "FIX_Profile",
                "label": "test",
                "parentProfile": {
                    "bigip": "/Common/fix"
                },
                "errorAction": "drop-connection",
                "fullLogonParsingEnabled": false,
                "messageLogPublisher": {
                    "bigip": "/Common/local-db-publisher"
                },
                "reportLogPublisher": {
                    "bigip": "/Common/local-db-publisher"
                },
                "quickParsingEnabled": true,
                "responseParsingEnabled": true,
                "statisticsSampleInterval": 45,
                "senderTagMappingList": [
                    {
                        "senderId": "ExistingInternalDG",
                        "tagDataGroup": {
                            "bigip": "/Common/testInternalDG"
                        }
                    },
                    {
                        "senderId": "ExistingExternalDG",
                        "tagDataGroup": {
                            "bigip": "/Common/testExternalDG",
                            "isExternal": true
                        }
                    },
                    {
                        "senderId": "RefInternalDG",
                        "tagDataGroup": {
                            "use": "dataGroupRefInternal"
                        }
                    },
                    {
                        "senderId": "RefExternalDG",
                        "tagDataGroup": {
                            "use": "dataGroupRefExternal"
                        }
                    },
                    {
                        "senderId": "RefExternalDGFile",
                        "tagDataGroup": {
                            "use": "dataGroupRefExistingFileNoDG"
                        }
                    }
                ]
            },
            "dataGroupRefInternal": {
                "class": "Data_Group",
                "label": "Tag values mapping",
                "storageType": "internal",
                "name": "Internal Int",
                "keyDataType": "integer",
                "records": [
                    {
                        "key": 121212,
                        "value": "Summer"
                    },
                    {
                        "key": 3434,
                        "value": "Internal Field: \"see guide\""
                    }
                ]
            },
            "dataGroupRefExternal": {
                "class": "Data_Group",
                "label": "From URL or file path",
                "storageType": "external",
                "keyDataType": "string",
                "externalFilePath": "http://yourfile.yourdomain.com",
                "ignoreChanges": true,
                "separator": ":"
            },
            "dataGroupRefExistingFileNoDG": {
                "class": "Data_Group",
                "label": "From existing data-group file",
                "storageType": "external",
                "keyDataType": "string",
                "dataGroupFile": {
                    "bigip": "/Common/{{dataGroupFileName}}"
                }
            }
        }
    }
}

Back to top

5: Using tcpOptions in a TCP Profile

This simple example declaration shows how you use TCP Options for use in a TCP profile. This allows to specify which of the TCP Header option number fields should be collected and stored for iRules. First and Last determines if the first or last appearance of the field is stored. For information on TCP Options, see https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml. For information on using TCP options in iRules, see https://devcentral.f5.com/articles/accessing-tcp-options-from-irules.

  • Partition (tenant) named Sample_non_http_06.
  • A TCP profile named pTcpOptions that uses tcpOptions.
{
    "class": "ADC",
    "schemaVersion": "3.6.0",
    "id": "TEST_TCP_OPTIONS",
    "Sample_non_http_06": {
      "class": "Tenant",
      "TEST_TCP_Profile": {
        "class": "Application",
        "pTcpOptions" : {
            "class": "TCP_Profile",
            "tcpOptions": [
                {
                    "option": 8,
                    "when": "first"
                },
                {
                    "option": 28,
                    "when": "last"
                }
            ]
        }
      }
    }
  }
  

Back to top

6: Using GSLB features in a declaration

This example shows how you use F5s Global Server Load Balancing (GSLB) features in a declaration. You must have BIG-IP DNS (formerly GTM) provisioned to use these features. See the Schema Reference for usage options and additional features for GSLB.

Warning

When using GSLB features, you must be aware of the items pointed out in Warnings, notably AS3 completely overwrites non-AS3 topologies when a declaration is submitted.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_non_http_05.
  • A GSLB wide IP (domain) named example.edu with an alias of another.example.
  • A GSLB pool named testPool monitored by both the http and https health monitors.
  • A GSLB data center named testDataCenter.
  • A GSLB server named testServer with a device and two virtual servers. Important: A GSLB_Server must always be in /Common/Shared as shown in the example.
{
    "class": "ADC",
    "schemaVersion": "3.6.0",
    "id": "GSLB_Sample",
    "Sample_non_http_05": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "testDomain": {
                "class": "GSLB_Domain",
                "domainName": "example.edu",
                "aliases": [
                              "another.example*" ],
                "resourceRecordType": "A",
                "poolLbMode": "ratio",
                "pools": [
                              { "use": "testPool" }
                ]
            },
            "testPool": {
               "class": "GSLB_Pool",
                "enabled": false,
                "lbModeAlternate": "ratio",
                "lbModeFallback": "ratio",
                "manualResumeEnabled": true,
                "verifyMemberEnabled": false,
                "qosHitRatio": 10,
                "qosHops": 11,
                "qosKbps": 8,
                "qosLinkCapacity": 35,
                "qosPacketRate": 5,
                "qosRoundTripTime": 75,
                "qosTopology": 3,
                "qosVirtualServerCapacity": 2,
                "qosVirtualServerScore": 1,
                "members": [
                    {
                        "ratio": 10,
                        "server": {
                            "use": "/Common/Shared/testServer"
                        },
                        "virtualServer": "0"
                    }
                ],
                "bpsLimit": 5,
                "bpsLimitEnabled": true,
                "ppsLimit": 4,
                "ppsLimitEnabled": true,
                "connectionsLimit": 3,
                "connectionsLimitEnabled": true,
                "maxAnswersReturned": 10,
                "monitors": [
                    {
                        "bigip": "/Common/http"
                    },
                    {
                        "bigip": "/Common/https"
                    }
                ],
                "resourceRecordType": "A",
                "fallbackIP": "1.1.1.1"
            }
        }
    },
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "testDataCenter": {
                "class": "GSLB_Data_Center"
            },
            "testServer": {
                "class": "GSLB_Server",
                "dataCenter": {
                    "use": "testDataCenter"
                },
                "devices": [
                    {
                        "address": "1.2.3.7"
                    }
                ],
                "virtualServers": [
                    {
                        "address": "1.2.3.8",
                        "port": 5050
                    },
                    {
                        "address": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
                        "port": 5051
                    }
                ]
            }

        }
    }
}

Back to top

7: Service Discovery for virtual servers in GSLB Servers

This simple example shows how you can use Service Discovery to automatically discover virtual servers in GSLB Servers. You must have BIG-IP DNS (formerly GTM) provisioned to use these features. See GSLB Server in the Schema Reference for usage options and additional features for GSLB. Important: A GSLB_Server must always be in /Common/Shared as shown in the example.

Warning

When using GSLB features, you must be aware of the items pointed out in Warnings, notably AS3 completely overwrites non-AS3 topologies when a declaration is submitted.

This declaration creates the following objects on the BIG-IP (note that this declaration doesn’t not create a tenant, but uses the Common tenant as required for some GSLB features):

  • A GSLB data center named testDataCenter.
  • A GSLB server named testServer with one device, virtualServerDiscoveryMode set to enabled-no-delete (which only allows Service Discovery to add or modify, but not delete), and exposeRouteDomainsEnabled set to true (which allows virtual servers from all route domains to be auto-discovered).
{
    "class": "ADC",
    "schemaVersion": "3.11.0",
    "id": "GSLB_VS_Discovery",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "testDataCenter": {
            	"class": "GSLB_Data_Center"
            },
            "testServer": {
                "class": "GSLB_Server",
                "dataCenter": {
                    "use": "testDataCenter"
                },
                "devices": [{ "address": "10.10.10.10"}],
                "virtualServerDiscoveryMode": "enabled-no-delete",
                "exposeRouteDomainsEnabled": true
            }
        }
    }
}

Back to top

8: Creating a DNS cache in a declaration

This example shows how can create a DNS cache in a declaration (in versions prior to 3.13 you could reference a cache, but not create one). A DNS Cache allows the system to more quickly respond to repeated DNS queries. See the Configuring DNS Caching chapter of the BIG-IP DNS Implementation guide for detailed information.

You must have BIG-IP DNS (formerly GTM) provisioned to use these features.

See DNS_Cache in the Schema Reference for usage options and additional features for DNS Cache.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Example_DNS_Cache.
  • A DNS Cache object named DNSCache_example that contains a number of options. See DNS_Cache for details.
{
    "class": "ADC",
    "schemaVersion": "3.13.0",
    "id": "DNS_Cache",
    "Example_DNS_Cache": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "DNSCache_example": {
                "class": "DNS_Cache",
                "remark": "DNS Cache",
                "answerDefaultZones": true,
                "messageCacheSize": 0,
                "recordCacheSize": 1,
                "recordRotationMethod": "query-id",
                "localZones": {
                    "norecords.com": {
                        "type": "transparent",
                        "records": []
                    },
                    "onerecord.com": {
                        "type": "transparent",
                        "records": [
                            "wiki.onerecord.com 300 IN A 10.10.10.124"
                        ]
                    },
                    "tworecords.com": {
                        "type": "transparent",
                        "records": [
                            "wiki.tworecords.com 300 IN A 10.10.10.125",
                            "wiki.tworecords.com 300 IN A 10.10.10.126"
                        ]
                    }
                },
                "type": "transparent"
            }
        }
    }
}

Back to top

9: Using existing FTP and SIP profiles in a declaration

This example shows how you can use existing SIP and FTP profiles in a declaration. In this example, our BIG-IP system already has testSIP and testFTP profiles in the Common partition. See the Schema Reference for usage options and information.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_profile_03.
  • Two TCP services (virtual servers) named service, with Descriptions of A1 and A2.
  • A profileSIP object that references our existing testSIP profile.
  • A profileFTP object that references our existing testFTP profile.
{
    "class": "AS3",
    "action": "deploy",
    "persist": true,
    "declaration": {
       "class": "ADC",
       "schemaVersion": "3.0.0",
       "id": "fghijkl7890",
       "label": "existing SIP and FTP profiles",
       "Sample_profile_03": {
          "class": "Tenant",
          "A1": {
             "class": "Application",
             "service": {
                "class": "Service_TCP",
                "virtualAddresses": [
                   "10.0.6.100"
                ],
                "virtualPort": 443,
                "profileSIP":  {
                    "bigip": "/Common/testSIP"
             },
                "pool": "tcp_pool"
             },
            "tcp_pool": {
                "class": "Pool",
                "monitors": [
                   "tcp"
                ],
                "members": [{
                   "servicePort": 443,
                   "serverAddresses": [
                      "192.0.6.10",
                      "192.0.6.11"
                   ]
                }]
             }
          },

         "A2": {
             "class": "Application",
             "service": {
                "class": "Service_TCP",
                "virtualAddresses": [
                   "10.0.6.100"
                ],
                "virtualPort": 443,
                "profileFTP":  {
                    "bigip": "/Common/testFTP"
             },
                "pool": "ftp_pool"
             },

             "ftp_pool": {
                "class": "Pool",
                "monitors": [
                   "tcp"
                ],
                "members": [{
                   "servicePort": 21,
                   "serverAddresses": [
                      "192.0.6.10",
                      "192.0.6.11"
                   ]
                }]
             }
          }
       }     
    }
}

Back to top

10: Creating an FTP profile in a declaration

This example shows how you can create an FTP profile in a declaration (example 9 showed how to use an existing FTP profile). See FTP_Profile in the Schema Reference for more usage options and information.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named TEST_FTP_Profile.
  • A FTP profile named sampleFTPprofile
{
    "class": "ADC",
    "schemaVersion": "3.10.0",
    "id": "FTP_Profile",
    "TEST_FTP_Profile": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "sampleFTPprofile": {
                "class": "FTP_Profile",
                "remark": "description",
                "port": 300,
                "ftpsMode": "require",
                "enforceTlsSessionReuseEnabled": true,
                "activeModeEnabled": false,
                "securityEnabled": true,
                "translateExtendedEnabled": false,
                "inheritParentProfileEnabled": true
        }
    }
}
}

Back to top

11: Using an existing TFTP profile in a declaration

This example shows how can use TFTP (Trivial File Transfer Protocol) profiles that already exist on your BIG-IP system in an AS3 declaration. The TFTP profile enables you to configure the BIG-IP system to read and write files from or to a remote server. See the Using the TFTP ALG profile to transfer files chapter of the BIG-IP documentation for detailed information.

See Pointer_TFTP in the Schema Reference for usage options.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Exampe_Service_UDP.
  • A virtual service named service that references an existing TFTP profile on the BIG-IP system.
{
    "class": "ADC",
    "schemaVersion": "3.14.0",
    "Example_Service_UDP": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "service": {
                "class": "Service_UDP",
                "virtualAddresses": [
                    "1.1.1.10"
                ],
                "virtualPort": 10,
                "profileTFTP": {
                    "bigip": "/Common/tftp"
                }
            }
        }
    }
}

Back to top

12: Setting BBR Congestion Control in a TCP profile with AS3

This simple example shows how you can now use bbr as a Congestion Control option in the TCP profile. This feature is only available in BIG-IP versions 14.1 and later. When Congestion Control is set to bbr, the system uses a TCP algorithm that is optimized to achieve higher bandwidths and lower latencies. See the Overview of the TCP profile (14.x) for detailed information.

See TCP_Profile in the Schema Reference for usage options.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Example_BBR_CC.
  • A virtual service named BBRcc that only creates a TCP Profile with Congestion Control set to bbr.
{
    "class": "ADC",
    "schemaVersion": "3.14.0",
    "id": "TCP_Profile",
    "Example_BBR_CC": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "BBRcc": {
                "class": "TCP_Profile",
                "congestionControl": "bbr"
            }
        }
    }
}

Back to top

13: Configuring SCTP services and referencing SCTP profiles in a declaration

This example shows how you can reference existing SCTP profiles in an AS3 declaration. It also shows the new Service_SCTP class, which creates a virtual service that uses the SCTP protocol. For information on BIG-IP and the SCTP profile, see SCTP Profile Type in the product manual. For AS3, see Service_SCTP for detailed information and usage for the SCTP Class, and Pointer_SCTP_Profile for the SCTP profile.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_sctp_01.
  • An application named mySCTP that uses the sctp template.
  • A virtual service named service that uses Service_SCTP, and references an existing SCTP profile on the BIG-IP system.
{
  "class": "AS3",
  "action": "deploy",
  "persist": true,
  "declaration": {
    "class": "ADC",
    "schemaVersion": "3.15.0",
    "id": "service-sctp",
    "label": "Sample Service_SCTP",
    "remark": "Simple SCTP application reference",
    "Sample_sctp_01": {
      "class": "Tenant",
      "mySCTP": {
        "class": "Application",
        "service": {
          "class": "Service_SCTP",
          "virtualAddresses": [
            "10.0.1.10"
          ],
          "virtualPort": 132,
          "profileSCTP": {
            "bigip": "/Common/sctp"
          }
        }
      }
    }
  }
}

Back to top

14: Referencing existing ICAP profiles in a declaration

This example shows how you can reference an existing ICA (Internet Content Adaptation Protocol) profile in a declaration. You can use an ICAP profile when you want to use the BIG-IP content adaptation feature for adapting HTTP requests and responses. This feature allows a BIG-IP virtual server to conditionally forward HTTP requests and HTTP responses to a pool of ICAP servers for modification, before sending a request to a web server or returning a response to the client system. For more information on using the ICAP profile, see the BIG-IP documentation.

Important

ICAP profile must use TCP services and is only supported in Service_TCP.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_ICAP_profile.
  • An application named TCP_Service that uses the tcp template.
  • A virtual service named service that references an existing ICAP profile on the BIG-IP system.
{
    "class": "ADC",
    "schemaVersion": "3.16.0",
    "label": "ICAP_profile_existing",
    "remark": "ICAP_profile_existing",
    "Sample_ICAP_profile": {
        "class": "Tenant",
        "TCP_Service": {
            "class": "Application",
            "service": {
                "class": "Service_TCP",
                "virtualPort": 8181,
                "virtualAddresses": [
                    "192.0.2.100"
                ],
                "profileICAP": {
                    "bigip": "/Common/icap"
                }
            }
        }
    }
}

15: Using IP or L2 Forwarding in a declaration

In this example, we show how you can use the Service_Forwarding class to create IP or L2 Forwarding virtual services.

An IP forwarding virtual server accepts traffic that matches the virtual server address and forwards it to the destination IP address that is specified in the request rather than load balancing the traffic to a pool. For more information, see Overview of IP forwarding virtual servers.

A L2 forwarding virtual server does not have pool members to load balance and forwards packets based on routing decisions. For more information and requirements, see Overview of the Forwarding (Layer 2) virtual server.

For additional details and AS3 usage, see Service_Forwarding in the Schema Reference.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Forward_tenant.
  • An Application named SampleApp.
  • A IP Forwarding virtual server named myService which uses the Service_Forwarding class.
{
    "class": "ADC",
    "schemaVersion": "3.18.0",
    "id": "TEST_Service_Forwarding",
    "remark": "Example Forwarding Virtual Server",
    "Forward_tenant": {
        "class": "Tenant",
        "SampleApp": {
            "class": "Application",
            "myService": {
                "class": "Service_Forwarding",
                "remark": "Example Forwarding Virtual Server",
                "virtualAddresses": [
                    [
                        "192.0.1.11",
                        "1.2.3.4/32"
                    ]
                ],
                "virtualPort": 0,
                "forwardingType": "ip",
                "layer4": "tcp",
                "profileL4": "basic"
            }
        }
    }
}

Back to top

16: Specifying a GSLB virtual server name in a declaration

In this example, we show how you can specify a GSLB virtual server name in a declaration. In versions prior to 3.21, you were able to reference the GSLB virtual name, but the name defaulted to the index when created by AS3. In AS3 3.21, the name field is available field as optional, which allows you to override the name defaulting to the index.

For additional details and AS3 usage, see GSLB_Virtual_Server in the Schema Reference. Important: A GSLB_Server must always be in /Common/Shared as shown in the example.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Example_Tenant.
  • A GSLB Domain named testDomain that defines domain properties and references a Pool.
  • A GSLB pool named testPool which references a virtual server later in the declaration.
  • A reference to the Common partition, which includes an Application named shared and uses the shared template
  • A GSLB Data Center named testDataCenter.
  • A GSLB server named testServer that references the data center, and includes a device, and a virtual server named virtualAddress1 (which is also referenced from the testPool)
{
    "class": "AS3",
    "persist": false,
    "declaration": {
        "class": "ADC",
        "schemaVersion": "3.21.0",
        "id": "GSLB_Sample",
        "Example_Tenant": {
            "class": "Tenant",
            "Application": {
                "class": "Application",
                "testDomain": {
                    "class": "GSLB_Domain",
                    "domainName": "example.edu",
                    "aliases": [
                        "another.example*"
                    ],
                    "resourceRecordType": "A",
                    "poolLbMode": "ratio",
                    "pools": [
                        {
                            "use": "testPool"
                        }
                    ]
                },
                "testPool": {
                    "class": "GSLB_Pool",
                    "members": [
                        {
                            "ratio": 10,
                            "server": {
                                "use": "/Common/Shared/testServer"
                            },
                            "virtualServer": "virtualAddress1"
                        },
                        {
                            "ratio": 10,
                            "server": {
                                "use": "/Common/Shared/testServer"
                            },
                            "virtualServer": "1"
                        }
                    ],
                    "resourceRecordType": "A"
                }
            }
        },
        "Common": {
            "class": "Tenant",
            "Shared": {
                "class": "Application",
                "template": "shared",
                "testDataCenter": {
                    "class": "GSLB_Data_Center"
                },
                "testServer": {
                    "class": "GSLB_Server",
                    "dataCenter": {
                        "use": "testDataCenter"
                    },
                    "devices": [
                        {
                            "address": "1.2.3.7"
                        }
                    ],
                    "virtualServers": [
                        {
                            "address": "1.2.3.8",
                            "port": 5050,
                            "name": "virtualAddress1"
                        },
                        {
                            "address": "1.2.3.9",
                            "port": 5051
                        }
                    ]
                }
            }
        }
    }
}

Back to top