Laravel Scheduled Jobs API

The Scheduled Jobs API from Laravel — 6 operation(s) for scheduled jobs.

OpenAPI Specification

laravel-scheduled-jobs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Laravel Cloud Applications Scheduled Jobs API
  version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: Scheduled Jobs
paths:
  /orgs/{organization}/servers/{server}/scheduled-jobs:
    get:
      operationId: organizations.servers.scheduled-jobs.index
      description: 'List all scheduled jobs associated with the server.


        Processing mode: <small><code>sync</code></small>'
      summary: List server scheduled jobs
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: page[size]
        in: query
        description: The number of results that will be returned per page.
        schema:
          type: integer
          default: 30
      - name: page[cursor]
        in: query
        description: The cursor to start the pagination from.
        schema:
          type: string
      - name: filter[status]
        in: query
        schema:
          type: string
      - name: filter[user]
        in: query
        schema:
          type: string
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - created_at
            - -created_at
            - updated_at
            - -updated_at
            - status
            - -status
        explode: false
      responses:
        '200':
          description: Paginated set of `JobResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobResource'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      next_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the next set of items.
                      prev_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the previous set of items.
                    required:
                    - path
                    - per_page
                    - next_cursor
                    - prev_cursor
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    post:
      operationId: organizations.servers.scheduled-jobs.store
      description: 'Create a specific scheduled job.


        Processing mode: <small><code>async</code></small>'
      summary: Create scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduledJobRequest'
      responses:
        '202':
          description: '`JobResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/scheduled-jobs/{job}:
    get:
      operationId: organizations.servers.scheduled-jobs.show
      description: 'Show a specific scheduled job.


        Processing mode: <small><code>sync</code></small>'
      summary: Get scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '200':
          description: '`JobResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    delete:
      operationId: organizations.servers.scheduled-jobs.destroy
      description: 'Delete a specific scheduled job.


        Processing mode: <small><code>async</code></small>'
      summary: Delete scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '202':
          description: Removal of scheduled job from server accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/scheduled-jobs/{job}/output:
    get:
      operationId: organizations.servers.scheduled-jobs.outputs.show
      description: 'Show a specific scheduled job output.


        Processing mode: <small><code>sync</code></small>'
      summary: Get scheduled job output
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '200':
          description: '`JobOutputResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobOutputResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
  /orgs/{organization}/servers/{server}/sites/{site}/scheduled-jobs:
    get:
      operationId: organizations.servers.sites.scheduled-jobs.index
      description: 'List all scheduled jobs associated with the site.


        Processing mode: <small><code>sync</code></small>'
      summary: List site scheduled jobs
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: site
        in: path
        required: true
        description: The site ID
        schema:
          type: integer
      - name: page[size]
        in: query
        description: The number of results that will be returned per page.
        schema:
          type: integer
          default: 30
      - name: page[cursor]
        in: query
        description: The cursor to start the pagination from.
        schema:
          type: string
      - name: filter[status]
        in: query
        schema:
          type: string
      - name: filter[user]
        in: query
        schema:
          type: string
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - created_at
            - -created_at
            - updated_at
            - -updated_at
            - status
            - -status
        explode: false
      responses:
        '200':
          description: Paginated set of `JobResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/JobResource'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      next_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the next set of items.
                      prev_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the previous set of items.
                    required:
                    - path
                    - per_page
                    - next_cursor
                    - prev_cursor
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    post:
      operationId: organizations.servers.sites.scheduled-jobs.store
      description: 'Create a specific scheduled job for the site.


        Processing mode: <small><code>async</code></small>'
      summary: Create site scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: site
        in: path
        required: true
        description: The site ID
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduledJobRequest'
      responses:
        '202':
          description: '`JobResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/sites/{site}/scheduled-jobs/{job}:
    get:
      operationId: organizations.servers.sites.scheduled-jobs.show
      description: 'Show a specific scheduled job.


        Processing mode: <small><code>sync</code></small>'
      summary: Get site scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: site
        in: path
        required: true
        description: The site ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '200':
          description: '`JobResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    delete:
      operationId: organizations.servers.sites.scheduled-jobs.destroy
      description: 'Delete a specific scheduled job associated with the site.


        Processing mode: <small><code>async</code></small>'
      summary: Delete site scheduled job
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: site
        in: path
        required: true
        description: The site ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '202':
          description: Removal of scheduled job from server accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/sites/{site}/scheduled-jobs/{job}/output:
    get:
      operationId: organizations.servers.sites.scheduled-jobs.outputs.show
      description: 'Show a specific scheduled job output associated with the site.


        Processing mode: <small><code>sync</code></small>'
      summary: Get site scheduled job output
      tags:
      - Scheduled Jobs
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: site
        in: path
        required: true
        description: The site ID
        schema:
          type: integer
      - name: job
        in: path
        required: true
        description: The job ID
        schema:
          type: integer
      responses:
        '200':
          description: '`JobOutputResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/JobOutputResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
components:
  schemas:
    Link:
      type: object
      properties:
        href:
          type: string
          format: uri
        rel:
          type: string
        describedby:
          type: string
        title:
          type: string
        type:
          type: string
        hreflang:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
        meta:
          type: object
      required:
      - href
      title: Link
    CronFrequency:
      type: string
      enum:
      - minutely
      - hourly
      - nightly
      - weekly
      - monthly
      - reboot
      - custom
      title: CronFrequency
    JobResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - scheduledJobs
        attributes:
          type: object
          properties:
            name:
              type:
              - string
              - 'null'
            command:
              type: string
            status:
              type: string
            user:
              type: string
            frequency:
              type: string
            cron:
              type: string
            next_run_time:
              type: string
            created_at:
              type:
              - string
              - 'null'
              format: date-time
            updated_at:
              type:
              - string
              - 'null'
              format: date-time
          required:
          - name
          - command
          - status
          - user
          - frequency
          - cron
          - next_run_time
          - created_at
          - updated_at
        links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/Link'
          required:
          - self
      required:
      - id
      - type
      - links
      title: JobResource
    CreateScheduledJobRequest:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
          description: The name of the command.
          examples:
          - My scheduled job
        command:
          type: string
          description: The command to run.
          examples:
          - echo $(whoami)
        user:
          type: string
          description: The user to run the scheduled job as.
          examples:
          - root
        frequency:
          description: The frequency of the scheduled job.
          examples:
          - hourly
          $ref: '#/components/schemas/CronFrequency'
        cron:
          type:
          - string
          - 'null'
          description: The cron expression to use for the scheduled job. Only used if frequency is set to Custom.
          examples:
          - 0 * * * *
        heartbeat:
          type:
          - boolean
          - 'null'
          description: Whether a heartbeat should be created for the scheduled job.
          examples:
          - true
        grace_period:
          description: The grace period, in minutes, for the heartbeat.
          examples:
          - 5
          $ref: '#/components/schemas/HeartbeatGracePeriod'
      required:
      - command
      - user
      - frequency
      title: CreateScheduledJobRequest
    HeartbeatGracePeriod:
      type: integer
      enum:
      - 1
      - 2
      - 5
      - 10
      - 30
      - 60
      title: HeartbeatGracePeriod
    JobOutputResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - scheduledJobOutputs
        attributes:
          type: object
          properties:
            output:
              type: string
          required:
          - output
        links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/Link'
          required:
          - self
      required:
      - id
      - type
      - links
      title: JobOutputResource
  responses:
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
            - message
            - errors
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
  securitySchemes:
    http:
      type: http
      description: The Bearer Token generated on the Cloud UI.
      scheme: bearer
      bearerFormat: bearer