Bug 30982: REST API specs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-06-17 09:21:39 +02:00 committed by Tomas Cohen Arazi
parent 85030fc38a
commit b702e9b08d
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 193 additions and 0 deletions

View File

@ -0,0 +1,58 @@
---
type: object
properties:
background_job_id:
type: integer
description: internally assigned background_job identifier
readOnly: true
status:
description: background_job status
type:
- string
- "null"
progress:
description: background_job progress
type:
- string
- "null"
size:
description: background_job size
type:
- string
- "null"
patron_id:
description: background_job enqueuer
type:
- string
- "null"
type:
description: background_job type
type:
- string
- "null"
queue:
description: background_job queue
type:
- string
- "null"
data:
description: background_job data
type:
- string
- "null"
enqueued_on:
description: background_job enqueue date
type:
- string
- "null"
started_on:
description: background_job start date
type:
- string
- "null"
ended_on:
description: background_job end date
type:
- string
- "null"
additionalProperties: false

View File

@ -0,0 +1,123 @@
---
/background_jobs:
get:
x-mojo-to: BackgroundJobs#list
operationId: listBackgroundJobs
tags:
- background_jobs
summary: List background jobs
produces:
- application/json
parameters:
- name: status
in: query
description: Case insensative search on job status
required: false
type: string
- name: progress
in: query
description: Case insensative search on job progress
required: false
type: string
- name: size
in: query
description: Case insensative search on job size
required: false
type: string
- name: patron_id
in: query
description: Case insensative search on job enqueuer id
required: false
type: string
- name: tye
in: query
description: Case insensative search on job type
required: false
type: string
- name: queue
in: query
description: Case insensative search on job queue
required: false
type: string
- name: enqueued_on
in: query
description: Case insensative search on job enqueue date
required: false
type: string
- name: started_on
in: query
description: Case insensative search on job start date
required: false
type: string
- name: ended_on
in: query
description: Case insensative search on job end date
required: false
type: string
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"
- $ref: "../swagger.yaml#/parameters/per_page"
- $ref: "../swagger.yaml#/parameters/q_param"
- $ref: "../swagger.yaml#/parameters/q_body"
- $ref: "../swagger.yaml#/parameters/q_header"
- $ref: "../swagger.yaml#/parameters/request_id_header"
responses:
"200":
description: A list of jobs
schema:
type: array
items:
$ref: "../swagger.yaml#/definitions/background_job"
"403":
description: Access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
"500":
description: |
Internal server error. Possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
"503":
description: Under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
catalogue: "1"
"/background_jobs/{background_job_id}":
get:
x-mojo-to: BackgroundJobs#get
operationId: getBackgroundJob
tags:
- background_job
summary: Get background job
parameters:
- $ref: "../swagger.yaml#/parameters/background_job_id_pp"
produces:
- application/json
responses:
"200":
description: A background job
schema:
$ref: "../swagger.yaml#/definitions/background_job"
"404":
description: Background job not found
schema:
$ref: "../swagger.yaml#/definitions/error"
"500":
description: |
Internal server error. Possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
"503":
description: Under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
catalogue: "1"

View File

@ -8,6 +8,8 @@ definitions:
$ref: ./definitions/advancededitormacro.yaml
allows_renewal:
$ref: ./definitions/allows_renewal.yaml
background_job:
$ref: ./definitions/background_job.yaml
basket:
$ref: ./definitions/basket.yaml
bundle_link:
@ -103,6 +105,10 @@ paths:
$ref: "./paths/article_requests.yaml#/~1article_requests~1{article_request_id}"
/auth/otp/token_delivery:
$ref: paths/auth.yaml#/~1auth~1otp~1token_delivery
/background_jobs:
$ref: ./paths/background_jobs.yaml#/~1background_jobs
"/background_jobs/{background_job_id}":
$ref: "./paths/background_jobs.yaml#/~1background_jobs~1{background_job_id}"
"/biblios/{biblio_id}":
$ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}"
"/biblios/{biblio_id}/checkouts":
@ -254,6 +260,12 @@ parameters:
name: advancededitormacro_id
required: true
type: integer
background_job_id_pp:
description: Job internal identifier
in: path
name: background_job_id
required: true
type: integer
biblio_id_pp:
description: Record internal identifier
in: path