Difference between revisions of "Freeside:3:Documentation:Developer/FS/svc broadband"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
 
Line 40: Line 40:
 
:; unlinked - set to search for all unlinked services. Overrides all other options.:; agentnum:; custnum:; svcpart:; ip_addr:; pkgpart - arrayref:; routernum - arrayref:; sectornum - arrayref:; towernum - arrayref:; order_by; search_sql STRING
 
:; unlinked - set to search for all unlinked services. Overrides all other options.:; agentnum:; custnum:; svcpart:; ip_addr:; pkgpart - arrayref:; routernum - arrayref:; sectornum - arrayref:; towernum - arrayref:; order_by; search_sql STRING
 
:Class method which returns an SQL fragment to search for the given string.
 
:Class method which returns an SQL fragment to search for the given string.
; label
+
; smart_search STRING; label
:Returns the IP address.
+
:Returns the IP address, MAC address and description.
 
; insert [ , OPTION => VALUE ... ]
 
; insert [ , OPTION => VALUE ... ]
 
:Adds this record to the database. If there is an error, returns the error, otherwise returns false.
 
:Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Line 64: Line 64:
 
; check
 
; check
 
:Checks all fields to make sure this is a valid broadband service. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
 
:Checks all fields to make sure this is a valid broadband service. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
; assign_ip_addr
 
:Assign an IP address matching the selected router, and the selected block if there is one.
 
; assign_router
 
:Assign an address block and router matching the selected IP address. Does nothing if IP address is null.
 
; NetAddr
 
:Returns a NetAddr::IP object containing the IP address of this service. The netmask is /32.
 
; addr_block
 
:Returns the FS::addr_block record (i.e. the address block) for this broadband service.
 
; router
 
:Returns the FS::router record for this service.
 
; allowed_routers
 
:Returns a list of allowed FS::router objects.
 
 
; mac_addr_formatted CASE DELIMITER
 
:Format the MAC address (for use by exports). If CASE starts with "l" (for "lowercase"), it's returned in lowercase. DELIMITER is inserted between octets.
 
  
 
==BUGS==
 
==BUGS==
Line 89: Line 74:
 
==SEE ALSO==
 
==SEE ALSO==
 
FS::svc_Common, FS::Record, FS::addr_block, FS::part_svc, schema.html from the base documentation.
 
FS::svc_Common, FS::Record, FS::addr_block, FS::part_svc, schema.html from the base documentation.
 
==POD ERRORS==
 
Hey! '''The above document had some coding errors, which are explained below:'''
 
 
; Around line 620:
 
:'=item' outside of any '=over'
 

Latest revision as of 14:39, 27 June 2014

NAME

FS::svc_broadband - Object methods for svc_broadband records

SYNOPSIS

 use FS::svc_broadband;

 $record = new FS::svc_broadband \%hash;
 $record = new FS::svc_broadband { 'column' => 'value' };

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

 $error = $record->suspend;

 $error = $record->unsuspend;

 $error = $record->cancel;

DESCRIPTION

An FS::svc_broadband object represents a 'broadband' Internet connection, such as a DSL, cable modem, or fixed wireless link. These services are assumed to have the following properties:

FS::svc_broadband inherits from FS::svc_Common. The following fields are currently supported:

svcnum - primary key; blocknum - see FS::addr_block; speed_up - maximum upload speed, in bits per second. If set to zero, upload speed will be unlimited. Exports that do traffic shaping should handle this correctly, and not blindly set the upload speed to zero and kill the customer's connection.; speed_down - maximum download speed, as above; ip_addr - the customer's IP address. If the customer needs more than one IP address, set this to the address of the customer's router. As a result, the customer's router will have the same address for both its internal and external interfaces thus saving address space. This has been found to work on most NAT routers available.; plan_id

METHODS

new HASHREF
Creates a new svc_broadband. To add the record 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.
search HASHREF
Class method which returns a qsearch hash expression to search for parameters specified in HASHREF.
Parameters:
unlinked - set to search for all unlinked services. Overrides all other options.
; agentnum:; custnum:; svcpart:; ip_addr:; pkgpart - arrayref:; routernum - arrayref:; sectornum - arrayref:; towernum - arrayref:; order_by; search_sql STRING
Class method which returns an SQL fragment to search for the given string.
smart_search STRING; label
Returns the IP address, MAC address and description.
insert [ , OPTION => VALUE ... ]
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
The additional fields pkgnum and svcpart (see FS::cust_svc) should be defined. An FS::cust_svc record will be created and inserted.
Currently available options are: depend_jobnum
If depend_jobnum is set (to a scalar jobnum or an array reference of jobnums), all provisioning jobs will have a dependancy on the supplied jobnum(s) (they will not run until the specific job(s) complete(s)).
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.
  1. Standard FS::svc_Common::replace
suspend
Called by the suspend method of FS::cust_pkg (see FS::cust_pkg).
unsuspend
Called by the unsuspend method of FS::cust_pkg (see FS::cust_pkg).
cancel
Called by the cancel method of FS::cust_pkg (see FS::cust_pkg).
check
Checks all fields to make sure this is a valid broadband service. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.

BUGS

The business with sb_field has been 'fixed', in a manner of speaking.

allowed_routers isn't agent virtualized because part_svc isn't agent virtualized

Having both routernum and blocknum as foreign keys is somewhat dubious.

SEE ALSO

FS::svc_Common, FS::Record, FS::addr_block, FS::part_svc, schema.html from the base documentation.