networkapi.ip package

Subpackages

Submodules

networkapi.ip.ipcalc module

class networkapi.ip.ipcalc.IP(ip, mask=None, version=0)[source]

Bases: object

Represents a single IP address.

>>> localhost = IP("127.0.0.1")
>>> print localhost
127.0.0.1
>>> localhost6 = IP("::1")
>>> print localhost6
0000:0000:0000:0000:0000:0000:0000:0001
bin()[source]

Full-length binary representation of the IP address.

>>> ip = IP("127.0.0.1")
>>> print ip.bin()
01111111000000000000000000000001
clone()[source]

Return a new <IP> object with a copy of this one.

>>> ip = IP('127.0.0.1')
>>> ip.clone()
<ipcalc.IP object at 0xb7d4d18c>
hex()[source]

Full-length hexadecimal representation of the IP address.

>>> ip = IP("127.0.0.1")
>>> print ip.hex()
7f000001
info()[source]

Show IANA allocation information for the current IP address.

>>> ip = IP("127.0.0.1")
>>> print ip.info()
CLASS A
size()[source]
subnet()[source]
to_ipv4()[source]

Convert (an IPv6) IP address to an IPv4 address, if possible. Only works for IPv4-compat (::/96) and 6-to-4 (2002::/16) addresses.

>>> ip = IP('2002:c000:022a::')
>>> print ip.to_ipv4()
192.0.2.42
to_ipv6(type='6-to-4')[source]

Convert (an IPv4) IP address to an IPv6 address.

>>> ip = IP('192.0.2.42')
>>> print ip.to_ipv6()
2002:c000:022a:0000:0000:0000:0000:0000
to_tuple()[source]

Used for comparisons.

version()[source]

IP version.

>>> ip = IP("127.0.0.1")
>>> print ip.version()
4
class networkapi.ip.ipcalc.Network(ip, mask=None, version=0)[source]

Bases: networkapi.ip.ipcalc.IP

Network slice calculations.

>>> localnet = Network('127.0.0.1/8')
>>> print localnet
127.0.0.1
broadcast()[source]

Broadcast address.

>>> localnet = Network('127.0.0.1/8')
>>> print localnet.broadcast()
127.255.255.255
has_key(ip)[source]

Check if the given ip is part of the network.

>>> net = Network('192.0.2.0/24')
>>> net.has_key('192.168.2.0')
False
>>> net.has_key('192.0.2.42')
True
host_first()[source]

First available host in this subnet.

host_last()[source]

Last available host in this subnet.

in_network(other)[source]

Check if the given IP address is within this network.

netmask()[source]

Network netmask derived from subnet size.

>>> localnet = Network('127.0.0.1/8')
>>> print localnet.netmask()
255.0.0.0
network()[source]

Network address.

>>> localnet = Network('127.128.99.3/8')
>>> print localnet.network()
127.0.0.0
size()[source]

Number of ip’s within the network.

>>> net = Network('192.0.2.0/24')
>>> print net.size()
256

networkapi.ip.models module

class networkapi.ip.models.Ip(id, oct4, oct3, oct2, oct1, descricao, networkipv4_id)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allocate_v3()[source]

Persist an IPv4 and associate it to an equipment. If equipment was not related with VLAN environment, this makes the relationship @return: Nothing @raise NetworkIPv4NotFoundError: NetworkIPv4 does not exist. @raise NetworkIPv4Error: Error finding NetworkIPv4. @raise EquipamentoNotFoundError: Equipment does not exist. @raise EquipamentoError: Error finding Equipment. @raise IpNotAvailableError: No IP available to VLAN. @raise IpError: Error persisting in database.

create(authenticated_user, equipment_id, id, new)[source]

Persist an IPv4 and associate it to an equipment. If equipment was not related with VLAN environment, this makes the relationship @return: Nothing @raise NetworkIPv6NotFoundError: NetworkIPv6 does not exist. @raise NetworkIPv6Error: Error finding NetworkIPv6. @raise EquipamentoNotFoundError: Equipment does not exist. @raise EquipamentoError: Error finding Equipment. @raise IpNotAvailableError: No IP available to VLAN. @raise IpError: Error persisting in database.

