Bugzilla – Attachment 140884 Details for
Bug 30982
Use the REST API for background job list view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30982: REST API specs
Bug-30982-REST-API-specs.patch (text/plain), 7.26 KB, created by
Marcel de Rooy
on 2022-09-23 09:44:53 UTC
(
hide
)
Description:
Bug 30982: REST API specs
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-23 09:44:53 UTC
Size:
7.26 KB
patch
obsolete
>From c939520c82aa8dd9814726a26f47af978c09e1be Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 Jun 2022 09:21:39 +0200 >Subject: [PATCH] Bug 30982: REST API specs >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../swagger/definitions/background_job.yaml | 58 +++++++++ > api/v1/swagger/paths/background_jobs.yaml | 123 ++++++++++++++++++ > api/v1/swagger/swagger.yaml | 12 ++ > 3 files changed, 193 insertions(+) > create mode 100644 api/v1/swagger/definitions/background_job.yaml > create mode 100644 api/v1/swagger/paths/background_jobs.yaml > >diff --git a/api/v1/swagger/definitions/background_job.yaml b/api/v1/swagger/definitions/background_job.yaml >new file mode 100644 >index 0000000000..41146c26d7 >--- /dev/null >+++ b/api/v1/swagger/definitions/background_job.yaml >@@ -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 >diff --git a/api/v1/swagger/paths/background_jobs.yaml b/api/v1/swagger/paths/background_jobs.yaml >new file mode 100644 >index 0000000000..320ef811ed >--- /dev/null >+++ b/api/v1/swagger/paths/background_jobs.yaml >@@ -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" >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index a10f2408b6..3d4be6e63d 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -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 >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30982
:
136245
|
136246
|
136670
|
136671
|
136672
|
136707
|
136708
|
136715
|
138114
|
139636
|
139637
|
139638
|
139639
|
139640
|
139641
|
140488
|
140489
|
140490
|
140491
|
140492
|
140493
|
140494
|
140495
|
140496
|
140497
|
140498
|
140589
|
140590
|
140591
|
140592
|
140593
|
140594
|
140595
|
140596
|
140597
|
140598
|
140599
|
140789
| 140884 |
140885
|
140886
|
140887
|
140888
|
140889
|
140890
|
140891
|
140892
|
140893
|
140894
|
140895
|
140896
|
140897
|
142859