swagger: '2.0'
info:
  description: Configuration for Scheduled export report job resource.
  version: 'v2'
  title: export_report_job
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: export_report_job
    description: Scheduled export report job
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is job_schedule id for all the export_report_job details
   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/export_report_job:
    get:
      tags:
        - export_report_job
      summary: GET all export_report_job
      operationId: getall_export_report_job
      description: Use this operation to get job_schedule detail
      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 export_report_job 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 export_report_job 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 export_report_job resources.
          enum:
            - yes
      responses:
        200:
          description:  for export_report_job
          schema: 
              $ref: '#/definitions/getexport_report_jobsResponse'
        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/export_report_job/{id}:
    get:
      tags:
        - export_report_job
      summary: GET by key for export_report_job
      operationId: getbykey_export_report_job
      description: Use this operation to get job_schedule detail
      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:  for export_report_job
          schema: 
              $ref: '#/definitions/getexport_report_jobResponse'
        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:
        - export_report_job
      summary: PUT for export_report_job
      operationId: putbykey_export_report_job
      description: Use this operation to modify export report job.
      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: export_report_job
          description: export_report_job object
          schema:
              $ref: '#/definitions/modifyexport_report_jobRequest'
      responses:
        200:
          description:  for export_report_job
          schema: 
              $ref: '#/definitions/modifyexport_report_jobResponse'
        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:
        - export_report_job
      summary: Delete for export_report_job
      operationId: deletebykey_export_report_job
      description: Use this operation to delete export report job.
      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:  for export_report_job
        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:
  getexport_report_jobResponse:
    type: object
    required:
      - export_report_job
    properties:
      export_report_job:
        $ref: '#/definitions/export_report_job'
    title: getexport_report_jobResponse
    example:
      export_report_job:
        slack_profile_name: "john-slack-profile"
        recurrence_option: "mon"
        subject: "User Administration"
        status: "Completed"
        export_format: "PDF"
        description: "NetScaler Console: System: User Administration"
        mail_profile_name: "john-email"
        recurrence: "Daily"
        tz_offset: "0"
        tabular_report: "true"
        next_scheduletime: "1581100200"
        export_time: "1580927400"
        job_name: "Users Export Job"
        trigger_start: "string_value"
        report_name: "UserAdministration.pdf"
        id: "16d64e04-26c3-4d69-a5ed-f9e730201464"
        records_limit: "50000"

  getexport_report_jobsResponse:
    type: object
    required:
      - export_report_job
    properties:
      export_report_job:
        type: array
        items:
          $ref: '#/definitions/export_report_job'
    title: getexport_report_jobsResponse
    example:
      export_report_job:
        slack_profile_name: "john-slack-profile"
        recurrence_option: "mon"
        subject: "User Administration"
        status: "Completed"
        export_format: "PDF"
        description: "NetScaler Console: System: User Administration"
        mail_profile_name: "john-email"
        recurrence: "Daily"
        tz_offset: "0"
        tabular_report: "true"
        next_scheduletime: "1581100200"
        export_time: "1580927400"
        job_name: "Users Export Job"
        trigger_start: "string_value"
        report_name: "UserAdministration.pdf"
        id: "16d64e04-26c3-4d69-a5ed-f9e730201464"
        records_limit: "50000"

  modifyexport_report_jobRequest:
    type: object
    required:
      - export_report_job
    properties:
      export_report_job:
        $ref: '#/definitions/export_report_job_readwrite'
    title: modifyexport_report_jobRequest
    example:
      export_report_job:
        slack_profile_name: "john-slack-profile"
        recurrence_option: "mon"
        subject: "User Administration"
        export_format: "PDF"
        description: "NetScaler Console: System: User Administration"
        mail_profile_name: "john-email"
        recurrence: "Daily"
        tabular_report: "true"
        next_scheduletime: "1581100200"
        export_time: "1580927400"
        job_name: "Users Export Job"
        report_name: "UserAdministration.pdf"
        records_limit: "50000"

  modifyexport_report_jobResponse:
    type: object
    required:
      - export_report_job
    properties:
      export_report_job:
        $ref: '#/definitions/export_report_job'
    title: modifyexport_report_jobResponse
    example:
      export_report_job:
        slack_profile_name: "john-slack-profile"
        recurrence_option: "mon"
        subject: "User Administration"
        status: "Completed"
        export_format: "PDF"
        description: "NetScaler Console: System: User Administration"
        mail_profile_name: "john-email"
        recurrence: "Daily"
        tz_offset: "0"
        tabular_report: "true"
        next_scheduletime: "1581100200"
        export_time: "1580927400"
        job_name: "Users Export Job"
        trigger_start: "string_value"
        report_name: "UserAdministration.pdf"
        id: "16d64e04-26c3-4d69-a5ed-f9e730201464"
        records_limit: "50000"

  export_report_job_readwrite:
    type: object
    properties:
      slack_profile_name:
        description: "Slack profile name to send slack notification."
        type: string
        format: string
        minLength: 1
        maxLength: 255
      recurrence_option:
        description: "Recurrence option (Weekly -> mon - sun, Monthly -> date in DD format)."
        type: string
        format: string
      subject:
        description: "subject"
        type: string
        format: string
        maxLength: 256
      export_format:
        description: "Report Export format (PDF/JPEG/PNG)"
        type: string
        format: string
        minLength: 3
        maxLength: 4
      description:
        description: "Report Description."
        type: string
        format: string
        maxLength: 512
      mail_profile_name:
        description: "Mail profile name to send notification mail."
        type: string
        format: string
        minLength: 1
        maxLength: 255
      recurrence:
        description: "Recurrence (Daily, Weekly, Monthly)."
        type: string
        format: string
        maxLength: 16
      tabular_report:
        description: "Tabular report value true and snapshot report value false."
        type: boolean
        format: boolean
      next_scheduletime:
        description: "Next Schedule Time in timestamp"
        type: integer
        format: int32
      export_time:
        description: "Report Export time GMT epoch (string representation of 10 digit numbers)."
        type: string
        format: string
        minLength: 5
        maxLength: 16
      job_name:
        description: "job name is ExportJob."
        type: string
        format: string
        maxLength: 16
      report_name:
        description: "report name"
        type: string
        format: string
        maxLength: 255
      records_limit:
        description: "Record limit for csv export"
        type: integer
        format: int32

  export_report_job:
    allOf:
      -
        properties:
          id:
            description: Id is job_schedule id for all the export_report_job details
            type: string
            format: uuid
      - $ref: '#/definitions/export_report_job_readwrite'

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