sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
def list_by_group(self, id_egroup):
"""Search Group Equipment from by the identifier.
:param id_egroup: Identifier of the Group Equipment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'equipaments':
[{'nome': < nam... | Search Group Equipment from by the identifier.
:param id_egroup: Identifier of the Group Equipment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'equipaments':
[{'nome': < name_equipament >, 'grupos': < id_group >,
... | entailment |
def get_ips_by_equipment_and_environment(self, equip_nome, id_ambiente):
"""Search Group Equipment from by the identifier.
:param id_egroup: Identifier of the Group Equipment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'equi... | Search Group Equipment from by the identifier.
:param id_egroup: Identifier of the Group Equipment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'equipaments':
[{'nome': < name_equipament >, 'grupos': < id_group >,
... | entailment |
def get(self, uri):
"""
Sends a GET request.
@param uri: Uri of Service API.
@param data: Requesting Data. Default: None
@raise NetworkAPIClientError: Client failed to access the API.
"""
request = None
try:
request = reques... | Sends a GET request.
@param uri: Uri of Service API.
@param data: Requesting Data. Default: None
@raise NetworkAPIClientError: Client failed to access the API. | entailment |
def _parse(self, content):
"""
Parse data request to data from python.
@param content: Context of request.
@raise ParseError:
"""
if content:
stream = BytesIO(str(content))
data = json.loads(stream.getvalue())
return dat... | Parse data request to data from python.
@param content: Context of request.
@raise ParseError: | entailment |
def prepare_url(self, uri, kwargs):
"""Convert dict for URL params
"""
params = dict()
for key in kwargs:
if key in ('include', 'exclude', 'fields'):
params.update({
key: ','.join(kwargs.get(key))
})
elif key in ... | Convert dict for URL params | entailment |
def insert_rack(
self,
number,
name,
mac_address_sw1,
mac_address_sw2,
mac_address_ilo,
id_sw1,
id_sw2,
id_ilo):
"""Create new Rack
:param number: Number of Rack
:return: Following diction... | Create new Rack
:param number: Number of Rack
:return: Following dictionary:
::
{'rack': {'id': < id_rack >,
'num_rack': < num_rack >,
'name_rack': < name_rack >,
'mac_sw1': < mac_sw1 >,
'mac_sw2': < mac_sw2 >,
'mac_ilo': < mac_ilo >,
... | entailment |
def remover(self, id_rack):
"""Remove Rack by the identifier.
:param id_rack: Identifier of the Rack. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Rack is null and invalid.
:raise RackNaoExisteError: Rack not registered.
... | Remove Rack by the identifier.
:param id_rack: Identifier of the Rack. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Rack is null and invalid.
:raise RackNaoExisteError: Rack not registered.
:raise RackError: Rack is associa... | entailment |
def listar(self, id_divisao=None, id_ambiente_logico=None):
"""Lista os ambientes filtrados conforme parâmetros informados.
Se os dois parâmetros têm o valor None então retorna todos os ambientes.
Se o id_divisao é diferente de None então retorna os ambientes filtrados
pelo valor de id_... | Lista os ambientes filtrados conforme parâmetros informados.
Se os dois parâmetros têm o valor None então retorna todos os ambientes.
Se o id_divisao é diferente de None então retorna os ambientes filtrados
pelo valor de id_divisao.
Se o id_divisao e id_ambiente_logico são diferentes de... | entailment |
def buscar_por_equipamento(self, nome_equipamento, ip_equipamento):
"""Obtém um ambiente a partir do ip e nome de um equipamento.
:param nome_equipamento: Nome do equipamento.
:param ip_equipamento: IP do equipamento no formato XXX.XXX.XXX.XXX.
:return: Dicionário com a seguinte estrut... | Obtém um ambiente a partir do ip e nome de um equipamento.
:param nome_equipamento: Nome do equipamento.
:param ip_equipamento: IP do equipamento no formato XXX.XXX.XXX.XXX.
:return: Dicionário com a seguinte estrutura:
::
{'ambiente': {'id': < id_ambiente >,
... | entailment |
def buscar_por_id(self, id_ambiente):
"""Obtém um ambiente a partir da chave primária (identificador).
:param id_ambiente: Identificador do ambiente.
:return: Dicionário com a seguinte estrutura:
::
{'ambiente': {'id': < id_ambiente >,
'link': < link >,
... | Obtém um ambiente a partir da chave primária (identificador).
:param id_ambiente: Identificador do ambiente.
:return: Dicionário com a seguinte estrutura:
::
{'ambiente': {'id': < id_ambiente >,
'link': < link >,
'id_divisao': < id_divisao >,
'... | entailment |
def buscar_healthcheck_por_id(self, id_healthcheck):
"""Get HealthCheck by id.
:param id_healthcheck: HealthCheck ID.
:return: Following dictionary:
::
{'healthcheck_expect': {'match_list': < match_list >,
'expect_string': < expect_string >,
'id'... | Get HealthCheck by id.
:param id_healthcheck: HealthCheck ID.
:return: Following dictionary:
::
{'healthcheck_expect': {'match_list': < match_list >,
'expect_string': < expect_string >,
'id': < id >,
'ambiente': < ambiente >}}
:rais... | entailment |
def listar_por_equip(self, equip_id):
"""Lista todos os ambientes por equipamento especifico.
:return: Dicionário com a seguinte estrutura:
::
{'ambiente': {'id': < id_ambiente >,
'link': < link >,
'id_divisao': < id_divisao >,
'nome_divisao': <... | Lista todos os ambientes por equipamento especifico.
:return: Dicionário com a seguinte estrutura:
::
{'ambiente': {'id': < id_ambiente >,
'link': < link >,
'id_divisao': < id_divisao >,
'nome_divisao': < nome_divisao >,
'id_ambiente_logico'... | entailment |
def listar_healthcheck_expect(self, id_ambiente):
"""Lista os healthcheck_expect´s de um ambiente.
:param id_ambiente: Identificador do ambiente.
:return: Dicionário com a seguinte estrutura:
::
{'healthcheck_expect': [{'id': < id_healthcheck_expect >,
'expec... | Lista os healthcheck_expect´s de um ambiente.
:param id_ambiente: Identificador do ambiente.
:return: Dicionário com a seguinte estrutura:
::
{'healthcheck_expect': [{'id': < id_healthcheck_expect >,
'expect_string': < expect_string >,
'match_list': < ma... | entailment |
def add_healthcheck_expect(self, id_ambiente, expect_string, match_list):
"""Insere um novo healthckeck_expect e retorna o seu identificador.
:param expect_string: expect_string.
:param id_ambiente: Identificador do ambiente lógico.
:param match_list: match list.
:return: Dicio... | Insere um novo healthckeck_expect e retorna o seu identificador.
:param expect_string: expect_string.
:param id_ambiente: Identificador do ambiente lógico.
:param match_list: match list.
:return: Dicionário com a seguinte estrutura: {'healthcheck_expect': {'id': < id >}}
:rais... | entailment |
def inserir(
self,
id_grupo_l3,
id_ambiente_logico,
id_divisao,
link,
id_filter=None,
acl_path=None,
ipv4_template=None,
ipv6_template=None,
min_num_vlan_1=None,
max_num_vlan_1=None,
... | Insere um novo ambiente e retorna o seu identificador.
:param id_grupo_l3: Identificador do grupo layer 3.
:param id_ambiente_logico: Identificador do ambiente lógico.
:param id_divisao: Identificador da divisão data center.
:param id_filter: Filter identifier.
:param link: Link... | entailment |
def insert_with_ip_range(
self,
id_l3_group,
id_logical_environment,
id_division,
id_ip_config,
link,
id_filter=None):
"""Insert new environment with ip config and returns your id.
:param id_l3_group: Layer 3 Group ID.
... | Insert new environment with ip config and returns your id.
:param id_l3_group: Layer 3 Group ID.
:param id_logical_environment: Logical Environment ID.
:param id_division: Data Center Division ID.
:param id_filter: Filter identifier.
:param id_ip_config: IP Configuration ID.
... | entailment |
def add_ip_range(self, id_environment, id_ip_config):
"""Makes relationship of environment with ip config and returns your id.
:param id_environment: Environment ID.
:param id_ip_config: IP Configuration ID.
:return: Following dictionary:
{'config_do_ambiente': {'id_config_do_... | Makes relationship of environment with ip config and returns your id.
:param id_environment: Environment ID.
:param id_ip_config: IP Configuration ID.
:return: Following dictionary:
{'config_do_ambiente': {'id_config_do_ambiente': < id_config_do_ambiente >}}
:raise InvalidPar... | entailment |
def alterar(
self,
id_ambiente,
id_grupo_l3,
id_ambiente_logico,
id_divisao,
link,
id_filter=None,
acl_path=None,
ipv4_template=None,
ipv6_template=None,
min_num_vlan_1=None,
m... | Altera os dados de um ambiente a partir do seu identificador.
:param id_ambiente: Identificador do ambiente.
:param id_grupo_l3: Identificador do grupo layer 3.
:param id_ambiente_logico: Identificador do ambiente lógico.
:param id_divisao: Identificador da divisão data center.
... | entailment |
def add_expect_string_healthcheck(self, expect_string):
"""Inserts a new healthckeck_expect with only expect_string.
:param expect_string: expect_string.
:return: Dictionary with the following structure:
::
{'healthcheck_expect': {'id': < id >}}
:raise InvalidPa... | Inserts a new healthckeck_expect with only expect_string.
:param expect_string: expect_string.
:return: Dictionary with the following structure:
::
{'healthcheck_expect': {'id': < id >}}
:raise InvalidParameterError: The value of expect_string is invalid.
:raise... | entailment |
def listar_healtchcheck_expect_distinct(self):
"""Get all expect_string.
:return: Dictionary with the following structure:
::
{'healthcheck_expect': [
'expect_string': < expect_string >,
... demais healthcheck_expects ...]}
:raise InvalidParamet... | Get all expect_string.
:return: Dictionary with the following structure:
::
{'healthcheck_expect': [
'expect_string': < expect_string >,
... demais healthcheck_expects ...]}
:raise InvalidParameterError: Identifier is null and invalid.
:raise Da... | entailment |
def list_acl_path(self):
"""Get all distinct acl paths.
:return: Dictionary with the following structure:
::
{'acl_paths': [
< acl_path >,
... ]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkap... | Get all distinct acl paths.
:return: Dictionary with the following structure:
::
{'acl_paths': [
< acl_path >,
... ]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML respons... | entailment |
def set_template(self, id_environment, name, network):
"""Set template value. If id_environment = 0, set '' to all environments related with the template name.
:param id_environment: Environment Identifier.
:param name: Template Name.
:param network: IPv4 or IPv6.
:return: None... | Set template value. If id_environment = 0, set '' to all environments related with the template name.
:param id_environment: Environment Identifier.
:param name: Template Name.
:param network: IPv4 or IPv6.
:return: None
:raise InvalidParameterError: Invalid param.
:ra... | entailment |
def get_environment_template(self, name, network):
"""Get environments by template name
:param name: Template name.
:param network: IPv4 or IPv6.
:return: Following dictionary:
::
{'ambiente': [divisao_dc - ambiente_logico - grupo_l3, other envs...] }
:ra... | Get environments by template name
:param name: Template name.
:param network: IPv4 or IPv6.
:return: Following dictionary:
::
{'ambiente': [divisao_dc - ambiente_logico - grupo_l3, other envs...] }
:raise InvalidParameterError: Invalid param.
:raise DataB... | entailment |
def save_blocks(self, id_env, blocks):
"""
Save blocks from environment
:param id_env: Environment id
:param blocks: Lists of blocks in order. Ex: ['content one', 'content two', ...]
:return: None
:raise AmbienteNaoExisteError: Ambiente não cadastrado.
:raise I... | Save blocks from environment
:param id_env: Environment id
:param blocks: Lists of blocks in order. Ex: ['content one', 'content two', ...]
:return: None
:raise AmbienteNaoExisteError: Ambiente não cadastrado.
:raise InvalidValueError: Invalid parameter.
:raise UserNot... | entailment |
def get_rule_by_pk(self, id_rule):
"""
Get a rule by its identifier
:param id_rule: Rule identifier.
:return: Seguinte estrutura
::
{ 'rule': {'id': < id >,
'environment': < Environment Object >,
'content': < content >,
'n... | Get a rule by its identifier
:param id_rule: Rule identifier.
:return: Seguinte estrutura
::
{ 'rule': {'id': < id >,
'environment': < Environment Object >,
'content': < content >,
'name': < name >,
'custom': < custom > }}
... | entailment |
def save_rule(self, name, id_env, contents, blocks_id):
"""
Save an environment rule
:param name: Name of the rule
:param id_env: Environment id
:param contents: Lists of contents in order. Ex: ['content one', 'content two', ...]
:param blocks_id: Lists of blocks id or 0... | Save an environment rule
:param name: Name of the rule
:param id_env: Environment id
:param contents: Lists of contents in order. Ex: ['content one', 'content two', ...]
:param blocks_id: Lists of blocks id or 0 if is as custom content. Ex: ['0', '5', '0' ...]
:return: None
... | entailment |
def update_rule(self, name, id_env, contents, blocks_id, id_rule):
"""
Save an environment rule
:param name: Name of the rule
:param id_env: Environment id
:param contents: Lists of contents in order. Ex: ['content one', 'content two', ...]
:param blocks_id: Lists of blo... | Save an environment rule
:param name: Name of the rule
:param id_env: Environment id
:param contents: Lists of contents in order. Ex: ['content one', 'content two', ...]
:param blocks_id: Lists of blocks id or 0 if is as custom content. Ex: ['0', '5', '0' ...]
:param id_rule: Ru... | entailment |
def get_all_rules(self, id_env):
"""Save an environment rule
:param id_env: Environment id
:return: Estrutura:
::
{ 'rules': [{'id': < id >,
'environment': < Environment Object >,
'content': < content >,
'name': < name >,
'c... | Save an environment rule
:param id_env: Environment id
:return: Estrutura:
::
{ 'rules': [{'id': < id >,
'environment': < Environment Object >,
'content': < content >,
'name': < name >,
'custom': < custom > },... ]}
:raise ... | entailment |
def configuration_save(
self,
id_environment,
network,
prefix,
ip_version,
network_type):
"""
Add new prefix configuration
:param id_environment: Identifier of the Environment. Integer value and greater than zero.
:... | Add new prefix configuration
:param id_environment: Identifier of the Environment. Integer value and greater than zero.
:param network: Network Ipv4 or Ipv6.
:param prefix: Prefix 0-32 to Ipv4 or 0-128 to Ipv6.
:param ip_version: v4 to IPv4 or v6 to IPv6
:param network_type: typ... | entailment |
def configuration_list_all(self, environment_id):
"""
List all prefix configurations by environment in DB
:return: Following dictionary:
::
{'lists_configuration': [{
'id': <id_ipconfig>,
'subnet': <subnet>,
'type': <type>,
'... | List all prefix configurations by environment in DB
:return: Following dictionary:
::
{'lists_configuration': [{
'id': <id_ipconfig>,
'subnet': <subnet>,
'type': <type>,
'new_prefix': <new_prefix>,
}, ... ]}
:raise Inva... | entailment |
def configuration_remove(self, environment_id, configuration_id):
"""
Remove Prefix Configuration
:return: None
:raise InvalidValueError: Invalid Id for Environment or IpConfig.
:raise IPConfigNotFoundError: Ipconfig not resgistred.
:raise AmbienteNotFoundError: Environ... | Remove Prefix Configuration
:return: None
:raise InvalidValueError: Invalid Id for Environment or IpConfig.
:raise IPConfigNotFoundError: Ipconfig not resgistred.
:raise AmbienteNotFoundError: Environment not registered.
:raise DataBaseError: Failed into networkapi access data ... | entailment |
def associate(self, environment_id, environment_vip_id):
"""Associate a news Environment on Environment VIP and returns its identifier.
:param environment_id: Identifier of the Environment. Integer value and greater than zero.
:param environment_vip_id: Identifier of the Environment VIP. Integ... | Associate a news Environment on Environment VIP and returns its identifier.
:param environment_id: Identifier of the Environment. Integer value and greater than zero.
:param environment_vip_id: Identifier of the Environment VIP. Integer value and greater than zero.
:return: Following dictionar... | entailment |
def get_related_environment_list(self, environment_vip_id):
"""Get all Environment by Environment Vip.
:return: Following dictionary:
::
{'ambiente': [{ 'id': <id_environment>,
'grupo_l3': <id_group_l3>,
'grupo_l3_name': <name_group_l3>,
'ambien... | Get all Environment by Environment Vip.
:return: Following dictionary:
::
{'ambiente': [{ 'id': <id_environment>,
'grupo_l3': <id_group_l3>,
'grupo_l3_name': <name_group_l3>,
'ambiente_logico': <id_logical_environment>,
'ambiente_logico_name... | entailment |
def get_equipment(self, **kwargs):
"""
Return list environments related with environment vip
"""
uri = 'api/v3/equipment/'
uri = self.prepare_url(uri, kwargs)
return super(ApiEquipment, self).get(uri) | Return list environments related with environment vip | entailment |
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.
... | 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.
:param fields: Array containing fields to ov... | entailment |
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/v3/equipment/%s/', ids)
return super(ApiEquipment, self).delete(url) | Method to delete equipments by their id's
:param ids: Identifiers of equipments
:return: None | entailment |
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(ApiEquipment, self).post('api/v3/equipment/', data) | Method to create equipments
:param equipments: List containing equipments desired to be created on database
:return: None | entailment |
def delete(self, ids):
"""
Method to undeploy pool's by their ids
:param ids: Identifiers of deployed pool's
:return: Empty Dict
"""
url = build_uri_with_ids('api/v3/pool/deploy/%s/', ids)
return super(ApiPoolDeploy, self).delete(url) | Method to undeploy pool's by their ids
:param ids: Identifiers of deployed pool's
:return: Empty Dict | entailment |
def create(self, ids):
"""
Method to deploy pool's
:param pools: Identifiers of pool's desired to be deployed
:return: Empty Dict
"""
url = build_uri_with_ids('api/v3/pool/deploy/%s/', ids)
return super(ApiPoolDeploy, self).post(url) | Method to deploy pool's
:param pools: Identifiers of pool's desired to be deployed
:return: Empty Dict | entailment |
def edit_reals(
self,
id_vip,
method_bal,
reals,
reals_prioritys,
reals_weights,
alter_priority=0):
"""Execute the script 'gerador_vips' several times with options -real, -add and -del to adjust vip request reals.
:param... | Execute the script 'gerador_vips' several times with options -real, -add and -del to adjust vip request reals.
:param id_vip: Identifier of the VIP. Integer value and greater than zero.
:param method_bal: method_bal.
:param reals: List of reals. Ex: [{'real_name':'Teste1', 'real_ip':'10.10.10.1'... | entailment |
def inserir(self, name):
"""Inserts a new Brand and returns its identifier
:param name: Brand name. String with a minimum 3 and maximum of 100 characters
:return: Dictionary with the following structure:
::
{'marca': {'id': < id_brand >}}
:raise InvalidParameterE... | Inserts a new Brand and returns its identifier
:param name: Brand name. String with a minimum 3 and maximum of 100 characters
:return: Dictionary with the following structure:
::
{'marca': {'id': < id_brand >}}
:raise InvalidParameterError: Name is null and invalid.
... | entailment |
def alterar(self, id_brand, name):
"""Change Brand from by the identifier.
:param id_brand: Identifier of the Brand. Integer value and greater than zero.
:param name: Brand name. String with a minimum 3 and maximum of 100 characters
:return: None
:raise InvalidParameterError: ... | Change Brand from by the identifier.
:param id_brand: Identifier of the Brand. Integer value and greater than zero.
:param name: Brand name. String with a minimum 3 and maximum of 100 characters
:return: None
:raise InvalidParameterError: The identifier of Brand or name is null and in... | entailment |
def remover(self, id_brand):
"""Remove Brand from by the identifier.
:param id_brand: Identifier of the Brand. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Brand is null and invalid.
:raise MarcaNaoExisteError: Brand not re... | Remove Brand from by the identifier.
:param id_brand: Identifier of the Brand. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Brand is null and invalid.
:raise MarcaNaoExisteError: Brand not registered.
:raise MarcaError: The... | entailment |
def acl_remove_draft(self, id_vlan, type_acl):
"""
Remove Acl draft by type
:param id_vlan: Identity of Vlan
:param type_acl: Acl type v4 or v6
:return: None
:raise VlanDoesNotExistException: Vlan Does Not Exist.
:raise InvalidIdVlanExce... | Remove Acl draft by type
:param id_vlan: Identity of Vlan
:param type_acl: Acl type v4 or v6
:return: None
:raise VlanDoesNotExistException: Vlan Does Not Exist.
:raise InvalidIdVlanException: Invalid id for Vlan.
:raise NetworkAPIException: Fai... | entailment |
def acl_save_draft(self, id_vlan, type_acl, content_draft):
"""
Save Acl draft by type
:param id_vlan: Identity of Vlan
:param type_acl: Acl type v4 or v6
:return: None
:raise VlanDoesNotExistException: Vlan Does Not Exist.
:raise Invali... | Save Acl draft by type
:param id_vlan: Identity of Vlan
:param type_acl: Acl type v4 or v6
:return: None
:raise VlanDoesNotExistException: Vlan Does Not Exist.
:raise InvalidIdVlanException: Invalid id for Vlan.
:raise NetworkAPIException: Faile... | entailment |
def search(self, **kwargs):
"""
Method to search vlan's based on extends search.
:param search: Dict containing QuerySets to find vlan's.
:param include: Array containing fields to include on response.
:param exclude: Array containing fields to exclude on response.
:para... | Method to search vlan's based on extends search.
:param search: Dict containing QuerySets to find vlan's.
:param include: Array containing fields to include on response.
:param exclude: Array containing fields to exclude on response.
:param fields: Array containing fields to override d... | entailment |
def delete(self, ids):
"""
Method to delete vlan's by their ids
:param ids: Identifiers of vlan's
:return: None
"""
url = build_uri_with_ids('api/v3/vlan/%s/', ids)
return super(ApiVlan, self).delete(url) | Method to delete vlan's by their ids
:param ids: Identifiers of vlan's
:return: None | entailment |
def update(self, vlans):
"""
Method to update vlan's
:param vlans: List containing vlan's desired to updated
:return: None
"""
data = {'vlans': vlans}
vlans_ids = [str(vlan.get('id')) for vlan in vlans]
return super(ApiVlan, self).put('api/v3/vlan/%s/' ... | Method to update vlan's
:param vlans: List containing vlan's desired to updated
:return: None | entailment |
def create(self, vlans):
"""
Method to create vlan's
:param vlans: List containing vlan's desired to be created on database
:return: None
"""
data = {'vlans': vlans}
return super(ApiVlan, self).post('api/v3/vlan/', data) | Method to create vlan's
:param vlans: List containing vlan's desired to be created on database
:return: None | entailment |
def is_valid_int_param(param):
"""Verifica se o parâmetro é um valor inteiro válido.
:param param: Valor para ser validado.
:return: True se o parâmetro tem um valor inteiro válido, ou False, caso contrário.
"""
if param is None:
return False
try:
param = int(param)
if ... | Verifica se o parâmetro é um valor inteiro válido.
:param param: Valor para ser validado.
:return: True se o parâmetro tem um valor inteiro válido, ou False, caso contrário. | entailment |
def is_valid_ip(address):
"""Verifica se address é um endereço ip válido.
O valor é considerado válido se tiver no formato XXX.XXX.XXX.XXX, onde X é um valor entre 0 e 9.
:param address: Endereço IP.
:return: True se o parâmetro é um IP válido, ou False, caso contrário.
"""
if address is None... | Verifica se address é um endereço ip válido.
O valor é considerado válido se tiver no formato XXX.XXX.XXX.XXX, onde X é um valor entre 0 e 9.
:param address: Endereço IP.
:return: True se o parâmetro é um IP válido, ou False, caso contrário. | entailment |
def is_valid_version_ip(param):
"""Checks if the parameter is a valid ip version value.
:param param: Value to be validated.
:return: True if the parameter has a valid ip version value, or False otherwise.
"""
if param is None:
return False
if param == IP_VERSION.IPv4[0] or param == I... | Checks if the parameter is a valid ip version value.
:param param: Value to be validated.
:return: True if the parameter has a valid ip version value, or False otherwise. | entailment |
def option_vip_by_environmentvip(self, environment_vip_id):
"""
List Option Vip by Environment Vip
param environment_vip_id: Id of Environment Vip
"""
uri = 'api/v3/option-vip/environment-vip/%s/' % environment_vip_id
return super(ApiVipRequest, self).get(uri) | List Option Vip by Environment Vip
param environment_vip_id: Id of Environment Vip | entailment |
def get_vip_request_details(self, vip_request_id):
"""
Method to get details of vip request
param vip_request_id: vip_request id
"""
uri = 'api/v3/vip-request/details/%s/' % vip_request_id
return super(ApiVipRequest, self).get(uri) | Method to get details of vip request
param vip_request_id: vip_request id | entailment |
def get_vip_request(self, vip_request_id):
"""
Method to get vip request
param vip_request_id: vip_request id
"""
uri = 'api/v3/vip-request/%s/' % vip_request_id
return super(ApiVipRequest, self).get(uri) | Method to get vip request
param vip_request_id: vip_request id | entailment |
def search_vip_request(self, search):
"""
Method to list vip request
param search: search
"""
uri = 'api/v3/vip-request/?%s' % urllib.urlencode({'search': search})
return super(ApiVipRequest, self).get(uri) | Method to list vip request
param search: search | entailment |
def save_vip_request(self, vip_request):
"""
Method to save vip request
param vip_request: vip_request object
"""
uri = 'api/v3/vip-request/'
data = dict()
data['vips'] = list()
data['vips'].append(vip_request)
return super(ApiVipRequest, self).... | Method to save vip request
param vip_request: vip_request object | entailment |
def update_vip_request(self, vip_request, vip_request_id):
"""
Method to update vip request
param vip_request: vip_request object
param vip_request_id: vip_request id
"""
uri = 'api/v3/vip-request/%s/' % vip_request_id
data = dict()
data['vips'] = list()... | Method to update vip request
param vip_request: vip_request object
param vip_request_id: vip_request id | entailment |
def delete_vip_request(self, vip_request_ids):
"""
Method to delete vip request
param vip_request_ids: vip_request ids
"""
uri = 'api/v3/vip-request/%s/' % vip_request_ids
return super(ApiVipRequest, self).delete(uri) | Method to delete vip request
param vip_request_ids: vip_request ids | entailment |
def create_vip(self, vip_request_ids):
"""
Method to create vip request
param vip_request_ids: vip_request ids
"""
uri = 'api/v3/vip-request/deploy/%s/' % vip_request_ids
return super(ApiVipRequest, self).post(uri) | Method to create vip request
param vip_request_ids: vip_request ids | entailment |
def remove_vip(self, vip_request_ids):
"""
Method to delete vip request
param vip_request_ids: vip_request ids
"""
uri = 'api/v3/vip-request/deploy/%s/' % vip_request_ids
return super(ApiVipRequest, self).delete(uri) | Method to delete vip request
param vip_request_ids: vip_request ids | entailment |
def search(self, **kwargs):
"""
Method to search vip's based on extends search.
:param search: Dict containing QuerySets to find vip's.
:param include: Array containing fields to include on response.
:param exclude: Array containing fields to exclude on response.
:param ... | Method to search vip's based on extends search.
:param search: Dict containing QuerySets to find vip's.
:param include: Array containing fields to include on response.
:param exclude: Array containing fields to exclude on response.
:param fields: Array containing fields to override def... | entailment |
def delete(self, ids):
"""
Method to delete vip's by their id's
:param ids: Identifiers of vip's
:return: None
"""
url = build_uri_with_ids('api/v3/vip-request/%s/', ids)
return super(ApiVipRequest, self).delete(url) | Method to delete vip's by their id's
:param ids: Identifiers of vip's
:return: None | entailment |
def update(self, vips):
"""
Method to update vip's
:param vips: List containing vip's desired to updated
:return: None
"""
data = {'vips': vips}
vips_ids = [str(vip.get('id')) for vip in vips]
return super(ApiVipRequest, self).put('api/v3/vip-request/%s... | Method to update vip's
:param vips: List containing vip's desired to updated
:return: None | entailment |
def create(self, vips):
"""
Method to create vip's
:param vips: List containing vip's desired to be created on database
:return: None
"""
data = {'vips': vips}
return super(ApiVipRequest, self).post('api/v3/vip-request/', data) | Method to create vip's
:param vips: List containing vip's desired to be created on database
:return: None | entailment |
def deploy(self, ids):
"""
Method to deploy vip's
:param vips: List containing vip's desired to be deployed on equipment
:return: None
"""
url = build_uri_with_ids('api/v3/vip-request/deploy/%s/', ids)
return super(ApiVipRequest, self).post(url) | Method to deploy vip's
:param vips: List containing vip's desired to be deployed on equipment
:return: None | entailment |
def undeploy(self, ids, clean_up=0):
"""
Method to undeploy vip's
:param vips: List containing vip's desired to be undeployed on equipment
:return: None
"""
url = build_uri_with_ids('api/v3/vip-request/deploy/%s/?cleanup=%s', ids, clean_up)
return super(ApiVipRe... | Method to undeploy vip's
:param vips: List containing vip's desired to be undeployed on equipment
:return: None | entailment |
def add(self, tipo_opcao, nome_opcao):
"""Inserts a new Option Pool and returns its identifier.
:param tipo_opcao: Type. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param nome_opcao_txt: Name Option. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:re... | Inserts a new Option Pool and returns its identifier.
:param tipo_opcao: Type. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param nome_opcao_txt: Name Option. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
... | entailment |
def modify(self, id_option_pool, tipo_opcao, nome_opcao):
"""Change Option Pool from by id.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param tipo_opcao: Type. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param nome_opca... | Change Option Pool from by id.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param tipo_opcao: Type. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param nome_opcao_txt: Name Option. String with a maximum of 50 characters and respec... | entailment |
def remove(self, id_option_pool):
"""Remove Option pool by identifier and all Environment related .
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Option Pool identifier is null and invalid.
... | Remove Option pool by identifier and all Environment related .
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Option Pool identifier is null and invalid.
:raise optionpoolNotFoundError: Option Po... | entailment |
def get_option_pool(self, id_option_pool):
"""Search Option Pool by id.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:return: Following dictionary:
::
{‘id’: < id_option_pool >,
‘type’: < tipo_opcao >,
... | Search Option Pool by id.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:return: Following dictionary:
::
{‘id’: < id_option_pool >,
‘type’: < tipo_opcao >,
‘name’: < nome_opcao_txt >}
:raise InvalidPar... | entailment |
def get_all_option_pool(self, option_type=None):
"""Get all Option Pool.
:return: Dictionary with the following structure:
::
{[{‘id’: < id >,
‘type’: < tipo_opcao >,
‘name’: < nome_opcao_txt >}, ... other option pool ...] }
:raise optionpoolNotFou... | Get all Option Pool.
:return: Dictionary with the following structure:
::
{[{‘id’: < id >,
‘type’: < tipo_opcao >,
‘name’: < nome_opcao_txt >}, ... other option pool ...] }
:raise optionpoolNotFoundError: Option Pool not registered.
:raise DataBase... | entailment |
def get_all_environment_option_pool(self, id_environment=None, option_id=None, option_type=None):
"""Get all Option VIP by Environment .
:return: Dictionary with the following structure:
::
{[{‘id’: < id >,
option: {
'id': <id>
... | Get all Option VIP by Environment .
:return: Dictionary with the following structure:
::
{[{‘id’: < id >,
option: {
'id': <id>
'type':<type>
'name':<name> }
environment: {
'id':... | entailment |
def associate_environment_option_pool(self, id_option_pool, id_environment):
"""Create a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environment . Integer value a... | Create a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environment . Integer value and greater than zero.
:return: Dictionary with the following structure:
... | entailment |
def disassociate_environment_option_pool(self, environment_option_id):
"""Remove a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environment Pool. Integer value and... | Remove a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environment Pool. Integer value and greater than zero.
:return: { 'id': < environment_option_id> }
... | entailment |
def modify_environment_option_pool(self, environment_option_id, id_option_pool,id_environment ):
"""Remove a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environme... | Remove a relationship of optionpool with Environment.
:param id_option_pool: Identifier of the Option Pool. Integer value and greater than zero.
:param id_environment: Identifier of the Environment Pool. Integer value and greater than zero.
:return: Dictionary with the following struct... | entailment |
def add(self, name, description):
"""Inserts a new Filter and returns its identifier.
:param name: Name. String with a maximum of 100 characters and respect [a-zA-Z\_-]
:param description: Description. String with a maximum of 200 characters and respect [a-zA-Z\_-]
:return: Following d... | Inserts a new Filter and returns its identifier.
:param name: Name. String with a maximum of 100 characters and respect [a-zA-Z\_-]
:param description: Description. String with a maximum of 200 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
{'filter'... | entailment |
def alter(self, id_filter, name, description):
"""Change Filter by the identifier.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:param name: Name. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param description: Description. String w... | Change Filter by the identifier.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:param name: Name. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param description: Description. String with a maximum of 50 characters and respect [a-zA-Z\_-]
... | entailment |
def remove(self, id_filter):
"""Remove Filter by the identifier.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Filter identifier is null and invalid.
:raise FilterNotFoundError: Filter not registere... | Remove Filter by the identifier.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Filter identifier is null and invalid.
:raise FilterNotFoundError: Filter not registered.
:raise DataBaseError: Network... | entailment |
def get(self, id_filter):
"""Get filter by id.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:return: Following dictionary:
::
{‘filter’: {‘id’: < id >,
‘name’: < name >,
‘description’: < description >}}
... | Get filter by id.
:param id_filter: Identifier of the Filter. Integer value and greater than zero.
:return: Following dictionary:
::
{‘filter’: {‘id’: < id >,
‘name’: < name >,
‘description’: < description >}}
:raise InvalidParameterError: The val... | entailment |
def associate(self, et_id, id_filter):
"""Create a relationship between Filter and TipoEquipamento.
:param et_id: Identifier of TipoEquipamento. Integer value and greater than zero.
:param id_filter: Identifier of Filter. Integer value and greater than zero.
:return: Following dictiona... | Create a relationship between Filter and TipoEquipamento.
:param et_id: Identifier of TipoEquipamento. Integer value and greater than zero.
:param id_filter: Identifier of Filter. Integer value and greater than zero.
:return: Following dictionary:
::
{'equiptype_filter_xr... | entailment |
def dissociate(self, id_filter, id_eq_type):
"""Removes relationship between Filter and TipoEquipamento.
:param id_filter: Identifier of Filter. Integer value and greater than zero.
:param id_eq_type: Identifier of TipoEquipamento. Integer value, greater than zero.
:return: None
... | Removes relationship between Filter and TipoEquipamento.
:param id_filter: Identifier of Filter. Integer value and greater than zero.
:param id_eq_type: Identifier of TipoEquipamento. Integer value, greater than zero.
:return: None
:raise FilterNotFoundError: Filter not registered.
... | entailment |
def search(self, id_egroup):
"""Search Group Equipament from by the identifier.
:param id_egroup: Identifier of the Group Equipament. Integer value and greater than zero.
:return: Following dictionary:
::
{‘group_equipament’: {‘id’: < id_egrupo >,
‘nome’: < n... | Search Group Equipament from by the identifier.
:param id_egroup: Identifier of the Group Equipament. Integer value and greater than zero.
:return: Following dictionary:
::
{‘group_equipament’: {‘id’: < id_egrupo >,
‘nome’: < nome >} }
:raise InvalidParamete... | entailment |
def inserir(self, nome):
"""Insere um novo grupo de equipamento e retorna o seu identificador.
:param nome: Nome do grupo de equipamento.
:return: Dicionário com a seguinte estrutura: {'grupo': {'id': < id >}}
:raise InvalidParameterError: Nome do grupo é nulo ou vazio.
:raise... | Insere um novo grupo de equipamento e retorna o seu identificador.
:param nome: Nome do grupo de equipamento.
:return: Dicionário com a seguinte estrutura: {'grupo': {'id': < id >}}
:raise InvalidParameterError: Nome do grupo é nulo ou vazio.
:raise NomeGrupoEquipamentoDuplicadoError:... | entailment |
def alterar(self, id_egrupo, nome):
"""Altera os dados de um grupo de equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:param nome: Nome do grupo de equipamento.
:return: None
:raise InvalidParameterError: O identificador e/ou... | Altera os dados de um grupo de equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:param nome: Nome do grupo de equipamento.
:return: None
:raise InvalidParameterError: O identificador e/ou o nome do grupo são nulos ou inválidos.
... | entailment |
def remover(self, id_egrupo):
"""Remove um grupo de equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:return: None
:raise GrupoEquipamentoNaoExisteError: Grupo de equipamento não cadastrado.
:raise InvalidParameterError: O ide... | Remove um grupo de equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:return: None
:raise GrupoEquipamentoNaoExisteError: Grupo de equipamento não cadastrado.
:raise InvalidParameterError: O identificador do grupo é nulo ou inválido.
... | entailment |
def associa_equipamento(self, id_equip, id_grupo_equipamento):
"""Associa um equipamento a um grupo.
:param id_equip: Identificador do equipamento.
:param id_grupo_equipamento: Identificador do grupo de equipamento.
:return: Dicionário com a seguinte estrutura:
{'equipament... | Associa um equipamento a um grupo.
:param id_equip: Identificador do equipamento.
:param id_grupo_equipamento: Identificador do grupo de equipamento.
:return: Dicionário com a seguinte estrutura:
{'equipamento_grupo':{'id': < id_equip_do_grupo >}}
:raise GrupoEquipamentoNa... | entailment |
def remove(self, id_equipamento, id_egrupo):
"""Remove a associacao de um grupo de equipamento com um equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:param id_equipamento: Identificador do equipamento.
:return: None
:raise E... | Remove a associacao de um grupo de equipamento com um equipamento a partir do seu identificador.
:param id_egrupo: Identificador do grupo de equipamento.
:param id_equipamento: Identificador do equipamento.
:return: None
:raise EquipamentoNaoExisteError: Equipamento não cadastrado.
... | entailment |
def inserir(self, name):
"""Inserts a new Logical Environment and returns its identifier.
:param name: Logical Environment name. String with a minimum 2 and maximum of 80 characters
:return: Dictionary with the following structure:
::
{'logical_environment': {'id': < id_l... | Inserts a new Logical Environment and returns its identifier.
:param name: Logical Environment name. String with a minimum 2 and maximum of 80 characters
:return: Dictionary with the following structure:
::
{'logical_environment': {'id': < id_logical_environment >}}
:rai... | entailment |
def alterar(self, id_logicalenvironment, name):
"""Change Logical Environment from by the identifier.
:param id_logicalenvironment: Identifier of the Logical Environment. Integer value and greater than zero.
:param name: Logical Environment name. String with a minimum 2 and maximum of 80 charac... | Change Logical Environment from by the identifier.
:param id_logicalenvironment: Identifier of the Logical Environment. Integer value and greater than zero.
:param name: Logical Environment name. String with a minimum 2 and maximum of 80 characters
:return: None
:raise InvalidParamete... | entailment |
def remover(self, id_logicalenvironment):
"""Remove Logical Environment from by the identifier.
:param id_logicalenvironment: Identifier of the Logical Environment. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Logical Environment i... | Remove Logical Environment from by the identifier.
:param id_logicalenvironment: Identifier of the Logical Environment. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Logical Environment is null and invalid.
:raise AmbienteLogicoNaoE... | entailment |
def handle(cls, code, description):
'''Recebe o código e a descrição do erro da networkAPI e lança a exceção correspondente.
:param code: Código de erro retornado pela networkAPI.
:param description: Descrição do erro.
:return: None
'''
if code is None:
rais... | Recebe o código e a descrição do erro da networkAPI e lança a exceção correspondente.
:param code: Código de erro retornado pela networkAPI.
:param description: Descrição do erro.
:return: None | entailment |
def list_by_group(self, id_ugroup):
"""Search Administrative Permission by Group User by identifier.
:param id_ugroup: Identifier of the Group User. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'perms': [{'ugrupo': < ugrupo_id... | Search Administrative Permission by Group User by identifier.
:param id_ugroup: Identifier of the Group User. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'perms': [{'ugrupo': < ugrupo_id >, 'permission': { 'function' < function >, '... | entailment |
def search(self, id_perm):
"""Search Administrative Permission from by the identifier.
:param id_perm: Identifier of the Administrative Permission. Integer value and greater than zero.
:return: Following dictionary:
::
{'perm': {'ugrupo': < ugrupo_id >,
'permi... | Search Administrative Permission from by the identifier.
:param id_perm: Identifier of the Administrative Permission. Integer value and greater than zero.
:return: Following dictionary:
::
{'perm': {'ugrupo': < ugrupo_id >,
'permission': < permission_id >, 'id': < id ... | entailment |
def inserir(self, id_permission, read, write, id_group):
"""Inserts a new Administrative Permission and returns its identifier.
:param id_permission: Identifier of the Permission. Integer value and greater than zero.
:param read: Read. 0 or 1
:param write: Write. 0 or 1
:param i... | Inserts a new Administrative Permission and returns its identifier.
:param id_permission: Identifier of the Permission. Integer value and greater than zero.
:param read: Read. 0 or 1
:param write: Write. 0 or 1
:param id_group: Identifier of the Group of User. Integer value and greater ... | entailment |
def alterar(self, id_perm, id_permission, read, write, id_group):
"""Change Administrative Permission from by the identifier.
:param id_perm: Identifier of the Administrative Permission. Integer value and greater than zero.
:param id_permission: Identifier of the Permission. Integer value and g... | Change Administrative Permission from by the identifier.
:param id_perm: Identifier of the Administrative Permission. Integer value and greater than zero.
:param id_permission: Identifier of the Permission. Integer value and greater than zero.
:param read: Read. 0 or 1
:param write: Wri... | entailment |
def remover(self, id_perms):
"""Remove Administrative Permission from by the identifier.
:param id_perms: Identifier of the Administrative Permission. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Administrative Permission is null a... | Remove Administrative Permission from by the identifier.
:param id_perms: Identifier of the Administrative Permission. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: The identifier of Administrative Permission is null and invalid.
:raise PermissaoAdmi... | entailment |
def create_ambiente(self):
"""Get an instance of ambiente services facade."""
return Ambiente(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of ambiente services facade. | entailment |
def create_ambiente_logico(self):
"""Get an instance of ambiente_logico services facade."""
return AmbienteLogico(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of ambiente_logico services facade. | entailment |
def create_api_environment_vip(self):
"""Get an instance of Api Environment Vip services facade."""
return ApiEnvironmentVip(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Environment Vip services facade. | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.