swagger: '2.0'
info:
  description: Configuration for Bot Violation resource.
  version: 'v2'
  title: bot_violation
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: bot_violation
    description: Bot Violation
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/bot_violation:
    get:
      tags:
        - bot_violation
      summary: GET all bot_violation
      operationId: getall_bot_violation
      description: Get the list of bot violations.
      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
            - summary
            - summary_by_geo_severity
            - list_of_violations
            - timeseries_by_category
            - timeseries_by_type
            - timeseries
            - summary_by_type
            - summary_by_action
            - summary_by_geo
            - summary_by_category
            - summary_by_severity
            - list_of_applications
            - bounded_apps
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the bot_violation 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 bot_violation 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 bot_violation resources.
          enum:
            - yes
      responses:
        200:
          description:  for bot_violation
          schema: 
              $ref: '#/definitions/getbot_violationsResponse'
        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:
  getbot_violationResponse:
    type: object
    required:
      - bot_violation
    properties:
      bot_violation:
        $ref: '#/definitions/bot_violation'
    title: getbot_violationResponse
    example:
      bot_violation:
        bot_developer: "test"
        bot_signature_category: "sig category"
        country_code: "IN"
        latitude: "4.1"
        bot_type_desc: "Bad"
        ctnsappname: "test_vserver"
        signature_id: "12"
        bot_category_desc: "BlackList"
        longitude: "2.9"
        region_code: "Karnataka"
        bot_detection_mechanism: "3"
        http_req_url: "http://192.168.10.132/index.html"
        bot_detection_mechanism_desc: "TPS"
        transaction_id: "197114497"
        session_id: "session_id"
        bot_type: "2"
        action_type: "7"
        appname: "appname_10.201.30.20_cs"
        city: "Bangalore"
        action_type_desc: "Reset"
        ip_address: "10.102.103.113-10.102.103.115"
        bot_severity_desc: "Low"
        source_ip_address: "1630563670"
        attack_time: "1630563670"
        bot_category: "3"
        rpt_sample_time: "1630563670"
        backend_appname: "testlb_10.102.103.11_lb"
        total_attacks: "15000"
        bot_severity: "3"
        bot_true_client_ip: "1235643"
        domain_name: "192.168.10.132"
        backend_vserver: "testlb"
        bot_log_message: "message"
        profile_name: "bot_profile"

  getbot_violationsResponse:
    type: object
    required:
      - bot_violation
    properties:
      bot_violation:
        type: array
        items:
          $ref: '#/definitions/bot_violation'
    title: getbot_violationsResponse
    example:
      bot_violation:
        bot_developer: "test"
        bot_signature_category: "sig category"
        country_code: "IN"
        latitude: "4.1"
        bot_type_desc: "Bad"
        ctnsappname: "test_vserver"
        signature_id: "12"
        bot_category_desc: "BlackList"
        longitude: "2.9"
        region_code: "Karnataka"
        bot_detection_mechanism: "3"
        http_req_url: "http://192.168.10.132/index.html"
        bot_detection_mechanism_desc: "TPS"
        transaction_id: "197114497"
        session_id: "session_id"
        bot_type: "2"
        action_type: "7"
        appname: "appname_10.201.30.20_cs"
        city: "Bangalore"
        action_type_desc: "Reset"
        ip_address: "10.102.103.113-10.102.103.115"
        bot_severity_desc: "Low"
        source_ip_address: "1630563670"
        attack_time: "1630563670"
        bot_category: "3"
        rpt_sample_time: "1630563670"
        backend_appname: "testlb_10.102.103.11_lb"
        total_attacks: "15000"
        bot_severity: "3"
        bot_true_client_ip: "1235643"
        domain_name: "192.168.10.132"
        backend_vserver: "testlb"
        bot_log_message: "message"
        profile_name: "bot_profile"

  bot_violation_readwrite:
    type: object
    properties:
      bot_developer:
        description: "Bot Developer"
        type: string
        format: string
      bot_signature_category:
        description: "Bot Signature Category"
        type: string
        format: string
      country_code:
        description: "country_code"
        type: string
        format: string
      latitude:
        description: "latitude"
        type: number
        format: double
      bot_type_desc:
        description: "Bot Type Description"
        type: string
        format: string
      ctnsappname:
        description: "AppName"
        type: string
        format: string
      signature_id:
        description: "Signature Id"
        type: number
        format: int64
      bot_category_desc:
        description: "Bot Category Desc."
        type: string
        format: string
      longitude:
        description: "longitude"
        type: number
        format: double
      region_code:
        description: "region_code"
        type: string
        format: string
      bot_detection_mechanism:
        description: "Bot Detection Mechanism."
        type: integer
        format: int32
      http_req_url:
        description: "HTTP Request URL."
        type: string
        format: string
      bot_detection_mechanism_desc:
        description: "Bot Detection Mechanism Desc"
        type: string
        format: string
      transaction_id:
        description: "Transaction ID"
        type: number
        format: int64
      session_id:
        description: "session_id"
        type: string
        format: string
      bot_type:
        description: "bot_type"
        type: integer
        format: int32
      action_type:
        description: "Bot Type."
        type: number
        format: int64
      appname:
        description: "App Name"
        type: string
        format: string
      city:
        description: "city"
        type: string
        format: string
      action_type_desc:
        description: "Action Type Description"
        type: string
        format: string
      ip_address:
        description: "Field to store the ip address as it is along with any extension"
        type: string
        format: string
      bot_severity_desc:
        description: "Bot Severity Desc"
        type: string
        format: string
      source_ip_address:
        description: "Server Source IP Address"
        type: number
        format: int64
      attack_time:
        description: "Attack time."
        type: number
        format: int64
      bot_category:
        description: "Bot Category."
        type: number
        format: int64
      rpt_sample_time:
        description: "Report Sample time."
        type: number
        format: int64
      backend_appname:
        description: "Backend App Name"
        type: string
        format: string
      total_attacks:
        description: "Total attacks to this APP in given sampled timeframe."
        type: number
        format: int64
      bot_severity:
        description: "bot_severity."
        type: integer
        format: int32
      bot_true_client_ip:
        description: "True Client IP"
        type: integer
        format: int32
      domain_name:
        description: "Domain Name"
        type: string
        format: string
      backend_vserver:
        description: "Backend Vserver"
        type: string
        format: string
      bot_log_message:
        description: "Bot Log Message"
        type: string
        format: string
      profile_name:
        description: "profile_name"
        type: string
        format: string

  bot_violation:
    allOf:
      - $ref: '#/definitions/bot_violation_readwrite'

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