create_v3(ip_map, locks_used=[])[source]

Method V3 to create Ip.

delete()[source]

Sobrescreve o método do Django para remover um IP. Antes de remover o IP remove todas as suas requisições de VIP e os relacionamentos com equipamentos.

delete_ip4(user, id_ip)[source]
delete_v3(locks_used=[])[source]

Method V3 to remove Ip. Before removing the IP removes all your requests VIP and relationships with equipment.

@raise IpCantBeRemovedFromVip: Ip is associated with created
Vip Request.
dhcprelayipv4_set
edit_ipv4(user)[source]
equipments

Returns equipments list.

classmethod get_available_ip(id_network)[source]

Get a available Ipv4 for networkIPv4 @return: Available Ipv4 @raise IpNotAvailableError: NetworkIPv4 does not has available Ipv4

classmethod get_by_octs(oct1, oct2, oct3, oct4)[source]

Get IP by octs. @return: IP. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_octs_and_environment(oct1, oct2, oct3, oct4, id_environment)[source]

Get IP by octs and environment. @return: IP. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_octs_and_environment_vip(oct1, oct2, oct3, oct4, id_evip, valid=True)[source]

Get IP by octs and environment vip. @return: IP. @raise IpNotFoundByEquipAndVipError: IP is not related with equipament. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_octs_and_net(oct1, oct2, oct3, oct4, id_network)[source]

Get IP by octs and net. @return: IP. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

get_by_octs_equipment(oct1, oct2, oct3, oct4, equip_id)[source]

Get IP by octs and equip_id. @return: IP. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_pk(id)[source]

Get IP by id. @return: IP. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP. @raise OperationalError: Lock wait timeout exceeded.

classmethod get_first_available_ip(id_network, topdown=False)[source]

Get a first available Ipv4 for networkIPv4 @return: Available Ipv4 @raise IpNotAvailableError: NetworkIPv4 does not has available Ipv4

ip_formated

Returns formated ip.

ipequipamento_set
ipv4_equipment
classmethod list_by_environment_and_equipment(id_ambiente, id_equipment)[source]

Get IP LIST by id_network. @return: IP List. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP. @raise OperationalError: Lock wait timeout exceeded.

classmethod list_by_network(id_network)[source]

Get IP LIST by id_network. @return: IP List. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP. @raise OperationalError: Lock wait timeout exceeded.

log = <celery.utils.log.ProcessAwareLogger object>
neighborv4_local_ip
neighborv4_remote_ip
networkipv4
objects = <networkapi.models.BaseManager.BaseManager object>
requisicaovips_set
save_ipv4(equipment_id, user, net)[source]
server_pool_members

Returns pool members list.

serverpoolmember_set
update_v3(ip_map, locks_used=[])[source]

Method V3 to update Ip.

validate_v3(equipments)[source]

Validate Ip.

viprequest_set
vips

Returns vips list.

