networkapi.ambiente package

Subpackages

Submodules

networkapi.ambiente.models module

class networkapi.ambiente.models.Ambiente(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

Ambiente(id, grupo_l3_id, ambiente_logico_id, divisao_dc_id, filter_id, acl_path, ipv4_template, ipv6_template, link, min_num_vlan_1, max_num_vlan_1, min_num_vlan_2, max_num_vlan_2, vrf, father_environment_id, default_vrf_id, dcroom_id, aws_vpc_id)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Ambiente.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Ambiente.ambiente_logico
Ambiente.ambiente_set
Ambiente.available_envvips_v3()[source]

Return list of environment vip with netv4 or netv6 related environment or environment vip without netv4 and netv6.

Return envvip_model:
 List of environment vip
Ambiente.aws_vpc
Ambiente.blockrules_set
Ambiente.children

Returns environment children of environment.

Ambiente.configenvironment_set
Ambiente.configs

Returns configs of environment.

Ambiente.create(authenticated_user)[source]

Efetua a inclusão de um novo o Ambiente.

@return: Id new Environment

@raise AmbienteError: Falha ao inserir um Ambiente.

@raise AmbienteLogicoNotFoundError: Não existe um Ambiente Lógico para a pk pesquisada.

@raise GrupoL3.DoesNotExist: Não existe um Grupo Layer 3 para a pk pesquisada.

@raise DivisaoDcNotFoundError: Não existe uma Divisão DataCenter para a pk pesquisada.

@raise AmbienteDuplicatedError: Ambiente duplicado.

@raise FilterNotFoundError: Não existe o filtro para a pk pesquisada.

Ambiente.create_configs(configs, env_id)[source]

Create configs of environment

Parameters:
  • configs – Configs of environment
  • env – Id of environment
Ambiente.create_v3(env_map)[source]
Ambiente.dcroom
Ambiente.default_vrf
Ambiente.delete_configs(configs_ids, env_id)[source]

Delete configs of environment

Parameters:
  • configs_ids – Id of Configs of environment
  • env – Id of environment
Ambiente.delete_v3()[source]
Ambiente.divisao_dc
Ambiente.environmentenvironmentvip_set
Ambiente.environmentinterface_set
Ambiente.environmentpeergroup_set
Ambiente.environmentrack_set
Ambiente.eqpts

Returns eqpts of environment.

Ambiente.equipamentoambiente_set
Ambiente.equipmentcontrollerenvironment_set
Ambiente.equipments

Returns eqpts of environment.

Ambiente.father_environment
Ambiente.filter
Ambiente.filtered_eqpts

Returns filtered eqpts of environment.

classmethod Ambiente.get_by_pk(id)[source]

Efetua a consulta de Ambiente pelo seu id.

@return: Um Ambiente.

@raise AmbienteError: Falha ao pesquisar o Ambiente.

@raise AmbienteNotFoundError: Não existe um Ambiente para o id pesquisado.

Ambiente.grupo_l3
Ambiente.healthcheckexpect_set
Ambiente.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2fdeb50>
Ambiente.name

Returns complete name for environment.

Ambiente.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2e67510>
Ambiente.opcaopoolambiente_set
Ambiente.optionpoolenvironment_set
Ambiente.peer_groups
Ambiente.peer_groups_id
classmethod Ambiente.remove(authenticated_user, pk)[source]

Efetua a remoção de um Ambiente.

@return: Nothing

@raise AmbienteError: Falha ao remover um HealthCheckExpect ou Ambiente Config associado ou o Ambiente.

@raise AmbienteNotFoundError: Não existe um Ambiente para a pk pesquisada.

@raise AmbienteUsedByEquipmentVlanError: Existe Equipamento ou Vlan associado ao ambiente que não pode ser removido.

Ambiente.routers

Returns routers of environment.

Ambiente.rule_set
Ambiente.sdn_controllers
Ambiente.search(divisao_dc_id=None, ambiente_logico_id=None)[source]
Ambiente.show_environment()[source]
classmethod Ambiente.update(authenticated_user, pk, **kwargs)[source]

Efetua a alteração de um Ambiente.

@return: Nothing

@raise AmbienteDuplicatedError: Ambiente duplicado.

@raise AmbienteError: Falha ao alterar o Ambiente.

@raise AmbienteNotFoundError: Não existe um Ambiente para a pk pesquisada.

@raise AmbienteLogicoNotFoundError: Não existe um Ambiente Lógico para a pk pesquisada.

@raise GrupoL3.DoesNotExist: Não existe um Grupo Layer 3 para a pk pesquisada.

@raise DivisaoDcNotFoundError: Não existe uma Divisão DataCenter para a pk pesquisada.

@raise CannotDissociateFilterError: Filter in use, can’t be dissociated.

Ambiente.update_configs(configs, env_id)[source]

Update configs of environment

Parameters:
  • configs – Configs of environment
  • env – Id of environment
Ambiente.update_v3(env_map)[source]
Ambiente.validate_v3()[source]
Ambiente.vlan_set
Ambiente.vlans

Returns vlans of environment.

exception networkapi.ambiente.models.AmbienteDuplicatedError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção porque existe um Ambiente cadastrada com os mesmos nomes
de grupo layer 3, ambiente lógico e divisão DC.
exception networkapi.ambiente.models.AmbienteError(cause, message=None)[source]

Bases: exceptions.Exception

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

class networkapi.ambiente.models.AmbienteLogico(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

AmbienteLogico(id, nome)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

AmbienteLogico.HOMOLOGACAO = 'HOMOLOGACAO'
exception AmbienteLogico.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

AmbienteLogico.ambiente_set
classmethod AmbienteLogico.get_by_name(name)[source]

“Get Logical Environment by name.

@return: Logical Environment.

@raise AmbienteLogicoNotFoundError: Logical Environment is not registered. @raise AmbienteError: Failed to search for the Logical Environment.

classmethod AmbienteLogico.get_by_pk(idt)[source]

“Get Logical Environment by id.

@return: Logical Environment.

@raise AmbienteLogicoNotFoundError: Logical Environment is not registered. @raise AmbienteError: Failed to search for the Logical Environment.

AmbienteLogico.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2fc0a90>
AmbienteLogico.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2fc0d10>
exception networkapi.ambiente.models.AmbienteLogicoNameDuplicatedError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção porque existe uma Divisão DataCenter cadastrada com o mesmo nome.

exception networkapi.ambiente.models.AmbienteLogicoNotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção para pesquisa de ambiente lógico por chave primária.

exception networkapi.ambiente.models.AmbienteLogicoUsedByEnvironmentError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção se houver tentativa de exclusão de um Ambiente Lógico utilizado por algum ambiente.

exception networkapi.ambiente.models.AmbienteNotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

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

exception networkapi.ambiente.models.AmbienteUsedByEquipmentVlanError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção se houver tentativa de exclusão de um Ambiente utilizado por algum equipamento ou alguma VLAN.

class networkapi.ambiente.models.ConfigEnvironment(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

ConfigEnvironment(id, environment_id, ip_config_id)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ConfigEnvironment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ConfigEnvironment.environment
classmethod ConfigEnvironment.get_by_environment(id_environment)[source]

Search all ConfigEnvironment by Environment ID

@return: all ConfigEnvironment

@raise ConfigEnvironmentError: Error finding ConfigEnvironment by Environment ID. @raise ConfigEnvironmentNotFoundError: ConfigEnvironment not found in database.

classmethod ConfigEnvironment.get_by_ip_config(id_ip_config)[source]

Search all ConfigEnvironment by IPConfig ID

@return: all ConfigEnvironment

@raise ConfigEnvironmentError: Error finding ConfigEnvironment by IPConfig ID. @raise ConfigEnvironmentNotFoundError: ConfigEnvironment not found in database.

classmethod ConfigEnvironment.get_by_pk(id_environment, id_ip_config)[source]

Search ConfigEnvironment by your primary key

@return: ConfigEnvironment

@raise ConfigEnvironmentError: Error finding ConfigEnvironment by primary key. @raise ConfigEnvironmentNotFoundError: ConfigEnvironment not found in database.

ConfigEnvironment.ip_config
ConfigEnvironment.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2ff9050>
ConfigEnvironment.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff9350>
classmethod ConfigEnvironment.remove_by_environment(authenticated_user, id_environment)[source]

Search all ConfigEnvironment by Environment ID and remove them

@raise ConfigEnvironmentError: Error finding ConfigEnvironment by Environment ID. @raise ConfigEnvironmentNotFoundError: ConfigEnvironment not found in database. @raise OperationalError: Lock wait timeout exceeded.

ConfigEnvironment.save()[source]

Save ConfigEnvironment

@raise ConfigEnvironmentDuplicateError: ConfigEnvironment Duplicate

exception networkapi.ambiente.models.ConfigEnvironmentDuplicateError(cause, message=None)[source]

Bases: networkapi.ambiente.models.ConfigEnvironmentError

Exception generated when ConfigEnvironment Duplicate Environment and IpConfig

exception networkapi.ambiente.models.ConfigEnvironmentError(cause, message=None)[source]

Bases: exceptions.Exception

Generic exception for everything related to ConfigEnvironment.

exception networkapi.ambiente.models.ConfigEnvironmentInvalidError(cause, message=None)[source]

Bases: networkapi.ambiente.models.ConfigEnvironmentError

Exception generated when ConfigEnvironment was not found in database

exception networkapi.ambiente.models.ConfigEnvironmentNotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.ConfigEnvironmentError

Exception generated when ConfigEnvironment was not found in database

class networkapi.ambiente.models.DivisaoDc(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

DivisaoDc(id, nome)

BE = 'BE'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

DivisaoDc.FE = 'FE'
exception DivisaoDc.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

DivisaoDc.ambiente_set
classmethod DivisaoDc.get_by_name(name)[source]

Get Division Dc by name.

@return:Division Dc.

@raise AmbienteLogicoNotFoundError: Division Dc is not registered. @raise AmbienteError: Failed to search for the Division Dc.

classmethod DivisaoDc.get_by_pk(idt)[source]

“Get Division Dc by id.

@return: Division Dc.

@raise DivisaoDcNotFoundError: Division Dc is not registered. @raise AmbienteError: Failed to search for the Division Dc.

DivisaoDc.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2fc0710>
DivisaoDc.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2fc0950>
exception networkapi.ambiente.models.DivisaoDcNameDuplicatedError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção porque existe uma Divisão DataCenter cadastrada com o mesmo nome.

exception networkapi.ambiente.models.DivisaoDcNotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção para pesquisa de Divisão DataCenter pelo nome.

exception networkapi.ambiente.models.DivisaoDcUsedByEnvironmentError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção se houver tentativa de exclusão de uma Divisão DC utilizada por algum ambiente.

class networkapi.ambiente.models.EnvironmentEnvironmentVip(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

EnvironmentEnvironmentVip(id, environment_id, environment_vip_id)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception EnvironmentEnvironmentVip.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

EnvironmentEnvironmentVip.environment
EnvironmentEnvironmentVip.environment_vip
classmethod EnvironmentEnvironmentVip.get_by_environment_environment_vip(environment_id, environment_vip_id)[source]

Search all EnvironmentEnvironmentVip by Environment ID and EnvironmentVip ID

@return: all EnvironmentEnvironmentVip

@raise EnvironmentEnvironmentVipError: Error finding EnvironmentEnvironmentVipError by Environment ID and EnvironmentVip ID. @raise EnvironmentEnvironmentVipNotFoundError: ConfigEnvironment not found in database. @raise OperationalError: Error when made find.

classmethod EnvironmentEnvironmentVip.get_environment_list_by_environment_vip(environment_vip)[source]
classmethod EnvironmentEnvironmentVip.get_environment_list_by_environment_vip_list(environment_vip_list)[source]
classmethod EnvironmentEnvironmentVip.get_server_pool_by_environment_environment_vip(environment_environment_vip)[source]
EnvironmentEnvironmentVip.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2ff94d0>
EnvironmentEnvironmentVip.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff98d0>
EnvironmentEnvironmentVip.validate()[source]

Validates whether Environment is already associated with EnvironmentVip

@raise EnvironmentEnvironmentVipDuplicatedError: if Environment is already associated with EnvironmentVip

exception networkapi.ambiente.models.EnvironmentErrorV3(cause)[source]

Bases: exceptions.Exception

class networkapi.ambiente.models.EnvironmentVip(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

EnvironmentVip(id, finalidade_txt, cliente_txt, ambiente_p44_txt, description, conf)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception EnvironmentVip.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

EnvironmentVip.available_evips(evips, id_vlan)[source]
EnvironmentVip.create_v3(env_map)[source]
EnvironmentVip.delete()[source]

Override Django’s method to remove environment vip

Before removing the environment vip removes all relationships with option vip.

EnvironmentVip.delete_v3()[source]
EnvironmentVip.environmentenvironmentvip_set
EnvironmentVip.environments

Returns list of EnvironmentEnvironmentvip.

classmethod EnvironmentVip.get_by_pk(id)[source]

“Get Environment Vip by id.

@return: Environment Vip.

@raise EnvironmentVipNotFoundError: Environment Vip is not registered. @raise EnvironmentVipError: Failed to search for the Environment Vip. @raise OperationalError: Lock wait timeout exceeded.

classmethod EnvironmentVip.get_by_values(finalidade, cliente, ambiente_p44)[source]

“Get Environment Vip by id.

@return: Environment Vip.

@raise EnvironmentVipNotFoundError: Environment Vip is not registered. @raise EnvironmentVipError: Failed to search for the Environment Vip. @raise OperationalError: Lock wait timeout exceeded.

classmethod EnvironmentVip.get_environment_vips_by_environment_id(environment_id)[source]
EnvironmentVip.list_all_ambientep44_by_finality_and_cliente(finalidade, cliente_txt)[source]

Get Environment Vip by id.

@return: Environment Vip.

@raise EnvironmentVipNotFoundError: Environment Vip is not registered. @raise EnvironmentVipError: Failed to search for the Environment Vip. @raise OperationalError: Lock wait timeout exceeded.

EnvironmentVip.list_all_clientes_by_finalitys(finalidade)[source]

Get cliente_txt by finalidade_txt with distinct.

@return: Environment Vip.

@raise EnvironmentVipNotFoundError: Environment Vip is not registered. @raise EnvironmentVipError: Failed to search for the Environment Vip. @raise OperationalError: Lock wait timeout exceeded.

EnvironmentVip.list_all_finalitys()[source]

Get all finalidade_txt of environment VIPs with distinct.

@return: Environment Vip.

@raise EnvironmentVipNotFoundError: Environment Vip is not registered. @raise EnvironmentVipError: Failed to search for the Environment Vip. @raise OperationalError: Lock wait timeout exceeded.

EnvironmentVip.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2fde050>
EnvironmentVip.name

Returns complete name for environment.

EnvironmentVip.networkipv4_set
EnvironmentVip.networkipv6_set
EnvironmentVip.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2fde310>
EnvironmentVip.optionsvip

Returns list of OptionvipEnvironmentvip.

EnvironmentVip.show_environment_vip()[source]
EnvironmentVip.update_v3(env_map)[source]
EnvironmentVip.valid_environment_vip(environmentvip_map)[source]

Validate the values ​​of environment vip

@param environmentvip_map: Map with the data of the request.

@raise InvalidValueError: Represents an error occurred validating a value.

EnvironmentVip.viprequest_set
exception networkapi.ambiente.models.GroupL3NotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Exception generated when GroupL3 was not found in database

class networkapi.ambiente.models.GrupoL3(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

GrupoL3(id, nome)

CITTA_CD = 'CITTA CORE/DENSIDADE'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception GrupoL3.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

GrupoL3.ambiente_set
classmethod GrupoL3.get_by_name(name)[source]

“Get Group L3 by name.

@return: Group L3.

@raise GroupL3NotFoundError: Group L3 is not registered. @raise AmbienteError: Failed to search for the Group L3.

classmethod GrupoL3.get_by_pk(idt)[source]

“Get Group L3 by id.

@return: Group L3.

@raise GroupL3NotFoundError: Group L3 is not registered. @raise AmbienteError: Failed to search for the Group L3.

GrupoL3.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2fc0350>
GrupoL3.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2fc05d0>
exception networkapi.ambiente.models.GrupoL3NameDuplicatedError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção porque existe um GrupoL3 cadastrada com o mesmo nome.

exception networkapi.ambiente.models.GrupoL3UsedByEnvironmentError(cause, message=None)[source]

Bases: networkapi.ambiente.models.AmbienteError

Retorna exceção se houver tentativa de exclusão de um GrupoL3 utilizado por algum ambiente.

class networkapi.ambiente.models.IPConfig(*args, **kwargs)[source]

Bases: networkapi.models.BaseModel.BaseModel

IPConfig(id, subnet, new_prefix, type, network_type_id)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception IPConfig.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class IPConfig.TipoRede(*args, **kwargs)

Bases: networkapi.models.BaseModel.BaseModel

TipoRede(id, tipo_rede)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception IPConfig.TipoRede.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod IPConfig.TipoRede.get_by_name(name)
classmethod IPConfig.TipoRede.get_by_pk(id)
IPConfig.TipoRede.ipconfig_set
IPConfig.TipoRede.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2ff5050>
IPConfig.TipoRede.networkipv4_set
IPConfig.TipoRede.networkipv6_set
IPConfig.TipoRede.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff52d0>
IPConfig.configenvironment_set
static IPConfig.create(environment_id, configuration)[source]

@raise IPConfigError: Error saving IPConfig by ID.

static IPConfig.get_by_environment(environment_id)[source]

Search all ConfigEnvironment by Environment ID

@return: all ConfigEnvironment

@raise ConfigEnvironmentError: Error finding ConfigEnvironment by Environment ID. @raise ConfigEnvironmentNotFoundError: ConfigEnvironment not found in database.

classmethod IPConfig.get_by_pk(id)[source]

Search IPConfig by your primary key

@return: IPConfig

@raise IPConfigError: Error finding IPConfig by primary key. @raise IPConfigNotFoundError: IPConfig not found in database.

IPConfig.get_type_display(*moreargs, **morekwargs)
IPConfig.log = <celery.utils.log.ProcessAwareLogger object at 0x7fdee2e8b150>
IPConfig.network_type
IPConfig.objects = <networkapi.models.BaseManager.BaseManager object at 0x7fdee2ff5b50>
static IPConfig.remove(authenticated_user, environment_id, configuration_id)[source]

Search all IpConfig by ID and remove them

@raise IPConfigError: Error removeing IPConfig by ID. @raise IPConfigNotFoundError: IPConfig not found in database. @raise OperationalError: Lock wait timeout exceeded.

exception networkapi.ambiente.models.IPConfigError(cause, message=None)[source]

Bases: exceptions.Exception

Generic exception for everything related to IPConfig.

exception networkapi.ambiente.models.IPConfigNotFoundError(cause, message=None)[source]

Bases: networkapi.ambiente.models.IPConfigError

Exception generated when IPConfig was not found in database

class networkapi.ambiente.models.IP_VERSION[source]
IPv4 = ('v4', 'IPv4')
IPv6 = ('v6', 'IPv6')
List = (('v4', 'IPv4'), ('v6', 'IPv6'))

Module contents