NAME

Tapper::Cmd::Host

SYNOPSIS

This project offers backend functions for all projects that manipulate hosts in the database.

    use Tapper::Cmd::Host;

    my $host = Tapper::Cmd::Host->new();
    my $details = { name  => 'einstein',
                    queue => ['queue-one', 'queue-two'],
                    active => 1,
              };
    my $id = $host->add($details);
    $details->{name} = "bohr";
    my $error = $host->update($id, $details);
    $error = $host->delete($id);

NAME

Tapper::Cmd::Host - Backend functions for manipluation of hosts in the database

FUNCTIONS

add

Add a new host. Expects all details as a hash reference.

@param hash ref - host data * name - host name * comment - comment for host * free - is the host free to have tests running on it? * active - is host activated? * is_deleted - is host deleted? * pool_free - set number of pool elements, not allowed together with pool_count * pool_count - set number of pool elements, not allowed together with pool_free

@return success - host id @return error - undef

@throws die()

del

Delete a host with given id. Its named del instead of delete to prevent confusion with the buildin delete function. The first parameter can be either the host id or the host name.

@param int|string - host id|host name

@return success - 0

@throws die

update

Update a given host with new data.

list

Get a filtered list of hosts.

@param hash ref - filters allowed keys: * free - bool - filter for free/non-free hosts * name - list of strings - filter for host names * active - bool - filter for active/non-active hosts * queue - list of strings - filter for hosts bound to this queue * pool - bool - filter for pool hosts * deleted - bool - allowed deleted hosts too

@return success - Host resultset - DBIx::Class list of hosts

@throws die

AUTHORS

  • AMD OSRC Tapper Team <tapper@amd64.org>

  • Tapper Team <tapper-ops@amazon.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2020 by Advanced Micro Devices, Inc..

This is free software, licensed under:

  The (two-clause) FreeBSD License