openapi: 3.0.0
info:
  license:
    name: MIT
    url: https://github.com/aziontech/azionapi-openapi/blob/main/LICENSE.md
  title: Edge Firewall API
  version: 2.0.0
servers:
- description: Production
  url: https://api.azionapi.net
security:
- tokenAuth: []
paths:
  /edge_firewall:
    get:
      parameters:
      - explode: true
        in: query
        name: page
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: page_size
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: sort
        required: false
        schema:
          type: string
        style: form
      - explode: true
        in: query
        name: order_by
        required: false
        schema:
          type: string
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEdgeFirewallResponse'
          description: A list of edge firewalls
        "403":
          description: Forbidden
        "404":
          description: Not found
      summary: List all user edge firewall
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEdgeFirewallRequest'
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeFirewallResponse'
          description: Edge firewall created
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "500":
          description: Internal Server Error
      summary: Create a edge firewall
  /edge_firewall/{uuid}:
    delete:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      responses:
        "204":
          description: Successfully deleted
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
      summary: Delete an edge firewall by uuid
    get:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeFirewallResponse'
          description: An edge firewall object
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
      summary: Retrieve an edge firewall set by uuid
    patch:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEdgeFirewallRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeFirewallResponse'
          description: Successfully updated
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
        "500":
          description: Internal Server Error
      summary: "Update some edge firewall attributes, like \"active\""
    put:
      parameters:
      - explode: false
        in: path
        name: uuid
        required: true
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEdgeFirewallRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeFirewallResponse'
          description: Successfully updated
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
        "500":
          description: Internal Server Error
      summary: "Overwrite some edge firewall attributes, like \"active\""
  /edge_firewall/{edge_firewall_id}/rules_engine:
    get:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: true
        in: query
        name: page
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: page_size
        required: false
        schema:
          format: int64
          type: integer
        style: form
      - explode: true
        in: query
        name: sort
        required: false
        schema:
          type: string
        style: form
      - explode: true
        in: query
        name: order_by
        required: false
        schema:
          type: string
        style: form
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/RuleSetResponseAll'
          description: List all rule sets.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "500":
          description: Internal Server Error
      summary: List all rule sets.
    post:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/CreateRuleSetRequest'
      responses:
        "201":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/RuleSetResponse'
          description: Create rule set.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "500":
          description: Internal Server Error
      summary: Create rule set.
  /edge_firewall/{edge_firewall_id}/rules_engine/{rule_set_id}:
    delete:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: false
        in: path
        name: rule_set_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      responses:
        "204":
          description: Delete rule set.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
        "500":
          description: Internal Server Error
      summary: Delete rule set.
    get:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: false
        in: path
        name: rule_set_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: true
        in: query
        name: order_by
        required: false
        schema:
          type: string
        style: form
      - explode: true
        in: query
        name: sort
        required: false
        schema:
          enum:
          - ASC
          - DESC
          type: string
        style: form
      - explode: true
        in: query
        name: page
        required: false
        schema:
          default: 1
          format: int64
          minimum: 1
          type: integer
        style: form
      - explode: true
        in: query
        name: page_size
        required: false
        schema:
          default: 10
          format: int64
          minimum: 1
          type: integer
        style: form
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/RuleSetResult'
          description: Retrieve rule set by ID.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "500":
          description: Internal Server Error
      summary: Retrieve rule set by ID.
    patch:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: false
        in: path
        name: rule_set_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/CreateRuleSetRequest'
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/RuleSetResult'
          description: Edit rule set.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
        "500":
          description: Internal Server Error
      summary: Edit rule set.
    put:
      parameters:
      - explode: false
        in: path
        name: edge_firewall_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      - explode: false
        in: path
        name: rule_set_id
        required: true
        schema:
          format: int64
          minimum: 1
          type: integer
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/CreateRuleSetRequest'
      responses:
        "200":
          content:
            application/json; version=3:
              schema:
                $ref: '#/components/schemas/RuleSetResult'
          description: Overwrite rule set.
        "400":
          description: Bad Request
        "403":
          description: Forbidden
        "404":
          description: Not found
        "500":
          description: Internal Server Error
      summary: Overwrite rule set
