It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda Web Application Firewall

Server

  • Last updated on

A server object can be used to configure the networking information of the backend server to be hosted on the Barracuda Web Application Firewall. Multiple real servers can be added and configured to load balance the incoming traffic for a service.

Adding a Server

URL: /v1/virtual_services/{virtual_service_id}/servers
Method: POST
Description: Adds a server with the given values.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
nameAlphanumericYesA name to identify this server.
identifierEnumerationYes

The way to be used by the Barracuda Web Application Firewall to identify the server. The enumerated values include:

  • hostname
  • ip_address
address_versionEnumerationYes

The internet protocol version to be used. The enumerated values include:

  • ipv4
  • ipv6
ip_addressAlphanumericConditionalThe IP address of the server. This is required when identifier is set to ip_address.
hostnameAlphanumericConditionalThe hostname of the server. This is required when identifier is set to hostname.
portNumericYesThe port number of the server.
statusEnumerationOptional

The status for the server to handle the requests. The enumerated values include:

  • out_of_service_sticky
  • in_service
  • out_of_service_all
  • out_of_service_maintenance
backup_serverStringOptional

Determines whether to designate this server as a last resort server to be used when all other servers configured under the service fail. The values include:

  • yes
  • no

Note: If backup_server is set to yes, the weight value automatically resets to zero (0) and modifying this value will not take effect on the server.

weightNumericOptionalThe weight for the server. This is applicable only when the Load Balancing Algorithm is set to weighted_round_robin.
Example:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/demo_service/servers -u 'eyJldCI6IjEzODAwNz6ImFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"address_version":"ipv4","name":"demo_server","ip_address":"10.11.11.11","port":80}'

Response:

{"id":"demo_server","token":"eyJldCI6IjEzODAwdXNlciI6ImFkbWluIn0=\n"}

Retrieving Servers

URL: /v1/virtual_services/{virtual_service_id}/servers

         /v1/virtual_services/{virtual_service_id}/servers/{server_id}
Method: GET
Description: Lists all servers if “server_id” is not specified.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
parametersAlphanumericOptionalAny specific parameter name that needs to be retrieved. See Example 2.
Example 1:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/demo_service/servers/demo_server -u 'eyJldCI6IjEzNlciI6ImFkbWluIn0=\n:' -X GET

Response:

{
"in_band_health_checks": {
"max_http_errors": "0",
"max_refused": "10",
"max_timeout_failure": "10",
"max_other_failure": "10"
},
"out_of_band_health_checks": {
"enable_OOB_health_checks": "1",
"interval": "10"
},
"status": "in-service",
"client_impersonation": "0",
"application_layer_health_check": {
"additional_headers": [

],
"status_code": "200",
"url": null,
"method": "GET",
"match_content_string": null
},
"max_request": "1000",
"max_establishing_connections": "100",
"comments": "",
"backup_server": "0",
"max_connections": "10000",
"timeout": "300000",
"weight": "1",
"ip_address": "10.11.11.11",
"id": "demo_server",
"token": "eyJldCI6IjM0IiwidXNlciI6ImFkbWluIn0=\n",
"source_ip_to_connect": null,
"ssl": {
"enable_https": "0",
"client_certificate": null,
"enable_ssl_3": "1",
"validate_certificate": "0",
"enable_tls_1": "1"
},
"name": "demo_server",
"port": "80",
"connection_pooling": {
"enable_connection_pooling": "1",
"keepalive_timeout": "900000"
},
"max_keepalive_requests": "0",
"max_spare_connections": "0"
}

Example 2:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/demo_service/servers/demo_server -u 'eyJldCI6IjE1XNlciI6ImFkbWluIn0=\n:' -X GET -G -d parameters=connection_pooling,ssl

Response:

{
"connection_pooling": {
"enable_connection_pooling": "yes",
"keepalive_timeout": "900000"
},
"ssl": {
"enable_https": "no",
"enable_tls_1_1": "yes",
"client_certificate": null,
"enable_ssl_3": "yes",
"validate_certificate": "yes",
"enable_tls_1_2": "yes",
"enable_tls_1": "yes"
},
"id": "demo_server",
"token": "eyJldCI6IjE1MkNlciI6ImFkbWluIn0=\n"
}

Updating a Server

In this REST API call, the parameters can be passed in a simple JSON request or a nested JSON request based on the parameters that need to be modified. For information on JSON requests, see Request Syntax.

URL: /v1/virtual_services/{virtual_service_id}/servers/{server_id}
Method: PUT
Description: Updates the values of given parameters in the given server.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
nameAlphanumericOptionalThe name of the server.
identifierEnumerationOptional

The way to be used by the Barracuda Web Application Firewall to identify the server. The enumerated values include:

  • hostname
  • ip_address
address_versionEnumerationOptional

The internet protocol version to be used. The enumerated values include:

  • ipv4
  • ipv6
ip_addressAlphanumericOptionalThe IP address of the server. This is required when identifier is set to ip_address.
HostnameAlphanumericOptionalThe hostname of the server. This is required when identifier is set to hostname.
PortNumericOptionalThe port number of the server.
StatusEnumerationOptional

The status for the server to handle the requests. The enumerated values include:

  • out_of_service_sticky
  • in_service
  • out_of_service_all
  • out_of_service_maintenance
backup_serverStringOptional

Determines whether to designate this server as a last resort server to be used when all other servers configured under the service fail. The values include:

  • yes
  • no

Note: If backup_server is set to yes, the weight value automatically resets to zero (0) and modifying this value will not take effect on the server.
WeightNumericOptionalThe weight for the server. This is applicable only when the Load Balancing Algorithm is set to weighted_round_robin.
ssl.enable_httpsEnumerationOptional

