Keboola schedules API

The schedules API from Keboola — 4 operation(s) for schedules.

OpenAPI Specification

keboola-schedules-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: AI Service Actions schedules API
  version: 1.0.0
  contact:
    email: devel@keboola.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
tags:
- name: schedules
paths:
  /schedules:
    get:
      tags:
      - schedules
      summary: List schedules
      description: 'Lists activated configurations of schedules

        '
      parameters:
      - in: query
        name: componentId
        description: List schedules for a given *Component ID*. If used, must be combined with configurationId.
        required: false
        schema:
          type: string
        examples:
          id:
            summary: Example component
            value: keboola.ex-db-snowflake
      - in: query
        name: configurationId
        description: List schedules for a given *Configuration ID*. If used, must be combined with ComponentId.
        required: false
        schema:
          type: string
        examples:
          id:
            summary: Example configuration
            value: '12345'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Schedule'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Activate Schedule
      operationId: activate
      tags:
      - schedules
      description: 'Activates and existing configuration of `keboola.scheduler` so that it becomes an active schedule.

        '
      requestBody:
        description: 'This will read the configuration (identified by the given `configurationId` and optionally `configurationVersionId`) of a `keboola.scheduler` component and read the scheduler configuration from there. The activated configuration data is returned in the response. The read configuration version is recorded in the schedule and will be used until another configuration version is activated using this API call.

          '
        content:
          application/json:
            schema:
              type: object
              required:
              - configurationId
              properties:
                configurationId:
                  type: string
                configurationVersionId:
                  type: string
            examples:
              Activate configuration:
                value:
                  configurationId: 12333456
              Activate a given version of the configuration:
                value:
                  configurationId: 12333456
                  configurationVersionId: 12
      responses:
        '200':
          description: Schedule Activated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /schedules/{scheduleId}:
    get:
      summary: Get schedule detail
      operationId: getSchedule
      tags:
      - schedules
      description: 'Get details of a specified schedule

        '
      parameters:
      - in: path
        name: scheduleId
        description: Schedule ID
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete schedule
      operationId: deleteSchedule
      tags:
      - schedules
      description: 'Permanently deactivate a specified schedule. The schedule configuration of the `keboola.scheduler` component will not be touched.

        '
      parameters:
      - in: path
        name: scheduleId
        description: Schedule ID
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Success response
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /schedules/{scheduleId}/refreshToken:
    post:
      summary: Refresh the schedule token
      operationId: refreshToken
      tags:
      - schedules
      description: 'Refresh the the token associated with the schedule, if the token is refreshed directly in Storage API, the schedule won''t work.

        '
      parameters:
      - in: path
        name: scheduleId
        description: Schedule ID
        required: true
        schema:
          type: string
      responses:
        '202':
          description: Success response
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /configurations/{configurationId}:
    delete:
      summary: Delete schedules for configuration
      operationId: deleteSchedulesForConfiguration
      tags:
      - schedules
      description: 'Permanently deactivate schedules for given configuration. The schedule configurations of the `keboola.scheduler` component will not be touched.

        '
      parameters:
      - in: path
        name: configurationId
        description: Configuration ID
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Success response
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
      - error
      - code
      - status
      - context
      properties:
        error:
          type: string
          example: The value foobar is invalid
        code:
          type: integer
          example: 400
        status:
          type: string
          enum:
          - error
        exceptionId:
          type: string
          example: scheduler-1234567890
        context:
          type: object
    Schedule:
      type: object
      required:
      - id
      - tokenId
      - configurationId
      - configurationVersionId
      - schedule
      - target
      - executions
      properties:
        id:
          type: string
          example: 123456789
        tokenId:
          type: string
          example: 123456790
          description: 'ID of Storage token used to execute the schedule.

            '
        configurationId:
          type: string
          example: 123456790
          description: 'ID of the configuration of the schedule.

            '
        configurationVersionId:
          type: string
          example: 123456790
          description: 'Version of the configuration of the schedule.

            '
        schedule:
          type: object
          required:
          - cronTab
          - timezone
          - state
          properties:
            cronTab:
              type: string
              example: '*/2 * * * *'
              description: 'Cron expression describing the schedule

                '
            timezone:
              type: string
              example: UTC
              description: 'Timezone of the cron expression evaluation, either (UTC) a name of offset (+0100).

                '
            state:
              type: string
              enum:
              - enabled
              - disabled
        target:
          type: object
          required:
          - componentId
          - configurationId
          - mode
          - tag
          properties:
            componentId:
              type: string
              example: keboola.ex-db-snowflake
            configurationId:
              type: string
              example: 12345
            mode:
              type: string
              example: run
            tag:
              type: string
              example: 1.2.3
        executions:
          type: array
          items:
            type: object
            required:
            - jobId
            - executionTime
            properties:
              jobId:
                type: string
                example: 12345
              executionTime:
                type: string
                format: date-time
                example: '2019-06-21T09:12:33.001Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-StorageApi-Token