networkapi.api_deploy package¶
Submodules¶
networkapi.api_deploy.exceptions module¶
-
exception
networkapi.api_deploy.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.api_deploy.exceptions.
ConnectionException
(detail=None)[source]¶ Bases:
rest_framework.exceptions.APIException
-
default_detail
= 'Failed trying to connect to equipment.'¶
-
status_code
= 500¶
-
-
exception
networkapi.api_deploy.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.api_deploy.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.api_deploy.exceptions.
InvalidFilenameException
(filename=None)[source]¶ Bases:
rest_framework.exceptions.APIException
-
default_detail
= 'Invalid filename.'¶
-
status_code
= 400¶
-
-
exception
networkapi.api_deploy.exceptions.
InvalidKeyException
(key_name=None)[source]¶ Bases:
rest_framework.exceptions.APIException
-
default_detail
= 'Request has no expected key(s).'¶
-
status_code
= 400¶
-
-
exception
networkapi.api_deploy.exceptions.
LoadEquipmentModuleException
(module_name=None)[source]¶ Bases:
rest_framework.exceptions.APIException
-
default_detail
= u'Could not load equipment module: '¶
-
status_code
= 500¶
-
networkapi.api_deploy.facade module¶
-
networkapi.api_deploy.facade.
create_file_from_script
(script, prefix_name='')[source]¶ Creates a file with script content
- Args:
- script: string with commands script prefix_name: prefix to use in filename
- Returns:
- file name created with path relative to networkapi.settings.TFTPBOOT_FILES_PATH
- Raises:
- IOError: if cannot write file
-
networkapi.api_deploy.facade.
deploy_config_in_equipment
(rel_filename, equipment, tftpserver=None, equipment_access=None)[source]¶ Apply configuration file on equipment
- Args:
- rel_filename: relative file path from TFTPBOOT_FILES_PATH to apply
- in equipment
equipment: networkapi.equipamento.Equipamento() or Equipamento().id lockvar: distributed lock variable to use when applying config to
equipmentequipment_access: networkapi.equipamento.EquipamentoAcesso() to use tftpserver: source TFTP server address
- Returns:
- equipment output
Raises:
-
networkapi.api_deploy.facade.
deploy_config_in_equipment_synchronous
(rel_filename, equipment, lockvar, tftpserver=None, equipment_access=None)[source]¶ Apply configuration file on equipment
- Args:
- rel_filename: relative file path from TFTPBOOT_FILES_PATH to apply
- in equipment
equipment: networkapi.equipamento.Equipamento() or Equipamento().id lockvar: distributed lock variable to use when applying config to
equipmentequipment_access: networkapi.equipamento.EquipamentoAcesso() to use tftpserver: source TFTP server address
- Returns:
- equipment output
Raises: