networkapi.vlan package¶
Subpackages¶
- networkapi.vlan.resource package
- Submodules
- networkapi.vlan.resource.NetworkTypeResource module
- networkapi.vlan.resource.TipoRedeResource module
- networkapi.vlan.resource.VlanAllocateIPv6Resorce module
- networkapi.vlan.resource.VlanAllocateResource module
- networkapi.vlan.resource.VlanApplyAcl module
- networkapi.vlan.resource.VlanCheckNumberAvailable module
- networkapi.vlan.resource.VlanCreateAclResource module
- networkapi.vlan.resource.VlanCreateResource module
- networkapi.vlan.resource.VlanCreateScriptAclResource module
- networkapi.vlan.resource.VlanDeallocateResource module
- networkapi.vlan.resource.VlanEditResource module
- networkapi.vlan.resource.VlanFindResource module
- networkapi.vlan.resource.VlanGetByEnvironmentResource module
- networkapi.vlan.resource.VlanInsertResource module
- networkapi.vlan.resource.VlanInvalidateResource module
- networkapi.vlan.resource.VlanListResource module
- networkapi.vlan.resource.VlanRemoveResource module
- networkapi.vlan.resource.VlanResource module
- networkapi.vlan.resource.VlanSearchResource module
- networkapi.vlan.resource.VlanValidateResource module
- Module contents
- networkapi.vlan.test package
Submodules¶
networkapi.vlan.models module¶
- exception networkapi.vlan.models.AclNotFoundError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção para acl inexistente.
- exception networkapi.vlan.models.NetTypeUsedByNetworkError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Return exception when trying to remove network type used by network.
- exception networkapi.vlan.models.NetworkTypeNameDuplicatedError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Returns exception when trying to insert/update network type with same name as other.
- exception networkapi.vlan.models.NetworkTypeNotFoundError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Returns exception when trying to get network type by its identifier.
- class networkapi.vlan.models.TipoRede(*args, **kwargs)[source]¶
Bases: networkapi.models.BaseModel.BaseModel
TipoRede(id, tipo_rede)
- exception DoesNotExist¶
Bases: django.core.exceptions.ObjectDoesNotExist
- exception TipoRede.MultipleObjectsReturned¶
Bases: django.core.exceptions.MultipleObjectsReturned
- TipoRede.ipconfig_set¶
- TipoRede.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2ff5050>¶
- TipoRede.networkipv4_set¶
- TipoRede.networkipv6_set¶
- TipoRede.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff52d0>¶
- class networkapi.vlan.models.Vlan(*args, **kwargs)[source]¶
Bases: networkapi.models.BaseModel.BaseModel
Vlan(id, nome, num_vlan, ambiente_id, descricao, acl_file_name, acl_valida, acl_file_name_v6, acl_valida_v6, ativada, vrf, acl_draft, acl_draft_v6)
- exception DoesNotExist¶
Bases: django.core.exceptions.ObjectDoesNotExist
- exception Vlan.MultipleObjectsReturned¶
Bases: django.core.exceptions.MultipleObjectsReturned
- Vlan.allocate_vlan()[source]¶
Create a Vlan with the new Model
The fields num_vlan, acl_file_name, acl_valida and ativada will be generated automatically
@return: nothing
- Vlan.allow_networks_environment(configs, netv4, netv6)[source]¶
Verify if networksv4 and networksv6 are permitted in environment by way configs settings.
- Vlan.ambiente¶
- Vlan.calculate_vlan_number_v3(min_num, max_num, list_available=False)[source]¶
Caculate if has a number available in range (min_num/max_num) to specified environment
@param min_num: Minimum number that the vlan can be created. @param max_num: Maximum number that the vlan can be created. @param list_available: If = True, return the list of numbers availables
- @return: None when hasn’t a number available | num_vlan when found
- a number available
- Vlan.create(authenticated_user, min_num_01, max_num_01, min_num_02, max_num_02)[source]¶
Insere uma nova VLAN.
O valor dos campos num_vlan, rede_oct1, rede_oct2, rede_oct3, rede_oct4, bloco, broadcast, masc_oct1, masc_oct2, masc_oct3, masc_oct4, acl_file_name, acl_valida e ativada é gerado internamente. Os demais campos devem ser fornecidos.
@param min_num_01: Valor inicial do intervalo 01 para calcular o número da VLAN. @param max_num_01: Valor final do intervalo 01 para calcular o número da VLAN. @param min_num_02: Valor inicial do intervalo 02 para calcular o número da VLAN. @param max_num_02: Valor final do intervalo 02 para calcular o número da VLAN.
@return: nothing
@raise NetworkTypeNotFoundError: Tipo de Rede não cadastrada no banco de dados.
@raise AmbienteNotFoundError: Ambiente não cadastrado no banco de dados.
@raise AmbienteError: Falha ao pesquisar o ambiente.
@raise VlanNameDuplicatedError: Nome da VLAN duplicado.
@raise VlanNumberNotAvailableError: Não encontra um número de VLAN disponível em um dos intervalos (2 até 1001) ou (1006 até 4094) para o ambiente informado.
@raise VlanNetworkAddressNotAvailableError: Não existe um endereço de rede disponível para VLAN que não seja sub-rede ou super-rede de um endereço existe no cadastro de VLANs.
@raise VlanError: Erro não esperado ao executar o save.
- Vlan.create_new(authenticated_user, min_num_01, max_num_01, min_num_02, max_num_02)[source]¶
Create a Vlan with the new Model
The fields num_vlan, acl_file_name, acl_valida and ativada will be generated automatically
@return: nothing
- Vlan.deactivate_v3(locks_used)[source]¶
- Send activate notication of vlan for queue of ACL
- configuration system.
Update status column to ‘ativada = 0’.
@raise VlanErrorV3: Error disabling a Vlan.
- Vlan.edit_vlan(authenticated_user, change_name, change_number_environment)[source]¶
Edita uma Vlan.
@return None.
@raise VlanNameDuplicatedError: Nome do Vlan já existe.
@raise VlanNumberEnvironmentNotAvailableError: Numero e Ambiente da VLan já existe.
@raise VlanError: Erro ao cadastrar Vlan.
- Vlan.get_by_name(name)[source]¶
Get Vlan by name.
@return: Vlan.
@raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan. @raise OperationalError: Lock wait timeout exceed
- Vlan.get_by_number(number)[source]¶
Get Vlan by number.
@return: Vlan.
@raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan. @raise OperationalError: Lock wait timeout exceed
- Vlan.get_by_number_and_environment(number, environment)[source]¶
Get Vlan by number.
@return: Vlan.
@raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan. @raise OperationalError: Lock wait timeout exceed
- Vlan.get_by_pk(vlan_id)[source]¶
Get Vlan by id.
@return: Vlan.
@raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan. @raise OperationalError: Lock wait timeout exceed
- Vlan.groups_permissions[source]¶
Decorator that converts a method with a single self argument into a property cached on the instance. # https://github.com/django/django/blob/2456ffa42c33d63b54579eae0f5b9cf2a8cd3714/django/utils/functional.py#L38-50
- Vlan.insert_vlan(authenticated_user)[source]¶
Insere uma nova Vlan.
@return ID new Vlan.
@raise VlanNameDuplicatedError: Nome do Vlan já existe.
- @raise VlanNumberEnvironmentNotAvailableError: Numero e Ambiente
- da VLan já existe.
@raise VlanError: Erro ao cadastrar Vlan.
- Vlan.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2ff51d0>¶
- Vlan.networkipv4_set¶
- Vlan.networkipv6_set¶
- Vlan.networks_ipv4¶
Returns networks v4.
- Vlan.networks_ipv6¶
Returns networks v6.
- Vlan.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff5d50>¶
- Vlan.remove(authenticated_user)[source]¶
Update status column to ‘active = 0’
@param authenticate_user: User authenticate
@raise VlanError: Exception
- Vlan.vrfs[source]¶
Decorator that converts a method with a single self argument into a property cached on the instance. # https://github.com/django/django/blob/2456ffa42c33d63b54579eae0f5b9cf2a8cd3714/django/utils/functional.py#L38-50
- Vlan.vrfvlanequipment_set¶
- exception networkapi.vlan.models.VlanACLDuplicatedError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque já existe uma VLAN cadastrada com o mesmo nome de arquivo ACL.
- exception networkapi.vlan.models.VlanCantDeallocate(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque Vlan está ativa e não pode ser excluída.
- exception networkapi.vlan.models.VlanError(cause, message=None)[source]¶
Bases: exceptions.Exception
Representa um erro ocorrido durante acesso à tabelas relacionadas com Vlan.
- exception networkapi.vlan.models.VlanInactiveError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque está inativa.
- exception networkapi.vlan.models.VlanNameDuplicatedError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque já existe uma VLAN cadastrada com o mesmo nome.
- exception networkapi.vlan.models.VlanNetworkAddressNotAvailableError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque não existe um endereço de rede disponível para criar uma nova VLAN.
- exception networkapi.vlan.models.VlanNetworkError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção caso não consiga remover uma rede
- exception networkapi.vlan.models.VlanNotFoundError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção para pesquisa de vlan por nome ou por chave primária.
- exception networkapi.vlan.models.VlanNumberEnvironmentNotAvailableError(cause, message=None)[source]¶
- exception networkapi.vlan.models.VlanNumberNotAvailableError(cause, message=None)[source]¶
Bases: networkapi.vlan.models.VlanError
Retorna exceção porque não existe um número de VLAN disponível para criar uma nova VLAN.