Freeside:1.9:Documentation:Developer/FS/nas

From Freeside
Jump to: navigation, search

NAME

FS::nas - Object methods for nas records

SYNOPSIS

 use FS::nas;

 $record = new FS::nas \%hash;
 $record = new FS::nas {
   'nasnum'  => 1,
   'nasip'   => '10.4.20.23',
   'nasfqdn' => 'box1.brc.nv.us.example.net',
 };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

 $error = $record->heartbeat($timestamp);

DESCRIPTION

An FS::nas object represents an Network Access Server on your network, such as a terminal server or equivalent. FS::nas inherits from FS::Record. The following fields are currently supported:

nasnum - primary key; nas - NAS name; nasip - NAS ip address; nasfqdn - NAS fully-qualified domain name; last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring).

METHODS

new HASHREF
Creates a new NAS. To add the NAS to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid NAS. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
heartbeat TIMESTAMP
Updates the timestamp for this nas

BUGS

heartbeat method uses SQL directly and doesn't update history tables.

SEE ALSO

FS::Record, schema.html from the base documentation.