swagger: '2.0'
info:
  description: Configuration for Syslog Suppress Filters resource.
  version: 'v2'
  title: syslog_filter
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: syslog_filter
    description: Syslog Suppress Filters
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is system generated key
   required: true
  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}/nitro/v2/config/syslog_filter:
    get:
      tags:
        - syslog_filter
      summary: GET all syslog_filter
      operationId: getall_syslog_filter
      description: Use this operation to get filters
      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: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the syslog_filter 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 syslog_filter 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 syslog_filter resources.
          enum:
            - yes
      responses:
        200:
          description:  for syslog_filter
          schema: 
              $ref: '#/definitions/getsyslog_filtersResponse'
        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'

    post:
      tags:
        - syslog_filter
      summary: POST operation for syslog_filter
      operationId: post_syslog_filter
      description: POST operation for syslog_filter
      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: onerror
          description: Use this parameter to set the onerror status for nitro request. Applicable only for bulk requests.
          required: false
          type: string
          default: CONTINUE
          enum:
            - EXIT
            - CONTINUE
        - in: body
          name: syslog_filter
          description: syslog_filter object
          schema:
              $ref: '#/definitions/addsyslog_filterRequest'
      responses:
        200:
          description: add for syslog_filter
          schema: 
              $ref: '#/definitions/addsyslog_filterResponse'
        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'

  /massvc/{customerid}/nitro/v2/config/syslog_filter/{id}:
    get:
      tags:
        - syslog_filter
      summary: GET by key for syslog_filter
      operationId: getbykey_syslog_filter
      description: Use this operation to get filters
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - 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
      responses:
        200:
          description: add for syslog_filter
          schema: 
              $ref: '#/definitions/getsyslog_filterResponse'
        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'

    put:
      tags:
        - syslog_filter
      summary: PUT for syslog_filter
      operationId: putbykey_syslog_filter
      description: Use this operation to modify filter
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - 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: body
          name: syslog_filter
          description: syslog_filter object
          schema:
              $ref: '#/definitions/modifysyslog_filterRequest'
      responses:
        200:
          description: add for syslog_filter
          schema: 
              $ref: '#/definitions/modifysyslog_filterResponse'
        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'

    delete:
      tags:
        - syslog_filter
      summary: Delete for syslog_filter
      operationId: deletebykey_syslog_filter
      description: Use this operation to delete filter
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - 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
      responses:
        204:
          description: add for syslog_filter
        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:
  addsyslog_filterRequest:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        $ref: '#/definitions/syslog_filter_readwrite'
    title: addsyslog_filterRequest
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  addsyslog_filterResponse:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        $ref: '#/definitions/syslog_filter'
    title: addsyslog_filterResponse
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  getsyslog_filterResponse:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        $ref: '#/definitions/syslog_filter'
    title: getsyslog_filterResponse
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  getsyslog_filtersResponse:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        type: array
        items:
          $ref: '#/definitions/syslog_filter'
    title: getsyslog_filtersResponse
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  modifysyslog_filterRequest:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        $ref: '#/definitions/syslog_filter_readwrite'
    title: modifysyslog_filterRequest
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  modifysyslog_filterResponse:
    type: object
    required:
      - syslog_filter
    properties:
      syslog_filter:
        $ref: '#/definitions/syslog_filter'
    title: modifysyslog_filterResponse
    example:
      syslog_filter:
        is_enabled: "false"
        name: "NetScaler Console VIPs"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        severity: "info"
        message: "ns_client_ipaddress : 1.1.1.1"
        facilities: "string_value"
        devices: "[1.1.1.1-1.1.1.2, 1.1.1.3]"
        facilities_array: ["string_value1","string_value2"]
        devices_array: ["string_value1","string_value2"]
        severity_array: ["string_value1","string_value2"]

  syslog_filter_readwrite:
    type: object
    properties:
      is_enabled:
        description: "Filter is enabled or disabled"
        type: boolean
        format: boolean
      name:
        description: "Filter Name"
        type: string
        format: string
        maxLength: 255
      severity:
        description: "Comma separated string of severities to be suppressed"
        type: string
        format: string
      message:
        description: "Wildcard substring for syslog message to be suppressed"
        type: string
        format: string
      facilities:
        description: "Comma separated string of facilities to be suppressed"
        type: string
        format: string
      devices:
        description: "Comma separated string of devices to be suppressed"
        type: string
        format: string
      facilities_array:
        description: "Facilities list"
        type: array
        items:
          type: string
          format: string
      devices_array:
        description: "Devices list"
        type: array
        items:
          type: string
          format: string
      severity_array:
        description: "Severity list"
        type: array
        items:
          type: string
          format: string

  syslog_filter:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: uuid
      - $ref: '#/definitions/syslog_filter_readwrite'

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