We use cookies on our website to ensure we provide you with the best experience on our website. By using our website, you agree to the use of cookies for analytics and personalized content.This website uses cookies. More Information
It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda Web Application Firewall

Vsites

  • Last updated on

A Vsite is a networking entity on the Barracuda Web Application Firewall which can be used to host other entities such as service groups, virtual services, servers and rule groups. A vsite has its own routing table to route the traffic for services and servers configured in it.

To Create a Vsite

URL: /v1/vsites
Method: POST
Description: Creates a vsite with the given name.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
nameAlphanumericYesA name for the new vsite.
active_onNumericConditional

Specify the serial number of the unit on which the Vsite needs to be active.

Note: This parameter is applicable ONLY if the unit is deployed in High Availability environment.

Creating a Vsite in a Stand-Alone Unit

Example:

# Creating Curl requests

   URLs

   : HTTP = http://192.168.0.1:8000/restpai/v1/{object_id}

   : HTTPS = https://192.168.0.1:443/restapi/v1/{object_id}

# Create URL

     : -H = Request Header (Specify Content-Type)

     : -X = Request Method (POST,GET,PUT,DELETE)

     : -d = JSON data hash

     : -u = Authentication token which you got back on login

 

curl http://192.168.0.1:8000/restapi/v1/vsites -u 'eyJldCI6IjEzNzk2NDA4MzciLCJwYXNzd29yZCI6ImIxZjQzYmVhZTk5MWFmMWUyNDYzYTFiNjA5\nYzYzZTFjIiwidXNlciI6ImFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name": "demo_vsite"}'

When executed, the above curl script will dump the result, and the output will look like this:

{"id":"demo_vsite","token":"eyJldCI6IjEzNzk2NDM5NTkiLCJwYXNzd29yZCI6IjFkMTc3YTEwZWUwNjE0NWFkMTVlOTY1ODk1\nZjBjNzcxIiwidXNlciI6ImFkbWluIn0=\n"}

Creating a Vsite in a Clustered Unit

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites -u 'eyJldCI6IjE0MzM5NjUzMDQiLCJwYXNzd29yZCI6ImU1ZmU3NDc2MTEyZTdmOTA5NzQ0NTU2N2Zi\nZWI3MDEyIiwidXNlciI6ImFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name":"demo_vsite2","active_on":"617055"}'

Response:

{"id":"demo_vsite2","token":"eyJldCI6IjE0MzM5Njc2ODAiLCJwYXNzd29yZCI6ImEzZDlkYWUyMzJhOWZmNzM2OTJlNzEyZmIw\nNjI1MjFlIiwidXNlciI6ImFkbWluIn0=\n"}

To Retrieve Vsites

URL: /v1/vsites

         /v1/vsites/{vsite_id}
Method: GET
Description: Lists all vsites if “vsite_id” is not specified.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
parametersAlphanumericYesThe parameter names for which you want to retrieve the value. See Example 2.
Example 1:

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites -u 'eyJldCI6IjEzODY3MTI2MzIiLCJwYXNzd29yZCI6IjY0YTJiZWNkMzMyZjkyMTFlMzkxNTU2ZjAw\nZjc3MmIxIiwidXNlciI6ImFkbWluIn0=\n:' -X GET

Response:

{"parameters":null,"object":"Vsites","data":[{"service_group":["default"],"service_groups":[{"name":"default","id":"default","virtual_services":[{"load_balance":{"algorithm":"round_robin","failover_method":"load_balance","persistence_method":"none"},"service_hostname":[],"advanced_configuration":{"enable_web_application_firewall":"yes","keepalive_requests":"64","ntlm_ignore_extra_data":"no"},"status":"enable","session_timeout":"60","instant_ssl":{"secure_site_domain":[],"status":"off","sharepoint_rewrite_support":"off"},"comments":null,"group":"default","ip_address":"99.99.107.25","id":"SERVICE_1","ssl_offloading":{"ciphers":"default","sni_certificate":[],"trusted_certificates":[],"status":"off","enforce_client_certificate":"yes","enable_tls_1_2":"yes","enable_strict_sni_check":null,"selected_ciphers":"AES256-GCM-SHA384,AES256-SHA256,AES256-SHA,CAMELLIA256-SHA,DES-CBC3-SHA,AES128-GCM-SHA256,AES128-SHA256,AES128-SHA,SEED-SHA,CAMELLIA128-SHA,IDEA-CBC-SHA,RC4-SHA","enable_tls_1":"yes","domain":[],"enable_sni":"no","enable_tls_1_1":"yes","enable_client_authentication":"no","enable_ssl_3":"yes"},"mask":"255.255.255.255","enable_access_logs":"yes","name":"SERVICE_1","port":"80","security":{"ignore_case":"yes","trusted_hosts_action":"default","mode":"active","web_firewall_log_level":"notice","web_firewall_policy":"default","rate_control_status":"off","trusted_hosts_group":"","rate_control_pool":"NONE","client_ip_addr_header":null},"address_version":"ipv4","servers":[{"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":"yes","interval":"10"},"advanced_configuration":{"client_impersonation":"no","max_establishing_connections":"100","max_keepalive_requests":"0","max_connections":"10000","max_requests":"1000","timeout":"300000","source_ip_to_connect":null,"max_spare_connections":"0"},"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"},"status":"in-service","name":null,"application_layer_health_check":{"additional_headers":[],"status_code":"200","url":null,"method":"GET","match_content_string":null},"port":"80","comments":null,"backup_server":"no","connection_pooling":{"enable_connection_pooling":"yes","keepalive_timeout":"900000"},"weight":"1","ip_address":"11.11.1.117","id":null}],"type":"HTTP","content_rules":[]}]}],"name":"default","id":"default","active_on":"140949","comments":null}],"limit":null,"token":"eyJldCI6IjEzODY3MTI2OTUiLCJwYXNzd29yZCI6IjM4ODk5YzU4MDExMGI5MDM4Y2ZmNTZhMGI2\nYTA3NTMzIiwidXNlciI6ImFkbWluIn0=\n","offset":null}

