swagger: '2.0'
info:
  description: Configuration for event filter action properties resource.
  version: 'v2'
  title: filter_action
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: filter_action
    description: event filter action properties
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/filter_action:
    get:
      tags:
        - filter_action
      summary: GET all filter_action
      operationId: getall_filter_action
      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 filter_action 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 filter_action 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 filter_action resources.
          enum:
            - yes
      responses:
        200:
          description:  for filter_action
          schema: 
              $ref: '#/definitions/getfilter_actionsResponse'
        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:
  getfilter_actionResponse:
    type: object
    required:
      - filter_action
    properties:
      filter_action:
        $ref: '#/definitions/filter_action'
    title: getfilter_actionResponse
    example:
      filter_action:
        parent_name: "configchangerule1"
        props: [{        parent_name: "string_value"
,        value: "string_value"
,        name: "string_value"
,        id: "string_value"
,        parent_id: "string_value"
}]
        action_name: "sendmail_action"
        type: "NDS or AD"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        suppress_time: "integer_value"
        parent_id: "c970e730-6bc5-44c2-a2bf-8dd1382f9b5f"
        repeat_email_notification_threshold: "0"
        attachment: "string_value"
        subject: "Major: Notification from NetScaler Agent 1.1.1.1_ns"
        sender: "userfirstname.lastname@company.com"
        subject_attach_failureobject: "boolean_value"
        user_message: "string_value"
        profile_name: "sms_test"

  getfilter_actionsResponse:
    type: object
    required:
      - filter_action
    properties:
      filter_action:
        type: array
        items:
          $ref: '#/definitions/filter_action'
    title: getfilter_actionsResponse
    example:
      filter_action:
        parent_name: "configchangerule1"
        props: [{        parent_name: "string_value"
,        value: "string_value"
,        name: "string_value"
,        id: "string_value"
,        parent_id: "string_value"
}]
        action_name: "sendmail_action"
        type: "NDS or AD"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        suppress_time: "integer_value"
        parent_id: "c970e730-6bc5-44c2-a2bf-8dd1382f9b5f"
        repeat_email_notification_threshold: "0"
        attachment: "string_value"
        subject: "Major: Notification from NetScaler Agent 1.1.1.1_ns"
        sender: "userfirstname.lastname@company.com"
        subject_attach_failureobject: "boolean_value"
        user_message: "string_value"
        profile_name: "sms_test"

  filter_action_readwrite:
    type: object
    properties:
      parent_name:
        description: "Name of the parent resource"
        type: string
        format: string
      type:
        description: "Action Type e.g. SENDMAIL,SENDSMS"
        type: string
        format: string
        maxLength: 255
      suppress_time:
        description: "If specified, the particular event will be suppressed for this time"
        type: integer
        format: int32
      parent_id:
        description: "Id of the parent resource"
        type: string
        format: uuid
      repeat_email_notification_threshold:
        description: "RepeatEmailNotificationThreshold - If enabled, send the mail repeatedly at the specified intervals untill the event is cleared"
        type: integer
        format: int32
      attachment:
        description: "Attachment for the E-mail action"
        type: string
        format: string
      subject:
        description: "Subject of the mail"
        type: string
        format: string
        maxLength: 255
      user_message:
        description: "User Message"
        type: string
        format: string
      profile_name:
        description: "Mail or SMS profile name"
        type: string
        format: string

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

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