swagger: '2.0'
info:
  description: Configuration for Filter Scheduler resource.
  version: 'v2'
  title: filter_scheduler
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: filter_scheduler
    description: Filter Scheduler
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 for all the events
   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_scheduler:
    get:
      tags:
        - filter_scheduler
      summary: GET all filter_scheduler
      operationId: getall_filter_scheduler
      description: Use this operation to device group
      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_scheduler 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_scheduler 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_scheduler resources.
          enum:
            - yes
      responses:
        200:
          description:  for filter_scheduler
          schema: 
              $ref: '#/definitions/getfilter_schedulersResponse'
        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:
        - filter_scheduler
      summary: POST operation for filter_scheduler
      operationId: post_filter_scheduler
      description: POST operation for filter_scheduler
      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: filter_scheduler
          description: filter_scheduler object
          schema:
              $ref: '#/definitions/addfilter_schedulerRequest'
      responses:
        200:
          description: add for filter_scheduler
          schema: 
              $ref: '#/definitions/addfilter_schedulerResponse'
        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/filter_scheduler/{id}:
    get:
      tags:
        - filter_scheduler
      summary: GET by key for filter_scheduler
      operationId: getbykey_filter_scheduler
      description: Use this operation to device group
      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 filter_scheduler
          schema: 
              $ref: '#/definitions/getfilter_schedulerResponse'
        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:
        - filter_scheduler
      summary: PUT for filter_scheduler
      operationId: putbykey_filter_scheduler
      description: Use this operation to modify filter_scheduler
      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: filter_scheduler
          description: filter_scheduler object
          schema:
              $ref: '#/definitions/modifyfilter_schedulerRequest'
      responses:
        200:
          description: add for filter_scheduler
          schema: 
              $ref: '#/definitions/modifyfilter_schedulerResponse'
        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:
        - filter_scheduler
      summary: Delete for filter_scheduler
      operationId: deletebykey_filter_scheduler
      description: Use this operation to delete filter_scheduler
      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 filter_scheduler
        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:
  addfilter_schedulerRequest:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        $ref: '#/definitions/filter_scheduler_readwrite'
    title: addfilter_schedulerRequest
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        filter_status: "ENABLE"

  addfilter_schedulerResponse:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        $ref: '#/definitions/filter_scheduler'
    title: addfilter_schedulerResponse
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        activity_log: "Activity Log Timestamp: Thu, 06 Feb 2020 07:24:37 UTC (The filter job is scheduled to ENABLE  filter daily at  03:30,05:30 )"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        activity_status: "SCHEDULED"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        filter_status: "ENABLE"

  getfilter_schedulerResponse:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        $ref: '#/definitions/filter_scheduler'
    title: getfilter_schedulerResponse
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        activity_log: "Activity Log Timestamp: Thu, 06 Feb 2020 07:24:37 UTC (The filter job is scheduled to ENABLE  filter daily at  03:30,05:30 )"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        activity_status: "SCHEDULED"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        filter_status: "ENABLE"

  getfilter_schedulersResponse:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        type: array
        items:
          $ref: '#/definitions/filter_scheduler'
    title: getfilter_schedulersResponse
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        activity_log: "Activity Log Timestamp: Thu, 06 Feb 2020 07:24:37 UTC (The filter job is scheduled to ENABLE  filter daily at  03:30,05:30 )"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        activity_status: "SCHEDULED"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        filter_status: "ENABLE"

  modifyfilter_schedulerRequest:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        $ref: '#/definitions/filter_scheduler_readwrite'
    title: modifyfilter_schedulerRequest
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        filter_status: "ENABLE"

  modifyfilter_schedulerResponse:
    type: object
    required:
      - filter_scheduler
    properties:
      filter_scheduler:
        $ref: '#/definitions/filter_scheduler'
    title: modifyfilter_schedulerResponse
    example:
      filter_scheduler:
        details: [{        scheduleEndTimesEpoch: "string_value"
,        scheduleStartTimesEpoch: "string_value"
,        parent_name: "string_value"
,        endRecurrenceTimes: "string_value"
,        id: "string_value"
,        startRecurrenceTimes: "string_value"
,        parent_id: "string_value"
}]
        recurrence_type: "daily"
        tz_offset: "0"
        activity_log: "Activity Log Timestamp: Thu, 06 Feb 2020 07:24:37 UTC (The filter job is scheduled to ENABLE  filter daily at  03:30,05:30 )"
        filter_job_name: "string_value"
        recurrenceOptions: "Mon,Wed"
        activity_status: "SCHEDULED"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        filter_status: "ENABLE"

  filter_scheduler_readwrite:
    type: object
    properties:
      details:
        type: array
        items:
          $ref: '#/definitions/filter_schedule_details_readwrite'
      recurrence_type:
        description: "Type of recurrence of schedule for the filter : daily/weekly/specific day"
        type: string
        format: string
        maxLength: 255
      tz_offset:
        description: "Time zone offset."
        type: integer
        format: int32
      filter_job_name:
        description: "Filter Job Name"
        type: string
        format: string
        maxLength: 255
      recurrenceOptions:
        description: "Comma separated recurrence options of job that is scheduled"
        type: string
        format: string
      filter_status:
        description: "filter status - enabled, disabled, pause"
        type: string
        format: string
        maxLength: 255

  filter_scheduler:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the events
            type: string
            format: uuid
          activity_log:
             description: "Activity description"
             type: string
             format: string
          activity_status:
             description: "Activity Status"
             type: string
             format: string
      - $ref: '#/definitions/filter_scheduler_readwrite'

  filter_schedule_details_readwrite:
    type: object
    properties:
      scheduleEndTimesEpoch:
        description: "Schedule time epoch (string representation of 11 digit numbers)."
        type: string
        format: string
      scheduleStartTimesEpoch:
        description: "Schedule time epoch (string representation of 11 digit numbers)."
        type: string
        format: string
      parent_name:
        description: "Name of the parent resource"
        type: string
        format: string
      endRecurrenceTimes:
        description: "Comma separated recurrence epoch times at which job is to be executed"
        type: string
        format: string
      startRecurrenceTimes:
        description: "Comma separated recurrence epoch times at which job is to be executed"
        type: string
        format: string
      parent_id:
        description: "Id of the parent resource"
        type: string
        format: uuid

  filter_schedule_details:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the events
            type: string
            format: uuid
      - $ref: '#/definitions/filter_schedule_details_readwrite'

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