Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/usr/share/fusioninventory/lib/FusionInventory/Agent/Task/NetInventory/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/fusioninventory/lib/FusionInventory/Agent/Task/NetInventory/Job.pm
package FusionInventory::Agent::Task::NetInventory::Job;

use strict;
use warnings;

use English qw(-no_match_vars);

use FusionInventory::Agent::Logger;

sub new {
    my ($class, %params) = @_;

    my $self = {
        logger          => $params{logger} || FusionInventory::Agent::Logger->new(),
        _params         => $params{params},
        _credentials    => $params{credentials},
        _devices        => $params{devices},
    };
    bless $self, $class;
}

sub pid {
    my ($self) = @_;
    return $self->{_params}->{PID} || 0;
}

sub timeout {
    my ($self) = @_;
    return $self->{_params}->{TIMEOUT} || 60;
}

sub max_threads {
    my ($self) = @_;
    return $self->{_params}->{THREADS_QUERY} || 1;
}

sub count {
    my ($self) = @_;
    return scalar(@{$self->{_devices}});
}

sub devices {
    my ($self) = @_;

    return @{$self->{_devices}};
}

sub credentials {
    my ($self) = @_;

    # index credentials by their ID
    return { map { $_->{ID} => $_ } @{$self->{_credentials}} };
}

1;

Hry