devices module¶
-
class
devices.
Devices
(db_path_name)¶ Bases:
dbparam.DbParam
Devices worker to operate DB on table
devices
(list, add, modify and delete methods).Device names has to be alphanumeric and less than 20 characters. At the DB all the spaces
" "
will be replaced by underscores"_"
.-
_OS_LIST
= ['ios', 'iosxr', 'nxos', 'eos', 'junos', 'f5', 'win', 'linux']¶
-
static
_check_value
(value)¶ Verifies the value to be alphanumeric string and less than 20 characters.
Parameters: value – string to verify Returns: True
if the value is a valid string otherwise returnsFalse
-
add
()¶ Add a device.
Returns: Dev_name
added orFalse
if there was an error.
-
delete
()¶ Delete a device.
Returns: dev_name
of the delete device, orFalse
it there was an error.
-
list
()¶ List the table
devices
ordered alphabetically, and filtered according the selected options (customer, site, IP, device name, or OS.Returns: True
if the devices were listed, orFalse
if there is no match between the conditions selected.
-
modify
()¶ Modify a device.
Returns: Dev_name
original andnew_dev_name
of the modified device, orFalse
if there was an error.
-