Monito...:Table(3pm)

πŸ“¦
version 0.06 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Monitoring::Livestatus::Class::Base::Table β€” the manual page, but make it make sense ✨

okay bestie, gather round 🫢 this is the man page for Monitoring::Livestatus::Class::Base::Table, living in the User Contributed Perl Documentation corner of 3pm. It's the base class for all table objects β€” like, the mother of every table object in this whole situation. πŸ‘‘


🌸 NAME 🌸

Monitoring::Livestatus::Class::Base::Table β€” bestie, it's the base class for all table objects. no cap.


✨ SYNOPSIS ✨

here's the vibe, copy it exactly, don't freestyle:

my $class = Monitoring::Livestatus::Class->new(
    backend => 'INET',
    socket => '10.211.55.140:6557',
);

my $table_obj = $class->table('services');

my $data = $table_obj->search( {} )->hashref_array();

literally that's it. build the class, grab a table, search it, dump it. iconic behavior. πŸ’…


πŸŽ€ ATTRIBUTES πŸŽ€

ctx

it's a reference to the context object Monitoring::Livestatus::Class. your whole world, basically. πŸ¦‹

filter

a reference to the filter object Monitoring::Livestatus::Class. (yes, the original says filter object for this one too β€” I'm just telling you what it says πŸ’–)

stats

a reference to the filter object Monitoring::Livestatus::Class. same energy as above, different attribute name.

table_name

contains the table name. that's the whole job. the name. of the table. 🌈

statments

contains all the statments. (spelled exactly like that in the source β€” I am NOT touching it, that's a real attribute name and I respect it πŸ™ˆ)

options

contains all the options. lowkey essential, highkey underrated.


πŸ’… METHODS πŸ’…

columns

Arguments: $colA, $colB, ... (however many you want, go off πŸ‘‘)

Return: $self

sets columns. that's the move. setting columns. slay.

headers

returns an array, or a reference to an array, depending on the calling context β€” of all header columns. context-sensitive, main character energy. ⭐

filter

example usage, verbatim bestie:

$table_obj->search( { name => 'localhost' } );
$table_obj->search( { name => [ 'localhost', 'gateway' ] } );
$table_obj->search( [ { name => 'localhost' }, { name => 'gateway' } ] );

Returns: $self

look at those three forms β€” single value, arrayref of values, arrayref of hashrefs. all of them valid. we love range. πŸ’œ

hashref_array

returns an array, or a reference to an array, depending on the calling context. so choose your fighter. 🧚

example usage:

my $hashref_array = $table_obj->search( { } )->hashref_array;
print Dumper $hashref_array;

hashref_pk

returns a hash of hash references.

example usage:

my $hashref_pk = $table_obj->search( { } )->hashref_pk();
print Dumper $hashref_pk;

primary-key-keyed hashes?? obsessed. πŸ”₯

has_single_primary_key

(no extra deets in the source, bestie β€” it's just here, chilling, existing.)

single_primary_key

(also just vibing here with no description. we love a mysterious queen. πŸ’€)

build_table_name

(same β€” listed, no description. mysterious.)

build_primary_keys

(and this one too. it's giving ✨enigmatic✨.)


🫢 AUTHOR 🫢

see "AUTHOR" in Monitoring::Livestatus::Class and "CONTRIBUTORS" in Monitoring::Livestatus::Class. go read the parent page, bestie, that's where the credits live.


Copyright 2009 Robert Bohne.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

fr fr, read that license before you go redistributing anything. it's not a suggestion, it's the rules. πŸ“œ

and that's the whole page, bestie! πŸ’– this was generated as part of perl v5.26.2, dated 2018-05-06, and it's filed under the 3pm manual section. mwah, go build some tables. πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from