The SSL status for backend connections. The values include:

  • yes
  • no
ssl.enable_ssl_3StringOptional

SSL 3.0 protocol to be used by the clients to establish the connection to the server. The values include:

  • yes
  • no
ssl.enable_tls_1StringOptional

TLS 1.0 protocol to be used by the clients to establish the connection to the server. The values include:

  • yes
  • no
ssl.enable_tls_1_1StringOptional

TLS 1.1 protocol to be used by the clients to establish the connection to the server. The values include:

  • yes
  • no
ssl.enable_tls_1_2StringOptional

TLS 1.2 protocol to be used by the clients to establish the connection to the server. The values include:

  • yes
  • no
ssl.enable_sniEnumerationOptional

When set to Yes, the Barracuda Web Application Firewall allows a client to request a certificate for a specific domain from a web server. It can be used if multiple virtual HTTP domains with different certificates are hosted on one server. The values include:

  • yes
  • no
ssl.client_certificateStringOptionalThe certificate to be used when the server requires client authentication.
ssl.validate_certificateStringOptional

Determines whether to validate the server certificate. The values include:

  • yes
  • no
ssl.enable_ssl_compatibility_modeStringOptional

Determines whether to enforce compatibility with legacy servers. The values include:

  • yes
  • no
in_band_health_checks.max_http_errorsNumericOptionalThe maximum number of HTTP error responses to be allowed per 1024 requests before marking the server as out of service.
in_band_health_checks.max_refusedNumericOptionalThe maximum number of connection refused errors to be allowed per 1024 connections before marking the server as out-of-service (default is 10).
in_band_health_checks.max_other_failureNumericOptionalThe maximum number of connection time-out errors to be allowed per 1024 connections before marking the server as out-of-service (default is 10).
in_band_health_checks.max_timeout_failureNumericOptionalThe maximum number of other errors to be allowed per 1024 connections before marking the server as out-of-service (default is 10).
out_of_band_health_checks.enable_OOB_health_checksStringOptional

The status of Out-of-Band monitoring. The values include:

  • yes
  • no
out_of_band_health_checks.intervalNumericOptionalThe interval time (in seconds) between the probes sent by the Barracuda Web Application Firewall to the server to determine the health status.
application_layer_health_check.additional_headersAlphanumericOptionalAny additional headers to be sent with the OOB HTTP request.
application_layer_health_check.status_codeNumericOptionalThe expected HTTP response status code.
application_layer_health_check.urlURLOptionalThe URL to be used in the HTTP request to determine the server health.
application_layer_health_check.methodEnumerationOptional

The method to be used for the HTTP request. The enumerated values include:

  • POST
  • GET
  • HEAD
application_layer_health_check.match_content_stringStringOptionalThe string that needs to be matched in the response. If specified, the response must contain the string. If the response does not contain the string, the probe is deemed unsuccessful, and the server will be marked out-of-service.
connection_pooling.enable_connection_poolingStringOptional

The connection pooling status. The values include:

  • yes
  • no
connection_pooling.keepalive_timeoutNumericOptionalThe time in milliseconds to time out a connection that was used at least once. This is the maximum amount of time a connection is kept alive. This value is applicable per 1024 connections, where a time-out error had occurred before turning off the server.
advanced_configuration.max_connectionsNumericOptionalThe maximum number of connections established to the server at any time.
advanced_configuration.max_requestsNumericOptionalThe maximum number of requests that can be queued.
advanced_configuration.max_keepalive_requestsNumericOptionalThe maximum number of requests retained on a persistent connection before the connection is shut down (if the server does not close the connection first).
advanced_configuration.max_establishing_connectionsNumericOptionalThe maximum number of simultaneous connections that can be established to the server.
advanced_configuration.max_spare_connectionsNumericOptionalThe maximum number of pre-allocated connections.
advanced_configuration.timeoutNumericOptionalThe time in milliseconds to time out an unused connection.
advanced_configuration.client_impersonationStringOptional

Specifies if the Barracuda Web Application Firewall uses the client IP address as the source IP address to communicate to the servers. The values include:

  • yes
  • no
advanced_configuration.source_ip_to_connectAlphanumericOptional

The IP address to be used by the Barracuda Web Application Firewall to communicate with the server. It can be WAN IP address, LAN IP address or a custom virtual interface IP address in the Vsite. If client_impersonation is set to yes, then this IP is used only for Out of Band Health checks.

 

Note: If the server is reachable through a static route configured in the Vsite, the custom virtual interface defined in that Vsite should be specified in source_ip_to_connect.
Example 1:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/demo_service/servers/demo_server -u 'eyJldCI6IjEzODAwdXNlciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"ssl":{"enable_https":0},"status":"in-service"}'

Response:

{"id":"demo_server","token":"eyJldCI6IjEzNjE3IiwidXNlciI6ImFkbWluIn0=\n"}

Example 2:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/aert/servers/Server1 -u 'eyJldCI6IjE0NTklciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"enable_ssl_compatibility_mode":"yes"}'

Response:

{"id":"Server1","token":"eyJldCI61IiwidXNlciI6ImFkbWluIn0=\n"}

Deleting a Server

URL: /v1/virtual_services/{virtual_service_id}/servers/{server_id}
Method: DELETE
Description: Deletes the given server configured under the given service.
Example:

Request:

curl http://192.168.0.1:8000/restapi/v1/virtual_services/demo_service/servers/demo_server -u  'eyJldCI6IjEzODAwXNlciI6ImFkbWluIn0=\n:admin' -X DELETE

Response:

{"msg":"Successfully deleted","token":"eyJldCIRlIiwidXNlciI6ImFkbWluIn0=\n"}