Example 2:

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites -u 'eyJldCI6IjEzODY3MTI2MzIiLCJwYXNzd29yZCI6IjY0YTJiZWNkMzMyZjkyMTFlMzkxNTU2ZjAw\nZjc3MmIxIiwidXNlciI6ImFkbWluIn0=\n:' -X GET -G -d parameters=name

Response:

{"parameters":["name"],"object":"Vsites","data":[{"name":"default"},{"name":"Cuda"}],"limit":null,"token":"eyJldCI6IjEzODY3MTQ4MTQiLCJwYXNzd29yZCI6ImNmODYyNWU0NDM1NjFhYWIyNGE1NjVkMTJl\nNmZkZGQ2IiwidXNlciI6ImFkbWluIn0=\n","offset":null}

Example 3:

Request:

curl  http://192.168.0.1:8000/restapi/v1/vsites  -u 'eyJldCI6IjE0MzM5NjUzMDQiLCJwYXNzd29yZCI6ImU1ZmU3NDc2MTEyZTdmOTA5NzQ0NTU2N2Zi\nZWI3MDEyIiwidXNlciI6ImFkbWluIn0=\n:' -X GET -G -d parameters=active_on,service_group

Response:

{"parameters":["active_on","service_group"],"object":"Vsites","data":[ {"service_group":["default"],"active_on":"511256"} , {"service_group":["dut1_vsite1_group"],"active_on":"511256"} , {"service_group":["dut2_vsite1_group"],"active_on":"617055"} , {"service_group":["demo_vsite2_group"],"active_on":"511256"} ],"limit":null,"token":"eyJldCI6IjE0MzM5Njc3NzAiLCJwYXNzd29yZCI6IjIyODE5MzhkZjUzYjQ4ZmUwYTI1Yjg2OWMw\nYmE2YzMxIiwidXNlciI6ImFkbWluIn0=\n","offset":null}

To Update a Vsite

URL: /v1/vsites/{vsite_id}
Method: PUT
Description: Updates the vsite with the given value.
Parameter NameData TypeMandatoryDescription
Input Parameters:   
CommentsAlphanumericOptionalDescription about the vsite.

Updating a Vsite in a Stand-Alone Unit

Example 1:

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites/demo_vsite -u 'eyJldCI6IjEzODAyMzQyMzEiLCJwYXNzd29yZCI6IjAzNjU5ZGIxZDUwMzc3MTJlYzJhMDkzNTgy\nOGEwYTA2IiwidXNlciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"comments":"TEST"}'

Response:

{"msg":"Configuration Updated","id":"demo_vsite","token":"eyJldCI6IjEzODAyMzYzMzIiLCJwYXNzd29yZCI6IjM4ZjdkMDhjOTdlNDBiNThjOGIzZjliMWRl\nZGY2NmJlIiwidXNlciI6ImFkbWluIn0=\n"}

Updating a Vsite in a Clustered Unit

Example 2:

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites/demo_vsite2 -u 'eyJldCI6IjE0MzM5NjUzMDQiLCJwYXNzd29yZCI6ImU1ZmU3NDc2MTEyZTdmOTA5NzQ0NTU2N2Zi\nZWI3MDEyIiwidXNlciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"comments":"TEST","active_on":"511256"}'

Response:

{"msg":"Configuration Updated","id":"demo_vsite2","token":"eyJldCI6IjE0MzM5Njc3NDMiLCJwYXNzd29yZCI6IjhkMjI3YzMxOTlmZjBjN2FkNTY4MTQ1ODU5\nZWU2M2QxIiwidXNlciI6ImFkbWluIn0=\n"}

To Delete a Vsite

URL: /v1/vsites/{vsite_id}
Method: DELETE
Description: Deletes the given vsite.
Example:

Request:

curl http://192.168.0.1:8000/restapi/v1/vsites/demo_vsite -u 'eyJldCI6IjEzNzk0OTE4MjQiLCJwYXNzd29yZCI6Ijc3YzQ3NTNkNWEyMDMzNjJiOTg5OTU5OWQ1\nMGNlY2FlIiwidXNlciI6ImFkbWluIn0=\n:' -X DELETE

Response:

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

Last updated on