OTRS 5.0 API Reference Perl

Description manuals and libraries
OTRS 5.0 API Reference Perl > Perl Modules > Kernel::System::GenericAgent

NAME

Kernel::System::GenericAgent - to manage the generic agent jobs

SYNOPSIS

All functions to manage the generic agent and the generic agent jobs.

PUBLIC INTERFACE

new()

create an object. Do not use it directly, instead use:

    use Kernel::System::ObjectManager;
    local $Kernel::OM = Kernel::System::ObjectManager->new();
    my $GenericAgentObject = $Kernel::OM->Get('Kernel::System::GenericAgent');
JobRun()

run a generic agent job

    $GenericAgentObject->JobRun(
        Job          => 'JobName',
        OnlyTicketID => 123,     # (optional) for event based Job execution
        SleepTime    => 100_000  # (optional) sleeptime per ticket in microseconds
        UserID       => 1,
    );
JobList()

returns a hash of jobs

    my %List = $GenericAgentObject->JobList();
JobGet()

returns a hash of the job data

    my %Job = $GenericAgentObject->JobGet(Name => 'JobName');
JobAdd()

adds a new job to the database

    $GenericAgentObject->JobAdd(
        Name => 'JobName',
        Data => {
            Queue => 'SomeQueue',
            ...
            Valid => 1,
        },
        UserID => 123,
    );
JobDelete()

deletes a job from the database

    my $Success = $GenericAgentObject->JobDelete(
        Name   => 'JobName',
        UserID => 123,
    );

returns:

    $Success = 1;       # or false in case of a failure
JobEventList()

returns a hash of events for each job

    my %List = $GenericAgentObject->JobEventList();

TERMS AND CONDITIONS

This software is part of the OTRS project (https://otrs.org/).

This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.