devices module¶
-
class
devices.Devices(db_path_name)¶ Bases:
dbparam.DbParamDevices 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: Trueif the value is a valid string otherwise returnsFalse
-
add()¶ Add a device.
Returns: Dev_nameadded orFalseif there was an error.
-
delete()¶ Delete a device.
Returns: dev_nameof the delete device, orFalseit there was an error.
-
list()¶ List the table
devicesordered alphabetically, and filtered according the selected options (customer, site, IP, device name, or OS.Returns: Trueif the devices were listed, orFalseif there is no match between the conditions selected.
-
modify()¶ Modify a device.
Returns: Dev_nameoriginal andnew_dev_nameof the modified device, orFalseif there was an error.
-