Search is not available for this dataset
text
stringlengths
75
104k
def validar(self, id_vlan): """Validates ACL - IPv4 of VLAN from its identifier. Assigns 1 to 'acl_valida'. :param id_vlan: Identifier of the Vlan. Integer value and greater than zero. :return: None :raise InvalidParameterError: Vlan identifier is null and invalid. :r...
def validate_ipv6(self, id_vlan): """Validates ACL - IPv6 of VLAN from its identifier. Assigns 1 to 'acl_valida_v6'. :param id_vlan: Identifier of the Vlan. Integer value and greater than zero. :return: None :raise InvalidParameterError: Vlan identifier is null and invalid. ...
def remove(self, id_vlan): """Remove a VLAN by your primary key. Execute script to remove VLAN :param id_vlan: ID for VLAN. :return: Following dictionary: :: {‘sucesso’: {‘codigo’: < codigo >, ‘descricao’: {'stdout':< stdout >, 'stderr':< stderr >}}} ...
def deallocate(self, id_vlan): """Deallocate all relationships between Vlan. :param id_vlan: Identifier of the VLAN. Integer value and greater than zero. :return: None :raise InvalidParameterError: VLAN identifier is null and invalid. :raise VlanError: VLAN is active. ...
def allocate_IPv6( self, name, id_network_type, id_environment, description, id_environment_vip=None): """Inserts a new VLAN. :param name: Name of Vlan. String with a maximum of 50 characters. :param id_network_type: Identi...
def create_script_acl(self, id_vlan, network_type): '''Generate the script acl :param id_vlan: Vlan Id :param network_type: v4 or v6 :raise InvalidValueError: Attrs invalids. :raise XMLError: Networkapi failed to generate the XML response. :raise VlanACLDuplicatedError:...
def inserir(self, id_user, id_group): """Create a relationship between User and Group. :param id_user: Identifier of the User. Integer value and greater than zero. :param id_group: Identifier of the Group. Integer value and greater than zero. :return: Dictionary with the following stru...
def dumps(map, root_name, root_attributes=None): """Cria um string no formato XML a partir dos elementos do map. Os elementos do mapa serão nós filhos do root_name. Cada chave do map será um Nó no XML. E o valor da chave será o conteúdo do Nó. Exemplos: :: - Mapa: {'networkapi':1} ...
def loads(xml, force_list=None): """Cria um dicionário com os dados do XML. O dicionário terá como chave o nome do nó root e como valor o conteúdo do nó root. Quando o conteúdo de um nó é uma lista de nós então o valor do nó será um dicionário com uma chave para cada nó. Entretanto, se existir nós,...
def option_vip_by_environment_vip_type(self, environment_vip_id, type_option): """ List option vip. param environment_vip_id: Id of Environment Vip Param type_option: type option vip """ uri = "api/v3/option-vip/environment-vip/%s/type-option/%s/" % (environment_vip_id, ...
def search(self, **kwargs): """ Method to search neighbors based on extends search. :param search: Dict containing QuerySets to find neighbors. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on response. ...
def delete(self, ids): """ Method to delete neighbors by their id's :param ids: Identifiers of neighbors :return: None """ url = build_uri_with_ids('api/v4/neighbor/%s/', ids) return super(ApiV4Neighbor, self).delete(url)
def update(self, neighbors): """ Method to update neighbors :param neighbors: List containing neighbors desired to updated :return: None """ data = {'neighbors': neighbors} neighbors_ids = [str(env.get('id')) for env in neighbors] return super(ApiV4Neig...
def create(self, neighbors): """ Method to create neighbors :param neighbors: List containing neighbors desired to be created on database :return: None """ data = {'neighbors': neighbors} return super(ApiV4Neighbor, self).post('api/v4/neighbor/', data)
def add_equipamento( self, id_tipo_equipamento, id_modelo, prefixo, id_grupo, id_vlan, descricao_vlan): """Adiciona um equipamento na lista de equipamentos para operação de inserir/alterar um grupo virtual. :param id_ti...
def add_equipamento_remove(self, id, id_ip, ids_ips_vips): '''Adiciona um equipamento na lista de equipamentos para operação de remover um grupo virtual. :param id: Identificador do equipamento. :param id_ip: Identificador do IP do equipamento. :param ids_ips_vips: Lista com os identifi...
def add_vip( self, id, real_name_sufixo, id_vlan, descricao_vlan, id_vlan_real, descricao_vlan_real, balanceadores, id_healthcheck_expect, finalidade, cliente, ambiente, ...
def add_vip_remove(self, id_ip, id_equipamentos): '''Adiciona um VIP na lista de VIPs para operação de remover um grupo virtual. :param id_ip: Identificador do IP criado para o VIP. :param id_equipamentos: Lista com os identificadores dos balanceadores associados ao IP do VIP. :return:...
def add_vip_incremento(self, id): """Adiciona um vip à especificação do grupo virtual. :param id: Identificador de referencia do VIP. """ vip_map = dict() vip_map['id'] = id self.lista_vip.append(vip_map)
def get_access(self, id_access): """Get Equipment Access by id. :return: Dictionary with following: :: {'equipamento_acesso': {'id_equipamento': < id_equipamento >, 'fqdn': < fqdn >, 'user': < user >, 'pass': < pass >, 'i...
def list_by_equip(self, name): """ List all equipment access by equipment name :return: Dictionary with the following structure: :: {‘equipamento_acesso’:[ {'id': <id_equiptos_access>, 'equipamento': <id_equip>, 'fqdn': <fqdn>, 'user': <...
def inserir( self, id_equipamento, fqdn, user, password, id_tipo_acesso, enable_pass): """Add new relationship between equipment and access type and returns its id. :param id_equipamento: Equipment identifier. :...
def edit_by_id( self, id_equip_acesso, id_tipo_acesso, fqdn, user, password, enable_pass): """Edit access type, fqdn, user, password and enable_pass of the relationship of equipment and access type. :param id_ti...
def remover(self, id_tipo_acesso, id_equipamento): """Removes relationship between equipment and access type. :param id_equipamento: Equipment identifier. :param id_tipo_acesso: Access type identifier. :return: None :raise EquipamentoNaoExisteError: Equipment doesn't exist. ...
def set_poolmember_state(self, id_pools, pools): """ Enable/Disable pool member by list """ data = dict() uri = "api/v3/pool/real/%s/member/status/" % ';'.join(id_pools) data["server_pools"] = pools return self.put(uri, data=data)
def get_poolmember_state(self, id_pools, checkstatus=0): """ Enable/Disable pool member by list """ uri = "api/v3/pool/real/%s/member/status/?checkstatus=%s" % (';'.join(id_pools), checkstatus) return self.get(uri)
def list_all(self, environment_id, pagination): """ List All Pools To Populate Datatable :param pagination: Object Pagination :return: Following dictionary:{ "total" : < total >, "pools"...
def list_all_by_reqvip(self, id_vip, pagination): """ List All Pools To Populate Datatable :param pagination: Object Pagination :return: Following dictionary:{ "total" : < total >, "pool...
def remove(self, pools): """ Remove Pools Running Script And Update to Not Created :param ids: List of ids :return: None on success :raise ScriptRemovePoolException :raise InvalidIdPoolException :raise NetworkAPIException """ ...
def create(self, pools): """ Create Pools Running Script And Update to Created :param pools: List of pools :return: None on success :raise PoolDoesNotExistException :raise ScriptCreatePoolException :raise InvalidIdPoolException ...
def enable(self, ids): """ Enable Pool Members Running Script :param ids: List of ids :return: None on success :raise PoolMemberDoesNotExistException :raise InvalidIdPoolMemberException :raise ScriptEnablePoolException :raise...
def disable(self, ids): """ Disable Pool Members Running Script :param ids: List of ids :return: None on success :raise PoolMemberDoesNotExistException :raise InvalidIdPoolMemberException :raise ScriptDisablePoolException :ra...
def listar_por_grupo_usuario(self, id_grupo_usuario): """Lista todos os direitos de um grupo de usuário em grupos de equipamento. :param id_grupo_usuario: Identificador do grupo de usuário para filtrar a pesquisa. :return: Dicionário com a seguinte estrutura: :: {'direito...
def listar_por_grupo_equipamento(self, id_grupo_equipamento): """Lista todos os direitos de grupos de usuário em um grupo de equipamento. :param id_grupo_equipamento: Identificador do grupo de equipamento para filtrar a pesquisa. :return: Dicionário com a seguinte estrutura: :: ...
def buscar_por_id(self, id_direito): """Obtém os direitos de um grupo de usuário e um grupo de equipamento. :param id_direito: Identificador do direito grupo equipamento. :return: Dicionário com a seguinte estrutura: :: {'direito_grupo_equipamento': {'id_grupo...
def inserir( self, id_grupo_usuario, id_grupo_equipamento, leitura, escrita, alterar_config, exclusao): """Cria um novo direito de um grupo de usuário em um grupo de equipamento e retorna o seu identificador. :param id_...
def alterar(self, id_direito, leitura, escrita, alterar_config, exclusao): """Altera os direitos de um grupo de usuário em um grupo de equipamento a partir do seu identificador. :param id_direito: Identificador do direito grupo equipamento. :param leitura: Indicação de permissão de leitura ('0'...
def remover(self, id_direito): """Remove os direitos de um grupo de usuário em um grupo de equipamento a partir do seu identificador. :param id_direito: Identificador do direito grupo equipamento :return: None :raise DireitoGrupoEquipamentoNaoExisteError: Direito Grupo Equipamento não...
def search(self, **kwargs): """ Method to search object group permissions based on extends search. :param search: Dict containing QuerySets to find object group permissions. :param include: Array containing fields to include on response. :param exclude: Array containing fields t...
def delete(self, ids): """ Method to delete object group permissions by their ids :param ids: Identifiers of object group permissions :return: None """ url = build_uri_with_ids('api/v3/object-group-perm/%s/', ids) return super(ApiObjectGroupPermission, self).dele...
def update(self, ogps): """ Method to update object group permissions :param ogps: List containing object group permissions desired to updated :return: None """ data = {'ogps': ogps} ogps_ids = [str(ogp.get('id')) for ogp in ogps] return super(ApiObject...
def create(self, ogps): """ Method to create object group permissions :param ogps: List containing vrf desired to be created on database :return: None """ data = {'ogps': ogps} return super(ApiObjectGroupPermission, self).post('api/v3/object-group-perm/', data)
def inserir(self, id_equipment, id_script): """Inserts a new Related Equipment with Script and returns its identifier :param id_equipment: Identifier of the Equipment. Integer value and greater than zero. :param id_script: Identifier of the Script. Integer value and greater than zero. ...
def search(self, **kwargs): """ Method to search vrf's based on extends search. :param search: Dict containing QuerySets to find vrf's. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on response. :param ...
def delete(self, ids): """ Method to delete vrf's by their id's :param ids: Identifiers of vrf's :return: None """ url = build_uri_with_ids('api/v3/vrf/%s/', ids) return super(ApiVrf, self).delete(url)
def update(self, vrfs): """ Method to update vrf's :param vrfs: List containing vrf's desired to updated :return: None """ data = {'vrfs': vrfs} vrfs_ids = [str(vrf.get('id')) for vrf in vrfs] return super(ApiVrf, self).put('api/v3/vrf/%s/' % ...
def create(self, vrfs): """ Method to create vrf's :param vrfs: List containing vrf's desired to be created on database :return: None """ data = {'vrfs': vrfs} return super(ApiVrf, self).post('api/v3/vrf/', data)
def inserir(self, name): """Inserts a new Equipment Type and returns its identifier :param name: Equipment Type name. String with a minimum 3 and maximum of 100 characters :return: Dictionary with the following structure: :: {'tipo_equipamento': {'id': < id_equipment_ype ...
def inserir(self, id_equipment, id_environment, is_router=0): """Inserts a new Related Equipment with Environment and returns its identifier :param id_equipment: Identifier of the Equipment. Integer value and greater than zero. :param id_environment: Identifier of the Environment. Integer value...
def remover(self, id_equipment, id_environment): """Remove Related Equipment with Environment from by the identifier. :param id_equipment: Identifier of the Equipment. Integer value and greater than zero. :param id_environment: Identifier of the Environment. Integer value and greater than zero....
def update(self, id_equipment, id_environment, is_router): """Remove Related Equipment with Environment from by the identifier. :param id_equipment: Identifier of the Equipment. Integer value and greater than zero. :param id_environment: Identifier of the Environment. Integer value and greater ...
def remove_connection(self, interface1, interface2): """Remove a connection between two interfaces""" uri = "api/interface/disconnect/%s/%s/" % (interface1, interface2) return self.delete(uri)
def search(self, **kwargs): """ Method to search interfaces based on extends search. :return: Dict containing interfaces. """ return super(ApiInterfaceRequest, self).get(self.prepare_url('api/v3/interface/', kwargs))
def get(self, ids, **kwargs): """ Method to get interfaces by their ids. :param ids: List containing identifiers of interfaces. :return: Dict containing interfaces. """ url = build_uri_with_ids('api/v3/interface/%s/', ids) return super(ApiInterfaceRequest, self)...
def remove(self, ids, **kwargs): """ Method to delete interface by id. :param ids: List containing identifiers of interfaces. """ url = build_uri_with_ids('api/v3/interface/%s/', ids) return super(ApiInterfaceRequest, self).delete(self.prepare_url(url, kwargs))
def create(self, interface): """ Method to add an interface. :param interface: List containing interface's desired to be created on database. :return: Id. """ data = {'interfaces': interface} return super(ApiInterfaceRequest, self).post('api/v3/interface/', data)
def update(self, interfaces=None): """ Method to update interface. :param interfaces: List containing interface's desired to be updated on database. :return: None. """ data = {'interfaces': interfaces} return super(ApiInterfaceRequest, self).put('api/v3/interfac...
def associate_interface_environments(self, int_env_map): """ Method to add an interface. :param int_env_map: List containing interfaces and environments ids desired to be associates. :return: Id. """ data = {'interface_environments': int_env_map} return super(Api...
def connecting_interfaces(self, interfaces): """ Method to connecting interfaces. :param interfaces: List containing a dictionary with the interfaces ids and front or back. :return: 200 OK. """ data = {'interfaces': interfaces} url = 'api/v3/connections/' + str(...
def disconnecting_interfaces(self, interfaces, **kwargs): """ Method to remove the link between interfaces. :param interfaces: List of ids. :return: 200 OK. """ url = 'api/v3/connections/' + str(interfaces[0]) + '/' + str(interfaces[1]) + '/' return super(ApiInt...
def create_channel(self, channel): """ Method to create a channel. :param channel: List containing channel's desired to be created on database. :return: Id. """ data = {'channels': channel} return super(ApiInterfaceRequest, self).post('api/v3/channel/', data)
def update_channel(self, channel): """ Method to update a channel. :param channel: List containing channel's desired to be created on database. :return: Id. """ data = {'channels': channel} return super(ApiInterfaceRequest, self).put('api/v3/channel/', data)
def inserir(self, name): """Inserts a new Group L3 and returns its identifier. :param name: Group L3 name. String with a minimum 2 and maximum of 80 characters :return: Dictionary with the following structure: :: {'group_l3': {'id': < id_group_l3 >}} :raise Inval...
def alterar(self, id_groupl3, name): """Change Group L3 from by the identifier. :param id_groupl3: Identifier of the Group L3. Integer value and greater than zero. :param name: Group L3 name. String with a minimum 2 and maximum of 80 characters :return: None :raise InvalidPara...
def remover(self, id_groupl3): """Remove Group L3 from by the identifier. :param id_groupl3: Identifier of the Group L3. Integer value and greater than zero. :return: None :raise InvalidParameterError: The identifier of Group L3 is null and invalid. :raise GrupoL3NaoExisteErro...
def get(self, url, auth_map=None): """Envia uma requisição GET para a URL informada. Se auth_map é diferente de None, então deverá conter as chaves NETWORKAPI_PASSWORD e NETWORKAPI_USERNAME para realizar a autenticação na networkAPI. As chaves e os seus valores são enviados no h...
def put(self, url, request_data, content_type=None, auth_map=None): """Envia uma requisição PUT para a URL informada. Se auth_map é diferente de None, então deverá conter as chaves NETWORKAPI_PASSWORD e NETWORKAPI_USERNAME para realizar a autenticação na networkAPI. As ...
def post_map(self, url, map, auth_map=None): """Gera um XML a partir dos dados do dicionário e o envia através de uma requisição POST. :param url: URL para enviar a requisição HTTP. :param map: Dicionário com os dados do corpo da requisição HTTP. :param auth_map: Dicionário com as infor...
def put_map(self, url, map, auth_map=None): """Gera um XML a partir dos dados do dicionário e o envia através de uma requisição PUT. :param url: URL para enviar a requisição HTTP. :param map: Dicionário com os dados do corpo da requisição HTTP. :param auth_map: Dicionário com as informa...
def get_map(self, url, auth_map=None): """Envia uma requisição GET. :param url: URL para enviar a requisição HTTP. :param auth_map: Dicionário com as informações para autenticação na networkAPI. :return: Retorna uma tupla contendo: (< código de resposta http >, < corpo da r...
def delete_map(self, url, map=None, auth_map=None): """Gera um XML a partir dos dados do dicionário e o envia através de uma requisição DELETE. :param url: URL para enviar a requisição HTTP. :param map: Dicionário com os dados do corpo da requisição HTTP. :param auth_map: Dicionário com...
def get_full_url(self, parsed_url): """ Returns url path with querystring """ full_path = parsed_url.path if parsed_url.query: full_path = '%s?%s' % (full_path, parsed_url.query) return full_path
def submit(self, map): '''Envia a requisição HTTP de acordo com os parâmetros informados no construtor. :param map: Dicionário com os dados do corpo da requisição. :return: Retorna uma tupla contendo: (< código de resposta http >, < corpo da resposta >). :raise ConnectionE...
def search(self, **kwargs): """ Method to search Virtual Interfaces based on extends search. :param search: Dict containing QuerySets to find Virtual Interfaces. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on...
def delete(self, ids): """ Method to delete Virtual Interfaces by their id's :param ids: Identifiers of Virtual Interfaces :return: None """ url = build_uri_with_ids('api/v4/virtual-interface/%s/', ids) return super(ApiV4VirtualInterface, self).delete(url)
def update(self, virtual_interfaces): """ Method to update Virtual Interfaces :param Virtual Interfaces: List containing Virtual Interfaces desired to updated :return: None """ data = {'virtual_interfaces': virtual_interfaces} virtual_interfaces_ids = [str(env.g...
def create(self, virtual_interfaces): """ Method to create Virtual Interfaces :param Virtual Interfaces: List containing Virtual Interfaces desired to be created on database :return: None """ data = {'virtual_interfaces': virtual_interfaces} return super(ApiV4Vi...
def search(self, id_ugroup): """Search Group User by its identifier. :param id_ugroup: Identifier of the Group User. Integer value and greater than zero. :return: Following dictionary: :: {‘user_group’: {'escrita': < escrita >, 'nome': < nome >, 'e...
def inserir(self, name, read, write, edit, remove): """Insert new user group and returns its identifier. :param name: User group's name. :param read: If user group has read permission ('S' ou 'N'). :param write: If user group has write permission ('S' ou 'N'). :param edit: If us...
def alterar(self, id_user_group, name, read, write, edit, remove): """Edit user group data from its identifier. :param id_user_group: User group id. :param name: User group name. :param read: If user group has read permission ('S' ou 'N'). :param write: If user group has write p...
def remover(self, id_user_group): """Removes a user group by its id. :param id_user_group: User Group's identifier. Valid integer greater than zero. :return: None :raise GrupoUsuarioNaoExisteError: User Group not found. :raise InvalidParameterError: User Group id is invalid or...
def get_environment(self, environment_ids): """ Method to get environment """ uri = 'api/v3/environment/%s/' % environment_ids return super(ApiEnvironment, self).get(uri)
def create_environment(self, environment): """ Method to create environment """ uri = 'api/v3/environment/' data = dict() data['environments'] = list() data['environments'].append(environment) return super(ApiEnvironment, self).post(uri, data)
def update_environment(self, environment, environment_ids): """ Method to update environment :param environment_ids: Ids of Environment """ uri = 'api/v3/environment/%s/' % environment_ids data = dict() data['environments'] = list() data['environments']...
def delete_environment(self, environment_ids): """ Method to delete environment :param environment_ids: Ids of Environment """ uri = 'api/v3/environment/%s/' % environment_ids return super(ApiEnvironment, self).delete(uri)
def search(self, **kwargs): """ Method to search environments based on extends search. :param search: Dict containing QuerySets to find environments. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on response. ...
def delete(self, ids): """ Method to delete environments by their id's :param ids: Identifiers of environments :return: None """ url = build_uri_with_ids('api/v3/environment/%s/', ids) return super(ApiEnvironment, self).delete(url)
def update(self, environments): """ Method to update environments :param environments: List containing environments desired to updated :return: None """ data = {'environments': environments} environments_ids = [str(env.get('id')) for env in environments] ...
def create(self, environments): """ Method to create environments :param environments: Dict containing environments desired to be created on database :return: None """ data = {'environments': environments} return super(ApiEnvironment, self).post('api/v3/environm...
def search(self, **kwargs): """ Method to search asns based on extends search. :param search: Dict containing QuerySets to find asns. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on response. :param fi...
def delete(self, ids): """ Method to delete asns by their id's :param ids: Identifiers of asns :return: None """ url = build_uri_with_ids('api/v4/as/%s/', ids) return super(ApiV4As, self).delete(url)
def update(self, asns): """ Method to update asns :param asns: List containing asns desired to updated :return: None """ data = {'asns': asns} asns_ids = [str(env.get('id')) for env in asns] return super(ApiV4As, self).put('api/v4/as/%s/' % ...
def create(self, asns): """ Method to create asns :param asns: List containing asns desired to be created on database :return: None """ data = {'asns': asns} return super(ApiV4As, self).post('api/v4/as/', data)
def find_logs( self, user_name, first_date, start_time, last_date, end_time, action, functionality, parameter, pagination): """ Search all logs, filtering by the given parameters. ...
def search(self, **kwargs): """ Method to search equipments based on extends search. :param search: Dict containing QuerySets to find equipments. :param include: Array containing fields to include on response. :param exclude: Array containing fields to exclude on response. ...
def delete(self, ids): """ Method to delete equipments by their id's :param ids: Identifiers of equipments :return: None """ url = build_uri_with_ids('api/v4/equipment/%s/', ids) return super(ApiV4Equipment, self).delete(url)
def update(self, equipments): """ Method to update equipments :param equipments: List containing equipments desired to updated :return: None """ data = {'equipments': equipments} equipments_ids = [str(env.get('id')) for env in equipments] return super(A...
def create(self, equipments): """ Method to create equipments :param equipments: List containing equipments desired to be created on database :return: None """ data = {'equipments': equipments} return super(ApiV4Equipment, self).post('api/v4/equipment/', data)
def submit(self, map, method, postfix): '''Realiza um requisição HTTP para a networkAPI. :param map: Dicionário com os dados para gerar o XML enviado no corpo da requisição HTTP. :param method: Método da requisição HTTP ('GET', 'POST', 'PUT' ou 'DELETE'). :param postfix: Posfixo a ser c...
def get_error(self, xml): '''Obtem do XML de resposta, o código e a descrição do erro. O XML corresponde ao corpo da resposta HTTP de código 500. :param xml: XML contido na resposta da requisição HTTP. :return: Tupla com o código e a descrição do erro contido no XML: (< co...