exception networkapi.ip.models.IpCantBeRemovedFromVip(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção caso um Ip não possa ser excluído por estar em uso por uma requisição VIP.

exception networkapi.ip.models.IpCantRemoveFromServerPool(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Returns exception when trying to dissociate ip and equipment, but equipment is the last balancer for Vip Request

exception networkapi.ip.models.IpEquipCantDissociateFromVip(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Returns exception when trying to dissociate ip and equipment, but equipment is the last balancer for Vip Request

class networkapi.ip.models.IpEquipamento(id, ip_id, equipamento_id)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

create(authenticated_user, ip_id, equipment_id)[source]

Insere um relacionamento entre IP e Equipamento. @return: Nothing. @raise IpError: Falha ao inserir. @raise EquipamentoNotFoundError: Equipamento não cadastrado. @raise IpNotFoundError: Ip não cadastrado. @raise IpEquipamentoDuplicatedError: IP já cadastrado para o equipamento. @raise EquipamentoError: Falha ao pesquisar o equipamento.

create_v3(ip_equipment)[source]

Inserts a relationship between IP e Equipment. @return: Nothing. @raise IpError: Failure to insert. @raise EquipamentoNotFoundError: Equipment do not registered. @raise IpNotFoundError: Ip do not registered. @raise IpEquipamentoDuplicatedError: IP already registered for the equipment. @raise EquipamentoError: Failure to search equipment.

delete()[source]

Override Django’s method to remove Ip and Equipment relationship. If Ip from this Ip-Equipment is associated with created Vip Request, and the Equipment is the last balancer associated, the IpEquipment association cannot be removed. If Ip has no relationship with other Equipments, then Ip is also removed.

delete_v3(bypass_ip=False)[source]

Method V3 to remove Ip and Equipment relationship. If Ip from this Ip-Equipment is associated with created Vip Request,

and the Equipment is the last balancer associated, the IpEquipment association cannot be removed.
If Ip has no relationship with other Equipments, then Ip is also
removed.
@raise IpCantRemoveFromServerPool: Ip is associated with associated
Pool Member.
@raise IpEquipCantDissociateFromVip: Equipment is the last balanced
in a created Vip Request pointing to ip.
equipamento
classmethod get_by_ip(ip_id)[source]

Get IP by id_ip @return: IP. @raise IpEquipmentNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_ip_equipment(ip_id, equip_id)[source]

Get IP by id and equip_id. @return: IP. @raise IpEquipmentNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

ip
classmethod list_by_equip(equip_id)[source]

Get IP by id_ip @return: IPEquipment. @raise IpEquipmentNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod list_by_ip(ip_id)[source]

Get IP by id_ip @return: IP. @raise IpEquipmentNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

log = <celery.utils.log.ProcessAwareLogger object>
objects = <networkapi.models.BaseManager.BaseManager object>
remove(authenticated_user, ip_id, equip_id)[source]

Search and remove relationship between IP and equipment. @return: Nothing @raise IpEquipmentNotFoundError: There’s no relationship between Ip and Equipment. @raise IpCantBeRemovedFromVip: Ip is associated with created Vip Request. @raise IpEquipCantDissociateFromVip: Equipment is the last balanced in a created Vip Request pointing to ip. @raise IpError: Failed to remove the relationship.

exception networkapi.ip.models.IpEquipamentoDuplicatedError(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção para pesquisa de IP-Equipamento duplicado.

exception networkapi.ip.models.IpEquipmentAlreadyAssociation(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção caso um Ip já esteja associado a um determinado equipamento.

exception networkapi.ip.models.IpEquipmentNotFoundError(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção para pesquisa de IP-Equipamento por chave primária/ip e equipamento.

exception networkapi.ip.models.IpError(cause, message=None)[source]

Bases: exceptions.Exception

Representa um erro ocorrido durante acesso à tabelas relacionadas com IP.

exception networkapi.ip.models.IpErrorV3(message)[source]

Bases: exceptions.Exception

Representa um erro ocorrido durante acesso à tabelas relacionadas com IP.

exception networkapi.ip.models.IpNotAvailableError(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção porque não existe um IP disponível para a VLAN.

exception networkapi.ip.models.IpNotFoundByEquipAndVipError(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção caso um Ip já esteja associado a um determinado equipamento.

exception networkapi.ip.models.IpNotFoundError(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção para pesquisa de IP por chave primária.

exception networkapi.ip.models.IpRangeAlreadyAssociation(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Returns exception for equipment already having ip with same ip range in another network.

class networkapi.ip.models.Ipv6(id, description, networkipv6_id, block1, block2, block3, block4, block5, block6, block7, block8)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allocate_v3()[source]

Persist an IPv6 and associate it to an equipment. If equipment was not related with VLAN environment, this makes the relationship @return: Nothing @raise NetworkIPv6NotFoundError: NetworkIPv6 does not exist. @raise NetworkIPv6Error: Error finding NetworkIPv6. @raise EquipamentoNotFoundError: Equipment does not exist. @raise EquipamentoError: Error finding Equipment. @raise IpNotAvailableError: No IP available to VLAN. @raise IpError: Error persisting in database.

create(authenticated_user, equipment_id, id)[source]

Persist an IPv6 and associate it to an equipment. If equipment was not related with VLAN environment, this makes the relationship @return: Nothing @raise NetworkIPv6NotFoundError: NetworkIPv6 does not exist. @raise NetworkIPv6Error: Error finding NetworkIPv6. @raise EquipamentoNotFoundError: Equipment does not exist. @raise EquipamentoError: Error finding Equipment. @raise IpNotAvailableError: No IP available to VLAN. @raise IpError: Error persisting in database.

create_v3(ip_map, locks_used=[])[source]

Method V3 to create Ipv6.

delete()[source]

Sobrescreve o método do Django para remover um IP. Antes de remover o IP remove todas as suas requisições de VIP e os relacionamentos com equipamentos.

delete_ip6(user, id_ip)[source]
delete_v3(locks_used=[])[source]

Method V3 to remove Ipv6. Before removing the IP removes all your requests VIP and relationships with equipment.

@raise IpCantBeRemovedFromVip: Ipv6 is associated with created
Vip Request.
dhcprelayipv6_set
edit_ipv6(user)[source]
equipments

Returns equipments list.

classmethod get_available_ip6(id_network)[source]

Get a available ip6 for network6 @return: Available IP6 @raise IpNotAvailableError: NetworkIPv6 does not has available Ip6

classmethod get_by_blocks(block1, block2, block3, block4, block5, block6, block7, block8)[source]

Get Ipv6’s by blocks. @return: Ipv6’s. @raise IpNotFoundError: Ipv6 is not registered. @raise IpError: Failed to search for the Ipv6.

classmethod get_by_blocks_and_net(block1, block2, block3, block4, block5, block6, block7, block8, id_network)[source]

Get Ipv6 by blocks and network. @return: Ipv6. @raise IpNotFoundError: Ipv6 is not registered. @raise IpError: Failed to search for the Ipv6.

get_by_blocks_equipment(block1, block2, block3, block4, block5, block6, block7, block8, equip_id)[source]

Get IPv6 by blocks and equip_id. @return: IPv6. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP.

classmethod get_by_octs_and_environment(block1, block2, block3, block4, block5, block6, block7, block8, id_environment)[source]

Get Ipv6 by blocks and environment. @return: Ipv6. @raise IpNotFoundError: Ipv6 is not registered. @raise IpError: Failed to search for the Ipv6.

classmethod get_by_octs_and_environment_vip(block1, block2, block3, block4, block5, block6, block7, block8, id_evip, valid=True)[source]

Get Ipv6 by blocks and environment vip. @return: Ipv6. @raise IpNotFoundError: Ipv6 is not registered. @raise IpError: Failed to search for the Ipv6.

classmethod get_by_pk(id)[source]

Get IPv6 by id. @return: IPv6. @raise IpNotFoundError: IPv6 is not registered. @raise IpError: Failed to search for the IPv6. @raise OperationalError: Lock wait timeout exceeded.

classmethod get_first_available_ip6(id_network, topdown=False)[source]

Get a first available ip6 for network6 @return: Available IP6 @raise IpNotAvailableError: NetworkIPv6 does not has available Ip6

ip_formated

Returns formated ip.

ipv6_equipment
ipv6equipament_set
classmethod list_by_environment_and_equipment(id_ambiente, id_equipment)[source]

Get IP LIST by id_network. @return: IP List. @raise IpNotFoundError: IP is not registered. @raise IpError: Failed to search for the IP. @raise OperationalError: Lock wait timeout exceeded.

classmethod list_by_network(id_network)[source]

Get IP6 LIST by id_network. @return: IP6 List. @raise IpNotFoundError: IP6 is not registered. @raise IpError: Failed to search for the IP6. @raise OperationalError: Lock wait timeout exceeded.

log = <celery.utils.log.ProcessAwareLogger object>
neighborv6_local_ip
neighborv6_remote_ip
networkipv6
objects = <networkapi.models.BaseManager.BaseManager object>
requisicaovips_set
save_ipv6(equipment_id, user, net)[source]
server_pool_members

Returns pool members list.

serverpoolmember_set
update_v3(ip_map, locks_used=[])[source]

Method V3 to update Ipv6.

validate_v3(equipments)[source]

Validate Ip.

viprequest_set
vips

Returns vips list.

class networkapi.ip.models.Ipv6Equipament(id, ip_id, equipamento_id)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

create(authenticated_user, ip_id, equipment_id)[source]

Insere um relacionamento entre IP e Equipamento. @return: Nothing. @raise IpError: Falha ao inserir. @raise EquipamentoNotFoundError: Equipamento não cadastrado. @raise IpNotFoundError: Ip não cadastrado. @raise IpEquipamentoDuplicatedError: IP já cadastrado para o equipamento. @raise EquipamentoError: Falha ao pesquisar o equipamento.

create_v3(ip_equipment)[source]

Inserts a relationship between IP e Equipment. @return: Nothing. @raise IpError: Failure to insert. @raise EquipamentoNotFoundError: Equipment do not registered. @raise IpNotFoundError: Ip do not registered. @raise IpEquipamentoDuplicatedError: IP already registered for the equipment. @raise EquipamentoError: Failure to search equipment.

delete()[source]

Override Django’s method to remove Ipv6 and Equipment relationship. If Ip from this Ip-Equipment is associated with created Vip Request, and the Equipment is the last balancer associated, the IpEquipment association cannot be removed. If Ip has no relationship with other Equipments, then Ip is also removed.

delete_v3(bypass_ip=False)[source]

Method V3 to remove Ipv6 and Equipment relationship. If Ipv6 from this Ipv6-Equipment is associated with created Vip

Request and the Equipment is the last balancer associated, the IpEquipment association cannot be removed.
If Ipv6 has no relationship with other Equipments, then Ipv6 is
also removed.
@raise IpCantRemoveFromServerPool: Ip is associated with associated
Pool Member.
@raise IpEquipCantDissociateFromVip: Equipment is the last balanced
in a created Vip Request pointing to ip.
equipamento
classmethod get_by_ip6(ip6_id)[source]

Get IP6 by id_ip6 @return: IP6. @raise IpEquipmentNotFoundError: IP6 is not registered. @raise IpError: Failed to search for the I6P.

classmethod get_by_ip_equipment(ip_id, equip_id)[source]

Get Ipv6Equipament by ip_id and equip_id. @return: Ipv6Equipament. @raise IpEquipmentNotFoundError: Ipv6Equipament is not registered. @raise IpError: Failed to search for the Ipv6Equipament. @raise OperationalError: Lock wait timeout exceeded.

ip
classmethod list_by_equip(equip_id)[source]

Get IP6 by id_ip @return: IPEquipment. @raise IpEquipmentNotFoundError: IP6 is not registered. @raise IpError: Failed to search for the IP.

classmethod list_by_ip6(ip6_id)[source]

Get IP6 by id_ip6 @return: IP6. @raise IpEquipmentNotFoundError: IP6 is not registered. @raise IpError: Failed to search for the I6P.

log = <celery.utils.log.ProcessAwareLogger object>
objects = <networkapi.models.BaseManager.BaseManager object>
remove(authenticated_user, ip_id, equip_id)[source]

Research and removes the relationship between IP and equipment. @return: Nothing @raise IpEquipmentNotFoundError: Dont is no relationship between the IP and Equipment. @raise IpError: Failure to remove the relationship.

validate_ip()[source]

Validates whether IPv6 is already associated with equipment @raise IpEquipamentoDuplicatedError: if IPv6 is already associated with equipment

exception networkapi.ip.models.NetworkIPRangeEnvError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPvXError

Exception for two environments with same ip range when trying to add new network.

class networkapi.ip.models.NetworkIPv4(id, oct1, oct2, oct3, oct4, block, mask_oct1, mask_oct2, mask_oct3, mask_oct4, broadcast, vlan_id, network_type_id, ambient_vip_id, cluster_unit, active)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activate(authenticated_user)[source]
activate_v3()[source]
Send activate notication of network v4 for queue of ACL
configuration system.

Update status column to ‘active = 1’.

@raise NetworkIPv4Error: Error activating a NetworkIPv4.

add_network_ipv4(user, id_vlan, network_type, evip, prefix=None)[source]

Allocate and Insert new NetworkIPv4 in database @return: Vlan map @raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan @raise ConfigEnvironmentInvalidError: Invalid Environment Configuration or not registered @raise NetworkIPv4Error: Error persisting a NetworkIPv4. @raise NetworkIPv4AddressNotAvailableError: Unavailable address to create a NetworkIPv4. @raise Invalid: Unavailable address to create a NetworkIPv4. @raise InvalidValueError: Network type does not exist.

allocate_network_v3(id_vlan, prefix=None)[source]

Allocate new NetworkIPv4. @raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan @raise ConfigEnvironmentInvalidError: Invalid Environment

Configuration or not registered

@raise NetworkIPv4Error: Error persisting a NetworkIPv4. @raise NetworkIPv4AddressNotAvailableError: Unavailable address to

create a NetworkIPv4.

@raise Invalid: Unavailable address to create a NetworkIPv4. @raise InvalidValueError: Network type does not exist.

ambient_vip
create_v3(networkv4, locks_used=[], force=False)[source]

Create new networkIPv4.

deactivate(authenticated_user, commit=False)[source]

Update status column to ‘active = 0’ @param authenticated_user: User authenticate @raise NetworkIPv4Error: Error disabling a NetworkIPv4.

deactivate_v3()[source]
Send deactivate notication of network v4 for queue of ACL
configuration system.

Update status column to ‘active = 0’.

@raise NetworkIPv4Error: Error disabling a NetworkIPv4.

delete()[source]

Replace super(BaseModel, self).delete() Cause: When delete relationship in cascade default no have attribute User to Log.

delete_v3(locks_used=[], force=False)[source]

Method V3 to remove NetworkIPv4.

Before removing the NetworkIPv4 removes all your Ipv4

dhcprelay
dhcprelayipv4_set
edit_network_ipv4(authenticated_user, id_net_type, id_env_vip, cluster_unit)[source]
formated_octs

Returns formated octs.

classmethod get_by_pk(id)[source]

Get NetworkIPv4 by id. @return: NetworkIPv4. @raise NetworkIPv4NotFoundError: NetworkIPv4 is not registered. @raise NetworkIPv4Error: Failed to search for the NetworkIPv4. @raise OperationalError: Lock wait timeout exceeded.

ip_set
log = <celery.utils.log.ProcessAwareLogger object>
mask_formated

Returns formated mask.

network_type
networkv4

Returns formated ip.

objects = <networkapi.models.BaseManager.BaseManager object>
update_v3(networkv4, locks_used=[], force=False)[source]

Update networkIPv4.

validate_v3()[source]

Validate networkIPv4.

vlan
wildcard
exception networkapi.ip.models.NetworkIPv4AddressNotAvailableError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPv4Error

Exception to unavailable address to create a new NetworkIPv4.

exception networkapi.ip.models.NetworkIPv4Error(cause, message=None)[source]

Bases: exceptions.Exception

Generic exception for everything related to NetworkIPv4.

exception networkapi.ip.models.NetworkIPv4ErrorV3(message)[source]

Bases: exceptions.Exception

Generic exception for everything related to NetworkIPv4.

exception networkapi.ip.models.NetworkIPv4NotFoundError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPv4Error

Exception to search by primary key.

status_code = 404
class networkapi.ip.models.NetworkIPv6(id, vlan_id, network_type_id, ambient_vip_id, block, block1, block2, block3, block4, block5, block6, block7, block8, mask1, mask2, mask3, mask4, mask5, mask6, mask7, mask8, cluster_unit, active)[source]

Bases: networkapi.models.BaseModel.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

activate(authenticated_user)[source]
activate_v3()[source]
Send activate info of network v6 for queue of ACL configuration
system.

Update status column to ‘active = 1’.

@raise NetworkIPv6Error: Error activating a NetworkIPv6.

add_network_ipv6(user, id_vlan, network_type, evip, prefix=None)[source]

Insert new NetworkIPv6 in database @return: Vlan map @raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan @raise ConfigEnvironmentInvalidError: Invalid Environment Configuration or not registered @raise NetworkIPv6Error: Error persisting a NetworkIPv6. @raise NetworkIPv6AddressNotAvailableError: Unavailable address to create a NetworkIPv6. @raise InvalidValueError: Network type does not exist.

allocate_network_v3(id_vlan, prefix=None)[source]

Allocate new NetworkIPv6 @raise VlanNotFoundError: Vlan is not registered. @raise VlanError: Failed to search for the Vlan @raise ConfigEnvironmentInvalidError: Invalid Environment

Configuration or not registered

@raise NetworkIPv6Error: Error persisting a NetworkIPv6. @raise NetworkIPv6AddressNotAvailableError: Unavailable address to

create a NetworkIPv6.

@raise Invalid: Unavailable address to create a NetworkIPv6. @raise InvalidValueError: Network type does not exist.

ambient_vip
create_v3(networkv6, locks_used=[], force=False)[source]

Create new networkIPv6.

deactivate(authenticated_user, commit=False)[source]

Update status column to ‘active = 0’ @param authenticated_user: User authenticate @raise NetworkIPv6Error: Error disabling NetworkIPv6.

deactivate_v3()[source]
Send deactivate info of network v6 for queue of ACL configuration
system.

Update status column to ‘active = 0’.

@raise NetworkIPv6Error: Error disabling a NetworkIPv6.

delete()[source]

Replace super(BaseModel, self).delete() Cause: When delete relationship in cascade default no have attribute User to Log.

delete_v3(locks_used=[], force=False)[source]

Method V3 to remove networkIPv6.

Before removing the networkIPv6 removes all your Ipv4.

dhcprelay

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

dhcprelayipv6_set
edit_network_ipv6(authenticated_user, id_net_type, id_env_vip, cluster_unit)[source]
formated_octs

Returns formated octs.

classmethod get_by_pk(id)[source]

Get NetworkIPv6 by id. @return: NetworkIPv6. @raise NetworkIPv6NotFoundError: NetworkIPv6 is not registered. @raise NetworkIPv6Error: Failed to search for the NetworkIPv6. @raise OperationalError: Lock wait timeout exceeded.

ipv6_set
log = <celery.utils.log.ProcessAwareLogger object>
mask_formated

Returns formated mask.

network_type
networkv6

Returns formated ip.

objects = <networkapi.models.BaseManager.BaseManager object>
update_v3(networkv6, locks_used=[], force=False)[source]

Update networkIPv6.

validate_v3()[source]

Validate NetworkIPv6.

vlan
exception networkapi.ip.models.NetworkIPv6AddressNotAvailableError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPv6Error

Exception to unavailable address to create a new NetworkIPv6.

exception networkapi.ip.models.NetworkIPv6Error(cause, message=None)[source]

Bases: exceptions.Exception

Generic exception for everything related to NetworkIPv6.

exception networkapi.ip.models.NetworkIPv6ErrorV3(message)[source]

Bases: exceptions.Exception

Generic exception for everything related to NetworkIPv6.

exception networkapi.ip.models.NetworkIPv6NotFoundError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPv6Error

Exception to search by primary key.

exception networkapi.ip.models.NetworkIPvXError(cause, message=None)[source]

Bases: exceptions.Exception

Generic exception for everything related to both NetworkIPv4 and NetworkIPv6.

exception networkapi.ip.models.NetworkIPvXNotFoundError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPvXError

Exception to search by primary key.

exception networkapi.ip.models.NetworkIpAddressNotAvailableError(cause, message=None)[source]

Bases: networkapi.ip.models.NetworkIPvXError

Exception to unavailable address.

exception networkapi.ip.models.NetworkNotInEvip(cause, message=None)[source]

Bases: networkapi.ip.models.IpError

Retorna exceção caso não haja uma rede Ipv4 ou Ipv6 para o Ambiente Vip.

networkapi.ip.models.network_in_range(vlan, network, version)[source]
networkapi.ip.models.verify_subnet(vlan, network, version)[source]

Module contents