From 446d62cf41061b85fe4c7b5f250f25b0c8f65043 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Wed, 26 Jun 2024 12:57:41 +0200 Subject: [PATCH] Remove unused file WeAPI::Controller::API::V1::Comand --- .../WebAPI/Controller/API/V1/Command.pm | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 lib/OpenQA/WebAPI/Controller/API/V1/Command.pm diff --git a/lib/OpenQA/WebAPI/Controller/API/V1/Command.pm b/lib/OpenQA/WebAPI/Controller/API/V1/Command.pm deleted file mode 100644 index 7ea8200cf021..000000000000 --- a/lib/OpenQA/WebAPI/Controller/API/V1/Command.pm +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2015 SUSE LLC -# SPDX-License-Identifier: GPL-2.0-or-later - -package OpenQA::WebAPI::Controller::API::V1::Command; -use Mojo::Base 'Mojolicious::Controller'; - -use OpenQA::Utils; - -=pod - -=head1 NAME - -OpenQA::WebAPI::Controller::API::V1::Command - -=head1 SYNOPSIS - - use OpenQA::WebAPI::Controller::API::V1::Command; - -=head1 DESCRIPTION - -Implements API methods for openQA commands. - -=head1 METHODS - -=over 4 - -=item create() - -Sends a command to a worker. Receives the worker id and the command as arguments. Returns not -found if the worker cannot be found or a 200 status code and a JSON with an OK status of 1 on -success. - -=back - -=cut - -sub create { - my $self = shift; - my $workerid = $self->stash('workerid'); - my $command = $self->param('command'); - my $worker = $self->schema->resultset('Workers')->find($workerid); - - if (!$worker) { - log_warning("Trying to send command \'$command\' to unknown worker id $workerid"); - $self->reply->not_found; - } - - # command is sent async, hence no error handling - $worker->send_command(command => $command); - $self->render(json => {ok => 1}, status => 200); -} - -1;