1 package FS::addr_status;
2 use base qw( FS::Record );
14 $record = new FS::addr_status \%hash;
15 $record = new FS::addr_status { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::addr_status object represents the last known status (up or down, and
28 the latency) of an IP address monitored by freeside-pingd. FS::addr_status
29 inherits from FS::Record. The following fields are currently supported:
33 =item addrnum - primary key
35 =item ip_addr - the IP address (unique)
37 =item _date - the time the address was last scanned
39 =item up - 'Y' if the address responded to a ping
41 =item delay - the latency, in milliseconds
51 Creates a new status record. To add the record to the database, see
54 Note that this stores the hash reference, not a distinct copy of the hash it
55 points to. You can ask the object for a copy with the I<hash> method.
59 # the new method can be inherited from FS::Record, if a table method is defined
61 sub table { 'addr_status'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 =item replace OLD_RECORD
74 Checks all fields to make sure this is a valid status record. If there is
75 an error, returns the error, otherwise returns false. Called by the insert
84 $self->ut_numbern('addrnum')
85 || $self->ut_ip('ip_addr')
86 || $self->ut_number('_date')
87 || $self->ut_flag('up')
88 || $self->ut_numbern('delay')