networkapi.plugins package¶
Subpackages¶
- networkapi.plugins.Cisco package
- networkapi.plugins.Dell package
- networkapi.plugins.F5 package
- Submodules
- networkapi.plugins.F5.Generic module
- networkapi.plugins.F5.lb module
- networkapi.plugins.F5.monitor module
- networkapi.plugins.F5.pool module
- networkapi.plugins.F5.poolmember module
- networkapi.plugins.F5.types module
- networkapi.plugins.F5.util module
- networkapi.plugins.F5.virtualserver module
- Module contents
- networkapi.plugins.Huawei package
Submodules¶
networkapi.plugins.base module¶
- class networkapi.plugins.base.BasePlugin(**kwargs)[source]¶
Bases: object
Base plugin interface.
- ERROR_REGEX = '[Ee][Rr][Rr][Oo][Rr]|[Ff]ail|\\%|utility is occupied'¶
- GUEST_PRIVILEGES = 'not defined'¶
- INVALID_REGEX = '([Ii]nvalid)'¶
- VALID_OUTPUT_CHARS = '-_.():/#\\\r\n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'¶
- VALID_TFTP_GET_MESSAGE = 'Copy complete, now saving to disk'¶
- VALID_TFTP_PUT_MESSAGE = 'bytes copied in'¶
- admin_privileges = 'not defined'¶
- channel = None¶
- connect(*args, **kwargs)[source]¶
- Connects to equipment via ssh using paramiko.SSHClient and
- sets channel variable with invoked shell object.
- Raises:
- IOError: if cannot connect to host Exception: for other unhandled exceptions
- connect_max_retries = 3¶
- connect_port = 22¶
- copyScriptFileToConfig(filename, use_vrf='', destination='')[source]¶
Copy file from server to destination configuration. By default, plugin should apply file in running configuration (active).
- ensure_privilege_level(privilege_level=None)[source]¶
Ensure connection has the right privileges expected.
- equipment = None¶
- equipment_access = None¶
- exec_command(*args, **kwargs)[source]¶
Send single command to equipment and than closes connection channel.
- management_vrf = ''¶
- remote_conn = None¶
- tftpserver = ''¶
networkapi.plugins.exceptions module¶
- exception networkapi.plugins.exceptions.BGPTemplateException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'No BGP configuration templates found for equipments.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.CommandErrorException(msg=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Error: Error applying command on equipment. Equipment returned error status.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.ConnectionException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Failed trying to connect to equipment.'¶
- status_code = 500¶
- exception networkapi.plugins.exceptions.ControllerInventoryIsEmpty(msg=None)[source]¶
Bases: rest_framework.exceptions.APIException
Returno message error: No Nodes on Controller Inventory
- default_detail = u"SDN Controller's inventory is empty"¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.CurrentlyBusyErrorException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Equipment is currenlty busy. Failed trying to configure equipment.'¶
- status_code = 500¶
- exception networkapi.plugins.exceptions.InvalidCommandException(msg=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Error: Invalid command sent to equipment. Please check template syntax or module used.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.InvalidEquipmentAccessException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'No access or multiple accesses found for equipment.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.InvalidFilenameException(filename=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Invalid filename.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.InvalidKeyException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Invalid key Exception.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.LoadEquipmentModuleException(module_name=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = u'Could not load equipment module: '¶
- status_code = 500¶
- exception networkapi.plugins.exceptions.NamePropertyInvalid(msg=None)[source]¶
Bases: rest_framework.exceptions.APIException
Return message error: Property Name is invalid
- default_detail = u'Property Name is invalid'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.PluginNotConnected[source]¶
Bases: rest_framework.exceptions.APIException
Return message error: Plugin uninstanced
- default_detail = u'Plugin not connected'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.PluginUninstanced(msg=None)[source]¶
Bases: rest_framework.exceptions.APIException
Return message error: Plugin uninstanced
- default_detail = u'Plugin uninstanced'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.UnableToVerifyResponse(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Error: Could not match equipment response in any known behavior. Please check config for status.'¶
- status_code = 400¶
- exception networkapi.plugins.exceptions.UnsupportedEquipmentException(detail=None)[source]¶
Bases: rest_framework.exceptions.APIException
- default_detail = 'Tryed to apply configuration on unsupported equipment interface.'¶
- status_code = 400¶