Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Record.pm

Unix::Conf::Bind8::DB::Record - Base class which contains methods which are inherited by the derived classes residing under Unix::Conf::Bind8::DB.


NAME

Unix::Conf::Bind8::DB::Record - Base class which contains methods which are inherited by the derived classes residing under Unix::Conf::Bind8::DB.


SYNOPSIS


    use Unix::Conf::Bind8;

    my ($conf, $db, $rec, $ret);

    # get a db object from a valid Unix::Conf::Bind8::Conf object

    $db = $conf->get_db ('extremix.net')

        or $die ("couldn't get db object for `extremix.net'");

        

    # create a new A record. All new_* methods are similar except 

    # for new_mx (), where an extra argument MXPREF has to be

    # provided.

    $rec = $db->new_a (

        LABEL   => 'www',

        TTL             => '1d',

        RDATA   => '192.168.1.1',

    ) or $rec->die ("couldn't create A record for www.extremix.net");

    $rec = $db->get_a ('www', '192.168.1.1')

        or $rec->die ("couldn't get record object for www.extremix.net A 192.168.1.1");

    # get attribute values

    printf ("Class for record `www.extremix.net' A 192.168.1.1 is $ret\n")

        if ($ret = $rec->class ());

    # set attribute values

    $ret = $rec->ttl ('1w')                     or $ret->die ("couldn't set ttl");

    $ret = $rec->rdata ('192.168.2.1')  or $ret->die ("couldn't set rdata");

    # delete record

    $ret = $rec->delete () or $ret->die ("couldn't delete");


METHODS

new ()

 Arguments

 LABEL          => 'string',

 CLASS          => 'string',    # 'IN'|'HS'|'CHAOS'

 TTL            => 'string'|number,

 RTYPE          => 'string',    # 'A'|'NS'|'MX'|'SOA'|'CNAME'|'PTR'

 RDATA          => data

 PARENT         => reference,   # to the DB object datastructure

Class constructor. Creates a new Unix::Conf::Bind8::DB::* object and returns it if successful, an Err object otherwise. Do not use this constructor directly. Use the Unix::Conf::Bind8::DB::new_* equivalent instead.

label ()

 Arguments

 'label'

Object method. Get/set the record's label. If an argument is passed, the invocant's label is set and true returned, on success, an Err object otherwise. If no argument is passed the invocant's label is returned.

class ()

 Arguments

 'class'

Object method. Get/set the record's class. If an argument is passed, the invocant's class is set and true returned, on success, an Err object otherwise. If no argument is passed the invocant's class is returned, if defined, an Err object otherwise.

rtype ()

 Arguments

 'rtype'

Object method. Get/set the record's rtype. If an argument is passed, the invocant's rtype is set and true returned, on success, an Err object otherwise. If no argument is passed the invocant's rtype is returned.

ttl ()

 Arguments

 ttl

Object method. Get/set the record's ttl. If an argument is passed, the invocant's ttl is set and true returned, on success, an Err object otherwise. If no argument is passed the invocant's ttl is returned, if defined, an Err object otherwise.

rdata ()

 Arguments

 data

Object method. Get/set the record's rdata. If an argument is passed, the invocant's rdata is set and true returned, on success, an Err object otherwise. If no argument is passed the invocant's rdata is returned.

dirty ()

 Arguments

 dirty  # numeric

Object method. Get/set the dirty attribute. If an argument is passed, sets it as the value of the dirty attribute, and returns true on success, an Err object otherwise. If no argument is passed, returns the value of the attribute.

delete ()
Object method. Deletes the invocant record and returns true on success, an Err object otherwise.
Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy