swagger: '2.0'
info:
  description: Configuration for WAF Violation Summary resource.
  version: 'v2'
  title: waf_violation_summary
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: waf_violation_summary
    description: WAF Violation Summary
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  authParam:
      in: header
      name: Authorization
      type: string
      required: true
      description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
  cloudParam:
      in: header
      name: isCloud
      type: string
      required: true
      description: set the value to true in case of Cloud services, false for on-prem deployment
paths:
  /massvc/{customerid}/macro/v1/security/waf_violation_summary:
    get:
      tags:
        - waf_violation_summary
      summary: GET all waf_violation_summary
      operationId: getall_waf_violation_summary
      description: WAF Violation Summary
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: filter
          type: string
          required: false
          description: "Use this query-parameter to get the filtered set of vm_device resources configured on the system. You can set a filter on any property of the resource.Example:  property-name1:property-value1 "
        - in: query
          name: args
          type: string
          required: false
          description: "Use this query-parameter to specify arguments.Example:  property-name1:property-value1 "
        - in: query
          name: duration
          type: string
          required: true
          description: "Duration "
          enum:
            - last_1_hour
            - last_1_day
            - last_1_week
            - last_1_month
        - in: query
          name: report_start_time
          type: string
          required: false
          description: Use this query-parameter to specify the start time from which the summary for report is considered
        - in: query
          name: report_end_time
          type: string
          required: false
          description: Use this query-parameter to specify the end time until where summary for report is considered
        - in: query
          name: type
          type: string
          required: false
          description: Use this query-parameter to specify the type of report
          enum:
            - detail
            - timeseries
            - summary
            - summary_by_type
            - summary_by_action
            - summary_by_geo
            - list_of_violations
            - summary_by_severity
            - summary_by_category
            - summary_by_geo_severity
            - timeseries_by_type
            - timeseries_by_category
            - top_apps
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the waf_violation_summary resources in chunks.To be used along with pageno query parameter.
        - in: query
          name: pageno
          type: integer
          required: false
          description: Use this query-parameter to get the waf_violation_summary resources in chunks.To be used along with pagesize query parameter.
        - in: query
          name: count
          type: string
          required: false
          description: Use this query-parameter to get the count of waf_violation_summary resources.
          enum:
            - yes
      responses:
        200:
          description:  for waf_violation_summary
          schema: 
              $ref: '#/definitions/getwaf_violation_summarysResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

definitions:
  getwaf_violation_summaryResponse:
    type: object
    required:
      - waf_violation_summary
    properties:
      waf_violation_summary:
        $ref: '#/definitions/waf_violation_summary'
    title: getwaf_violation_summaryResponse
    example:
      waf_violation_summary:
        threat_index: "5"
        ctnsappname: "CERNER"
        total_violations: "10000"
        ip_address: "10.102.103.113-10.102.103.115"
        threshold_breach: "10"
        safety_index: "3"

  getwaf_violation_summarysResponse:
    type: object
    required:
      - waf_violation_summary
    properties:
      waf_violation_summary:
        type: array
        items:
          $ref: '#/definitions/waf_violation_summary'
    title: getwaf_violation_summarysResponse
    example:
      waf_violation_summary:
        threat_index: "5"
        ctnsappname: "CERNER"
        total_violations: "10000"
        ip_address: "10.102.103.113-10.102.103.115"
        threshold_breach: "10"
        safety_index: "3"

  waf_violation_summary_readwrite:
    type: object
    properties:
      threat_index:
        description: "Threat Index"
        type: integer
        format: int32
      ctnsappname:
        description: "AppName"
        type: string
        format: string
      total_violations:
        description: "Total Violations"
        type: number
        format: int64
      ip_address:
        description: "IP Address"
        type: string
        format: string
      threshold_breach:
        description: "Total Requests"
        type: integer
        format: int32
      safety_index:
        description: "Safety Index"
        type: integer
        format: int32

  waf_violation_summary:
    allOf:
      - $ref: '#/definitions/waf_violation_summary_readwrite'

  Error:
    properties:
      errorcode:
        type: number
        format: int32
        example: 1001
      errormessage:
        type: string
        format: string
        example: "id cannot be found"
