scitran/core

View on GitHub
swagger/paths/batch.yaml

Summary

Maintainability
Test Coverage
/batch:
  get:
    summary: Get a list of batch jobs the user has created.
    description: Requires login.
    operationId: get_all_batches
    tags:
    - batch
    responses:
      '200':
        description: 'Returns a list of all known batch jobs for the user'
        schema:
          $ref: schemas/output/batch-list.json
  post:
    summary: Create a batch job proposal and insert it as 'pending'.
    operationId: propose_batch
    tags:
    - batch
    parameters:
      - name: body
        in: body
        required: true
        description: The batch proposal
        schema:
          $ref: schemas/input/propose-batch.json
    responses:
      '200':
        description: The batch proposal object that was created
        schema:
          $ref: schemas/output/batch-proposal.json

/batch/{BatchId}:
  parameters:
    - in: path
      type: string
      name: BatchId
      required: true
  get:
    summary: Get batch job details.
    parameters:
      - name: jobs
        in: query
        type: boolean
        description: If true, return job objects instead of job ids
    operationId: get_batch
    tags:
    - batch
    responses:
      '200':
        description: 'The batch object'
        schema:
          $ref: schemas/output/batch.json
      '404':
        $ref: '#/responses/404:resource-not-found'

/batch/{BatchId}/run:
  parameters:
    - in: path
      type: string
      name: BatchId
      required: true
  post:
    summary: Launch a job.
    description: |
      Creates jobs from proposed inputs, returns jobs enqueued.
      Moves 'pending' batch job to 'running'.
    operationId: start_batch
    tags:
    - batch
    responses:
      '200':
        description: ''
        schema:
          $ref: schemas/output/job-list.json

/batch/{BatchId}/cancel:
  parameters:
    - in: path
      type: string
      name: BatchId
      required: true
  post:
    summary: Cancel a Job
    description: |
      Cancels jobs that are still pending, returns number of jobs cancelled.
      Moves a 'running' batch job to 'cancelled'.
    operationId: cancel_batch
    tags:
    - batch
    responses:
      '200':
        description: 'The number of jobs canceled'
        schema:
          $ref: schemas/output/batch-cancel.json