From ec5add2ec19294f1426fe77bc61e49f624298147 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 14 Feb 2025 16:26:48 +0000 Subject: [PATCH] Bug 39190: Remove replaced test_connection --- Koha/REST/V1/SFTPServer.pm | 55 --------------------- api/v1/swagger/paths/test_sftp_servers.yaml | 48 ------------------ api/v1/swagger/swagger.yaml | 4 +- 3 files changed, 1 insertion(+), 106 deletions(-) delete mode 100644 Koha/REST/V1/SFTPServer.pm delete mode 100644 api/v1/swagger/paths/test_sftp_servers.yaml diff --git a/Koha/REST/V1/SFTPServer.pm b/Koha/REST/V1/SFTPServer.pm deleted file mode 100644 index d0a5641e1eb..00000000000 --- a/Koha/REST/V1/SFTPServer.pm +++ /dev/null @@ -1,55 +0,0 @@ -package Koha::REST::V1::SFTPServer; - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -use Modern::Perl; - -use Mojo::Base 'Mojolicious::Controller'; - -use Koha::SFTP::Servers; - -use Try::Tiny qw( catch try ); - -=head1 API - -=head2 Methods - -=head3 test - -Controller method that invokes Koha::SFTP::Server->test_conn - -=cut - -sub test { - my $c = shift->openapi->valid_input or return; - - return try { - my $sftp_server = Koha::SFTP::Servers->find( $c->param('sftp_server_id') ); - return $c->render_resource_not_found("FTP/SFTP Server") - unless $sftp_server; - - my $sftp_server_test_conn = $sftp_server->test_conn; - - return $c->render( - status => 200, - openapi => $sftp_server_test_conn, - ); - } catch { - $c->unhandled_exception($_); - }; -} - -1; diff --git a/api/v1/swagger/paths/test_sftp_servers.yaml b/api/v1/swagger/paths/test_sftp_servers.yaml deleted file mode 100644 index 3fab229fc28..00000000000 --- a/api/v1/swagger/paths/test_sftp_servers.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -"/sftp_server/{sftp_server_id}/test_connection": - get: - x-mojo-to: SFTPServer#test - operationId: testSFTPServer - tags: - - sftp_servers - summary: Test FTP/SFTP server - produces: - - application/json - parameters: - - $ref: "../swagger.yaml#/parameters/sftp_server_id_pp" - responses: - "200": - description: Results of FTP/SFTP server test - schema: - type: object - items: - $ref: "../swagger.yaml#/definitions/sftp_server" - "400": - description: | - Bad request. Possible `error_code` attribute values: - - * `invalid_query` - schema: - $ref: "../swagger.yaml#/definitions/error" - "404": - description: Not Found - schema: - $ref: "../swagger.yaml#/definitions/error" - "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: - parameters: manage_sftp_servers \ No newline at end of file diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index 03c1d51ad0b..67583211285 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -559,8 +559,6 @@ paths: $ref: "./paths/rotas.yaml#/~1rotas~1{rota_id}" "/rotas/{rota_id}/stages/{stage_id}/position": $ref: "./paths/rotas.yaml#/~1rotas~1{rota_id}~1stages~1{stage_id}~1position" - "/sftp_server/{sftp_server_id}/test_connection": - $ref: "./paths/test_sftp_servers.yaml#/~1sftp_server~1{sftp_server_id}~1test_connection" /suggestions: $ref: ./paths/suggestions.yaml#/~1suggestions "/suggestions/{suggestion_id}": @@ -1308,4 +1306,4 @@ tags: x-displayName: Two factor authentication - description: "Manage vendors for the acquisitions module\n" name: vendors - x-displayName: Vendors \ No newline at end of file + x-displayName: Vendors -- 2.48.1