components:
  parameters:
    edge_firewall_id:
      explode: false
      in: path
      name: edge_firewall_id
      required: true
      schema:
        format: int64
        minimum: 1
        type: integer
      style: simple
    rule_set_id:
      explode: false
      in: path
      name: rule_set_id
      required: true
      schema:
        format: int64
        minimum: 1
        type: integer
      style: simple
    order_by:
      explode: true
      in: query
      name: order_by
      required: false
      schema:
        type: string
      style: form
    sort:
      explode: true
      in: query
      name: sort
      required: false
      schema:
        enum:
        - ASC
        - DESC
        type: string
      style: form
    page:
      explode: true
      in: query
      name: page
      required: false
      schema:
        default: 1
        format: int64
        minimum: 1
        type: integer
      style: form
    page_size:
      explode: true
      in: query
      name: page_size
      required: false
      schema:
        default: 10
        format: int64
        minimum: 1
        type: integer
      style: form
  schemas:
    Links:
      example:
        next: next
        previous: previous
      properties:
        previous:
          nullable: true
          type: string
        next:
          nullable: true
          type: string
      type: object
    EdgeFirewall:
      example:
        is_active: true
        last_editor: last_editor
        name: name
        waf_enabled: true
        network_protection_enabled: true
        domains:
        - 5
        - 5
        edge_functions_enabled: true
        id: 5
        last_modified: last_modified
        debug_rules: true
      properties:
        id:
          format: int64
          type: integer
        name:
          type: string
        is_active:
          type: boolean
        last_editor:
          type: string
        last_modified:
          type: string
        edge_functions_enabled:
          type: boolean
        network_protection_enabled:
          type: boolean
        waf_enabled:
          type: boolean
        debug_rules:
          type: boolean
        domains:
          items:
            format: int64
            type: integer
          type: array
      type: object
    ListEdgeFirewallResponse:
      example:
        schema_version: 1
        count: 0
        links:
          next: next
          previous: previous
        total_pages: 6
        results:
        - is_active: true
          last_editor: last_editor
          name: name
          waf_enabled: true
          network_protection_enabled: true
          domains:
          - 5
          - 5
          edge_functions_enabled: true
          id: 5
          last_modified: last_modified
          debug_rules: true
        - is_active: true
          last_editor: last_editor
          name: name
          waf_enabled: true
          network_protection_enabled: true
          domains:
          - 5
          - 5
          edge_functions_enabled: true
          id: 5
          last_modified: last_modified
          debug_rules: true
      properties:
        count:
          format: int64
          type: integer
        total_pages:
          format: int64
          type: integer
        schema_version:
          format: int64
          type: integer
        links:
          $ref: '#/components/schemas/Links'
        results:
          items:
            $ref: '#/components/schemas/EdgeFirewall'
          type: array
      type: object
    CreateEdgeFirewallRequest:
      example:
        is_active: true
        name: name
        waf_enabled: true
        domains:
        - 0
        - 0
        network_protection_enabled: true
        edge_functions_enabled: true
      properties:
        name:
          type: string
        domains:
          items:
            format: int64
            type: integer
          type: array
        is_active:
          type: boolean
        edge_functions_enabled:
          type: boolean
        network_protection_enabled:
          type: boolean
        waf_enabled:
          type: boolean
      type: object
    EdgeFirewallResponse:
      example:
        schema_version: 0.8008281904610115
        results:
          is_active: true
          last_editor: last_editor
          name: name
          waf_enabled: true
          network_protection_enabled: true
          domains:
          - 5
          - 5
          edge_functions_enabled: true
          id: 5
          last_modified: last_modified
          debug_rules: true
      properties:
        results:
          $ref: '#/components/schemas/EdgeFirewall'
        schema_version:
          type: number
      type: object
    UpdateEdgeFirewallRequest:
      example:
        is_active: true
        name: name
        waf_enabled: true
        domains:
        - 0
        - 0
        network_protection_enabled: true
        edge_functions_enabled: true
      properties:
        name:
          type: string
        domains:
          items:
            format: int64
            type: integer
          type: array
        is_active:
          type: boolean
        edge_functions_enabled:
          type: boolean
        network_protection_enabled:
          type: boolean
        waf_enabled:
          type: boolean
      type: object
    Behaviors:
      oneOf:
      - $ref: '#/components/schemas/NullArgumentBehavior'
      - $ref: '#/components/schemas/SimpleArgumentBehavior'
      - $ref: '#/components/schemas/SetRateLimitBehavior'
      - $ref: '#/components/schemas/SetWAFRuleSetBehavior'
      - $ref: '#/components/schemas/SetWAFRuleSetAndWafModeBehavior'
      - $ref: '#/components/schemas/SetCustomResponse'
    NullArgumentBehavior:
      properties:
        name:
          enum:
          - deny
          - drop
          type: string
        argument:
          nullable: true
          type: integer
      type: object
    SetRateLimitBehavior:
      properties:
        name:
          enum:
          - set_rate_limit
          type: string
        argument:
          $ref: '#/components/schemas/SetRateLimitBehavior_argument'
      type: object
    SetWAFRuleSetBehavior:
      properties:
        name:
          enum:
          - set_waf_ruleset
          type: string
        argument:
          $ref: '#/components/schemas/SetWAFRuleSetBehavior_argument'
      type: object
    SetWAFRuleSetAndWafModeBehavior:
      properties:
        name:
          enum:
          - set_waf_ruleset_and_waf_mode
          type: string
        argument:
          $ref: '#/components/schemas/SetWAFRuleSetAndWafModeBehavior_argument'
      type: object
    SetCustomResponse:
      properties:
        name:
          enum:
          - set_custom_response
          type: string
        argument:
          $ref: '#/components/schemas/SetCustomResponse_argument'
      type: object
    SimpleArgumentBehavior:
      properties:
        name:
          enum:
          - run_function
          - tag_event
          type: string
        argument:
          $ref: '#/components/schemas/SimpleArgumentBehavior_argument'
      type: object
    Variables:
      enum:
      - header_accept
      - header_accept_encoding
      - header_accept_language
      - header_cookie
      - header_origin
      - header_referer
      - header_user_agent
      - host
      - network
      - request_args
      - request_method
      - request_uri
      - scheme
      - client_certificate_validation
      type: string
    Conditionals:
      enum:
      - if
      - and
      - or
      type: string
    SSLVerificationStatusOperators:
      enum:
      - is_equal
      - is_not_equal
      type: string
    SSLVerificationStatusArguments:
      enum:
      - SUCCESS
      - CERTIFICATE_VERIFICATION_ERROR
      - MISSING_CLIENT_CERTIFICATE
      type: string
    SSLVerificationStatusCriteria:
      example:
        conditional: null
        variable: null
        input_value: null
        operator: null
      properties:
        variable:
          $ref: '#/components/schemas/Variables'
        operator:
          $ref: '#/components/schemas/SSLVerificationStatusOperators'
        conditional:
          $ref: '#/components/schemas/Conditionals'
        input_value:
          $ref: '#/components/schemas/SSLVerificationStatusArguments'
      type: object
    RuleSetResult:
      example:
        schema_version: 1
        results:
          is_active: true
          behaviors:
          - null
          - null
          criteria:
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          last_editor: last_editor
          name: name
          description: description
          id: 1
          last_modified: 2000-01-23T04:56:07.000+00:00
          order: 0
      properties:
        results:
          $ref: '#/components/schemas/RuleSetResult_results'
        schema_version:
          minimum: 1
          type: integer
      type: object
    RuleSetResultAll:
      example:
        is_active: true
        behaviors:
        - null
        - null
        criteria:
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        last_editor: last_editor
        name: name
        description: description
        id: 1
        last_modified: 2000-01-23T04:56:07.000+00:00
        order: 0
      properties:
        id:
          format: int64
          minimum: 1
          type: integer
        last_editor:
          format: email
          type: string
        last_modified:
          format: date-time
          type: string
        name:
          type: string
        is_active:
          type: boolean
        description:
          type: string
        behaviors:
          items:
            $ref: '#/components/schemas/Behaviors'
          type: array
        criteria:
          items:
            items:
              $ref: '#/components/schemas/SSLVerificationStatusCriteria'
            type: array
          type: array
        order:
          minimum: 0
          type: integer
      type: object
    CreateRuleSetRequest:
      example:
        is_active: true
        behaviors:
        - null
        - null
        criteria:
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        name: name
      properties:
        name:
          type: string
        is_active:
          type: boolean
        behaviors:
          items:
            $ref: '#/components/schemas/Behaviors'
          type: array
        criteria:
          items:
            items:
              $ref: '#/components/schemas/SSLVerificationStatusCriteria'
            type: array
          type: array
      type: object
    RuleSetResponse:
      example:
        is_active: true
        behaviors:
        - null
        - null
        criteria:
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        last_editor: last_editor
        name: name
        id: 1
        last_modified: 2000-01-23T04:56:07.000+00:00
        order: 1
      properties:
        name:
          type: string
        is_active:
          type: boolean
        behaviors:
          items:
            $ref: '#/components/schemas/Behaviors'
          type: array
        criteria:
          items:
            items:
              $ref: '#/components/schemas/SSLVerificationStatusCriteria'
            type: array
          type: array
        last_modified:
          format: date-time
          type: string
        last_editor:
          format: email
          type: string
        id:
          format: int64
          minimum: 1
          type: integer
        order:
          format: int64
          minimum: 1
          type: integer
      type: object
    RuleSetResponseAll:
      example:
        schema_version: 1
        count: 0
        links:
          next: next
          previous: previous
        total_pages: 0
        results:
        - is_active: true
          behaviors:
          - null
          - null
          criteria:
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          last_editor: last_editor
          name: name
          description: description
          id: 1
          last_modified: 2000-01-23T04:56:07.000+00:00
          order: 0
        - is_active: true
          behaviors:
          - null
          - null
          criteria:
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          - - conditional: null
              variable: null
              input_value: null
              operator: null
            - conditional: null
              variable: null
              input_value: null
              operator: null
          last_editor: last_editor
          name: name
          description: description
          id: 1
          last_modified: 2000-01-23T04:56:07.000+00:00
          order: 0
      properties:
        count:
          format: int64
          minimum: 0
          type: integer
        total_pages:
          format: int64
          minimum: 0
          type: integer
        schema_version:
          default: 3
          format: int32
          type: integer
        links:
          $ref: '#/components/schemas/Links'
        results:
          items:
            $ref: '#/components/schemas/RuleSetResultAll'
          type: array
      type: object
    SetRateLimitBehavior_argument_average_rate_limit:
      oneOf:
      - minimum: 1
        type: integer
      - type: string
    SetRateLimitBehavior_argument:
      example:
        type: second
        limit_by: client_ip
        average_rate_limit: 100
        maximum_burst_size: 10
      properties:
        type:
          enum:
          - second
          - minute
          type: string
        limit_by:
          enum:
          - client_ip
          - global
          type: string
        average_rate_limit:
          $ref: '#/components/schemas/SetRateLimitBehavior_argument_average_rate_limit'
        maximum_burst_size:
          $ref: '#/components/schemas/SetRateLimitBehavior_argument_average_rate_limit'
      type: object
    SetWAFRuleSetBehavior_argument:
      example:
        waf_id: 1
        mode: blocking
      properties:
        waf_id:
          minimum: 1
          type: integer
        mode:
          enum:
          - learning
          - blocking
          type: string
      type: object
    SetWAFRuleSetAndWafModeBehavior_argument:
      example:
        set_waf_ruleset_and_waf_mode: 1
        waf_mode: blocking
      properties:
        set_waf_ruleset_and_waf_mode:
          minimum: 1
          type: integer
        waf_mode:
          enum:
          - learning
          - blocking
          type: string
      required:
      - set_waf_ruleset_and_waf_mode
      - waf_mode
      type: object
    SetCustomResponse_argument_status_code:
      oneOf:
      - type: string
      - maximum: 499
        minimum: 200
        type: integer
    SetCustomResponse_argument:
      example:
        status_code: 200
        content_type: application/json
        content_body: "{}"
      properties:
        status_code:
          $ref: '#/components/schemas/SetCustomResponse_argument_status_code'
        content_type:
          type: string
        content_body:
          type: string
      required:
      - content_body
      - content_type
      - status_code
      type: object
    SimpleArgumentBehavior_argument:
      oneOf:
      - type: string
      - type: number
    RuleSetResult_results:
      example:
        is_active: true
        behaviors:
        - null
        - null
        criteria:
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        - - conditional: null
            variable: null
            input_value: null
            operator: null
          - conditional: null
            variable: null
            input_value: null
            operator: null
        last_editor: last_editor
        name: name
        description: description
        id: 1
        last_modified: 2000-01-23T04:56:07.000+00:00
        order: 0
      properties:
        id:
          format: int64
          minimum: 1
          type: integer
        last_editor:
          format: email
          type: string
        last_modified:
          format: date-time
          type: string
        name:
          type: string
        is_active:
          type: boolean
        description:
          type: string
        behaviors:
          items:
            $ref: '#/components/schemas/Behaviors'
          type: array
        criteria:
          items:
            items:
              $ref: '#/components/schemas/SSLVerificationStatusCriteria'
            type: array
          type: array
        order:
          minimum: 0
          type: integer
      type: object
  securitySchemes:
    tokenAuth:
      description: |
        You must inform a token to auth.
        Usage format: `Token <TOKEN>`
      in: header
      name: Authorization
      type: apiKey
