Bugzilla – Attachment 97743 Details for
Bug 22615
Add routes for /ill_backends
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22615: Add endpoint for getting one ill backend
Bug-22615-Add-endpoint-for-getting-one-ill-backend.patch (text/plain), 4.61 KB, created by
Andrew Isherwood
on 2020-01-22 15:14:56 UTC
(
hide
)
Description:
Bug 22615: Add endpoint for getting one ill backend
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2020-01-22 15:14:56 UTC
Size:
4.61 KB
patch
obsolete
>From 21f38cd5439eb690acb2cd205fb86df9a3692089 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 22 Jan 2020 14:21:33 +0000 >Subject: [PATCH] Bug 22615: Add endpoint for getting one ill backend > >Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >--- > Koha/REST/V1/Illbackends.pm | 28 +++++++++++++++ > api/v1/swagger/definitions.json | 3 ++ > api/v1/swagger/paths.json | 3 ++ > api/v1/swagger/paths/ill_backends.json | 62 ++++++++++++++++++++++++++++++++++ > 4 files changed, 96 insertions(+) > >diff --git a/Koha/REST/V1/Illbackends.pm b/Koha/REST/V1/Illbackends.pm >index 01cdd9e5e0..15807e9dd9 100644 >--- a/Koha/REST/V1/Illbackends.pm >+++ b/Koha/REST/V1/Illbackends.pm >@@ -51,4 +51,32 @@ sub list { > return $c->render( status => 200, openapi => \@data ); > } > >+=head3 get >+ >+Get one backend >+ >+=cut >+ >+sub get { >+ my $c = shift->openapi->valid_input; >+ >+ my $backend_id = $c->validation->param('ill_backend_id'); >+ >+ return try { >+ my $backend = Koha::Illrequest->new->load_backend( $backend_id ); >+ return $c->render( >+ status => 200, >+ openapi => { >+ ill_backend_id => $backend_id, >+ capabilities => $backend->capabilities >+ } >+ ); >+ } catch { >+ return $c->render( >+ status => 404, >+ openapi => { error => "ILL backend does not exist" } >+ ); >+ }; >+} >+ > 1; >diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json >index 009f61e2eb..d9d2ba30c2 100644 >--- a/api/v1/swagger/definitions.json >+++ b/api/v1/swagger/definitions.json >@@ -32,6 +32,9 @@ > "ill_backends": { > "$ref": "definitions/ill_backends.json" > }, >+ "ill_backend": { >+ "$ref": "definitions/ill_backend.json" >+ }, > "library": { > "$ref": "definitions/library.json" > }, >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >index 6b75af3873..35f33ececc 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -83,6 +83,9 @@ > "/ill_backends": { > "$ref": "paths/ill_backends.json#/~1ill_backends" > }, >+ "/ill_backends/{ill_backend_id}": { >+ "$ref": "paths/ill_backends.json#/~1ill_backends~1{ill_backend_id}" >+ }, > "/illrequests": { > "$ref": "paths/illrequests.json#/~1illrequests" > }, >diff --git a/api/v1/swagger/paths/ill_backends.json b/api/v1/swagger/paths/ill_backends.json >index a14c3d651e..ca895ddd0c 100644 >--- a/api/v1/swagger/paths/ill_backends.json >+++ b/api/v1/swagger/paths/ill_backends.json >@@ -52,5 +52,67 @@ > } > } > } >+ }, >+ "/ill_backends/{ill_backend_id}": { >+ "get": { >+ "x-mojo-to": "Illbackends#get", >+ "operationId": "getIllbackends", >+ "tags": ["illbackends"], >+ "parameters": [ >+ { >+ "name": "ill_backend_id", >+ "in": "path", >+ "description": "ILL backend id/name", >+ "required": true, >+ "type": "string" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "An ILL backends", >+ "schema": { >+ "$ref": "../definitions.json#/ill_backend" >+ } >+ }, >+ "401": { >+ "description": "Authentication required", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "403": { >+ "description": "Access forbidden", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "404": { >+ "description": "ILL backends not found", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "permissions": { >+ "ill": "1" >+ } >+ } >+ } > } > } >-- >2.11.0
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 22615
:
87284
|
97735
|
97736
|
97737
|
97742
|
97743
|
97744
|
100148
|
100149
|
100150