Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
🔍 Discover Our Product Documentation

Barracuda Web Application Firewall
Results will update as you type.
  • How to Update Your Notification Email Addresses
  • What's New in the Barracuda Web Application Firewall
  • 30-Day Evaluation Guide - Barracuda Web Application Firewall
  • Getting Started
  • Deployment
  • Services
  • Securing HTTP/HTTPS Traffic
  • Advanced Bot Protection
  • Client-Side Protection
  • API Security
  • Advanced Security
  • IP Reputation-Based Filters
  • Tuning Security Rules
  • Barracuda Active Threat Intelligence
  • Access Control
  • Traffic Management
  • Configuring User-Defined Patterns
  • Logging, Reporting and Monitoring
  • High Availability
  • Networking
  • System Administration and Maintenance
  • Certificate Management
  • Centralized Management of the Barracuda Web Application Firewall
  • Attacks Description - Action Policy
  • REST API
    • REST API Version 1 (v1)
    • REST API Version 3 (v3)
      • REST API Request and Response Types
      • REST API Examples
    • How to Generate API Calls
    • File-Based Configuration Management for Barracuda Web Application Firewall
    • Using Postman for Barracuda Web Application Firewall APIs
    • How to Enable Dual-Factor Authentication for the Barracuda Web Application Firewall Web Interface Access
    • REST API to Manage Multi-IP on Azure and AWS Cloud Deployments
  • Common Web Application Attacks
  • How to Set Up Barracuda Cloud Control
  • End of Support and End of Life Information
  • Critical Vulnerabilities in Web Application
  • Barracuda Advanced Bot Protection Cloud Infrastructure Upgrade Information
  • Barracuda WAF 12.2 Firmware Hardened to Augment Security of Product Features

    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    REST API Examples
    Published Oct 14, 2021

    REST API Examples

    Oct 14, 2021
    Subscribe

    This article provides a few examples on how to use the Barracuda Web Application Firewall REST APIs:

    In this article:

    Virtual Service

    • To Create a Virtual Service

    • To Retrieve a Virtual Service

    • To Update a Virtual Service

    • To Delete a Virtual Service

    Real Server

    • To Create a Real Server

    • To Retrieve all Real Servers for a Service

    • To Update a Real Server

    • To Delete a Real Server

    Content Rule

    • To Create a Content Rule

    • To Retrieve a Content Rule

    • To Update a Content Rule

    • To Delete a Content Rule

    Rule Group Server

    • To Create a Rule Group Server

    • To Retrieve a Rule Group Server

    • To Update a Rule Group Server

    • To Delete a Rule Group Server

    Logs

    • To Fetch Logs

    • To Fetch a Log with the ID

    • To Fetch a Parameter Value from a Log

    • To Apply a Filter on Logs

    • To Apply Multiple Filters on Logs

    • To Apply the Limit and Offset

    Certificates

    • To Upload a Trusted CA Certificate

    • To Upload a Trusted Server Certificate

    • To Upload a Self-Signed Certificate

    Virtual Service

    To Create a Virtual Service

    Example: Creating a HTTP Service

    Request:


    curl -X POST "http://10.36.73.160:8000/restapi/v3.2/services " -H "Content-Type: application/json" -u "eyJldCI6IiOGUxNDQ2OTM4ZjRkIn0=\n:" -d
    {
    "address-version": "IPv4",
    "app-id": "app1",
    "comments": "This is a demo service",
    "ip-address": "10.36.73.154",
    "mask": "255.255.255.0",
    "name": "service_app1",
    "port": "80",
    "type": "HTTP"
    }

    Response:

    {"id":"service_app1","token":"eyJ1c2ZXQiOiIxNjI2MDg1NDc3In0=\n","msg":"Successfully created."}

    Example: Creating a HTTPS Service

    Request:

    curl -X POST "http://10.36.73.160:8000/restapi/v3.2/services " -H "Content-Type: application/json" -u "eyJldCkNjQzNjZiOGUxNDQ2OTM4ZjRkIn0=\n:" -d
    '{

    "address-version": "IPv4",
    "app-id": "app1-https",
    "comments": "This is a demo service",
    "ip-address": "10.36.73.154",
    "mask": "255.255.255.0",
    "name": "service_app1_secure",
    "port": "443",
    "certificate": "test_cert",
    "type": "HTTPS"
    }'

    Response:

    {"id":"service_app1_secure","token":"eyJldCNlciI6ImFkbWluIn0=\n","msg":"Successfully created."}


    We value your feedback.
    If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
    For general product inquiries or technical support, please contact the global Barracuda Support team.

    {"serverDuration": 14, "requestCorrelationId": "e2ba8a6bf8ac4588bedc1896bac3983a"}