sentence1
stringlengths 52
3.87M
| sentence2
stringlengths 1
47.2k
| label
stringclasses 1
value |
---|---|---|
def create_api_environment(self):
"""Get an instance of Api Environment services facade."""
return ApiEnvironment(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Environment services facade. | entailment |
def create_api_equipment(self):
"""Get an instance of Api Equipment services facade."""
return ApiEquipment(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Equipment services facade. | entailment |
def create_api_v4_equipment(self):
"""Get an instance of Api Equipment services facade."""
return ApiV4Equipment(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Equipment services facade. | entailment |
def create_api_v4_as(self):
"""Get an instance of Api As services facade."""
return ApiV4As(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api As services facade. | entailment |
def create_api_v4_virtual_interface(self):
"""Get an instance of Api Virtual Interface services facade."""
return ApiV4VirtualInterface(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Virtual Interface services facade. | entailment |
def create_api_v4_neighbor(self):
"""Get an instance of Api Neighbor services facade."""
return ApiV4Neighbor(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Neighbor services facade. | entailment |
def create_api_interface_request(self):
"""Get an instance of Api Vip Requests services facade."""
return ApiInterfaceRequest(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vip Requests services facade. | entailment |
def create_api_ipv4(self):
"""Get an instance of Api IPv4 services facade."""
return ApiIPv4(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api IPv4 services facade. | entailment |
def create_api_ipv6(self):
"""Get an instance of Api IPv6 services facade."""
return ApiIPv6(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api IPv6 services facade. | entailment |
def create_api_v4_ipv4(self):
"""Get an instance of Api V4 IPv4 services facade."""
return ApiV4IPv4(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api V4 IPv4 services facade. | entailment |
def create_api_v4_ipv6(self):
"""Get an instance of Api V4 IPv6 services facade."""
return ApiV4IPv6(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api V4 IPv6 services facade. | entailment |
def create_api_network_ipv4(self):
"""Get an instance of Api Networkv4 services facade."""
return ApiNetworkIPv4(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Networkv4 services facade. | entailment |
def create_api_network_ipv6(self):
"""Get an instance of Api Networkv6 services facade."""
return ApiNetworkIPv6(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Networkv6 services facade. | entailment |
def create_api_option_vip(self):
"""Get an instance of Api Option Vip services facade."""
return ApiOptionVip(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Option Vip services facade. | entailment |
def create_api_pool(self):
"""Get an instance of Api Pool services facade."""
return ApiPool(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Pool services facade. | entailment |
def create_api_pool_deploy(self):
"""Get an instance of Api Pool Deploy services facade."""
return ApiPoolDeploy(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Pool Deploy services facade. | entailment |
def create_apirack(self):
"""Get an instance of Api Rack Variables services facade."""
return ApiRack(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Rack Variables services facade. | entailment |
def create_api_vip_request(self):
"""Get an instance of Api Vip Requests services facade."""
return ApiVipRequest(
self.networkapi_url,
self.user,
self.password,
self.user_ldap,
self.log_level) | Get an instance of Api Vip Requests services facade. | entailment |
def create_api_object_type(self):
"""Get an instance of Api Vip Requests services facade."""
return ApiObjectType(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vip Requests services facade. | entailment |
def create_api_object_group_permission(self):
"""Get an instance of Api Vip Requests services facade."""
return ApiObjectGroupPermission(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vip Requests services facade. | entailment |
def create_api_object_group_permission_general(self):
"""Get an instance of Api Vip Requests services facade."""
return ApiObjectGroupPermissionGeneral(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vip Requests services facade. | entailment |
def create_api_vlan(self):
"""Get an instance of Api Vlan services facade."""
return ApiVlan(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vlan services facade. | entailment |
def create_api_vrf(self):
"""Get an instance of Api Vrf services facade."""
return ApiVrf(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api Vrf services facade. | entailment |
def create_rule(self):
"""Get an instance of block rule services facade."""
return BlockRule(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of block rule services facade. | entailment |
def create_direito_grupo_equipamento(self):
"""Get an instance of direito_grupo_equipamento services facade."""
return DireitoGrupoEquipamento(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of direito_grupo_equipamento services facade. | entailment |
def create_divisao_dc(self):
"""Get an instance of divisao_dc services facade."""
return DivisaoDc(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of divisao_dc services facade. | entailment |
def create_environment_vip(self):
"""Get an instance of environment_vip services facade."""
return EnvironmentVIP(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of environment_vip services facade. | entailment |
def create_equipamento(self):
"""Get an instance of equipamento services facade."""
return Equipamento(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of equipamento services facade. | entailment |
def create_equipamento_acesso(self):
"""Get an instance of equipamento_acesso services facade."""
return EquipamentoAcesso(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of equipamento_acesso services facade. | entailment |
def create_equipamento_ambiente(self):
"""Get an instance of equipamento_ambiente services facade."""
return EquipamentoAmbiente(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of equipamento_ambiente services facade. | entailment |
def create_equipamento_roteiro(self):
"""Get an instance of equipamento_roteiro services facade."""
return EquipamentoRoteiro(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of equipamento_roteiro services facade. | entailment |
def create_log(self):
"""Get an instance of log services facade."""
return EventLog(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of log services facade. | entailment |
def create_filter(self):
"""Get an instance of filter services facade."""
return Filter(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of filter services facade. | entailment |
def create_grupo_equipamento(self):
"""Get an instance of grupo_equipamento services facade."""
return GrupoEquipamento(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of grupo_equipamento services facade. | entailment |
def create_grupo_l3(self):
"""Get an instance of grupo_l3 services facade."""
return GrupoL3(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of grupo_l3 services facade. | entailment |
def create_grupo_usuario(self):
"""Get an instance of grupo_usuario services facade."""
return GrupoUsuario(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of grupo_usuario services facade. | entailment |
def create_grupo_virtual(self):
"""Get an instance of grupo_virtual services facade."""
return GrupoVirtual(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of grupo_virtual services facade. | entailment |
def create_healthcheck(self):
"""Get an instance of Poll services facade."""
return Healthcheck(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Poll services facade. | entailment |
def create_interface(self):
"""Get an instance of interface services facade."""
return Interface(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of interface services facade. | entailment |
def create_ip(self):
"""Get an instance of ip services facade."""
return Ip(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of ip services facade. | entailment |
def create_marca(self):
"""Get an instance of marca services facade."""
return Marca(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of marca services facade. | entailment |
def create_modelo(self):
"""Get an instance of modelo services facade."""
return Modelo(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of modelo services facade. | entailment |
def create_dhcprelay_ipv4(self):
"""Get an instance of DHCPRelayIPv4 services facade."""
return DHCPRelayIPv4(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of DHCPRelayIPv4 services facade. | entailment |
def create_dhcprelay_ipv6(self):
"""Get an instance of DHCPRelayIPv6 services facade."""
return DHCPRelayIPv6(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of DHCPRelayIPv6 services facade. | entailment |
def create_network(self):
"""Get an instance of vlan services facade."""
return Network(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of vlan services facade. | entailment |
def create_option_pool(self):
"""Get an instance of option_pool services facade."""
return OptionPool(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of option_pool services facade. | entailment |
def create_option_vip(self):
"""Get an instance of option_vip services facade."""
return OptionVIP(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of option_vip services facade. | entailment |
def create_permissao_administrativa(self):
"""Get an instance of permissao_administrativa services facade."""
return PermissaoAdministrativa(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of permissao_administrativa services facade. | entailment |
def create_permission(self):
"""Get an instance of permission services facade."""
return Permission(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of permission services facade. | entailment |
def create_pool(self):
"""Get an instance of Poll services facade."""
return Pool(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Poll services facade. | entailment |
def create_rack(self):
"""Get an instance of rack services facade."""
return Rack(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of rack services facade. | entailment |
def create_rackservers(self):
"""Get an instance of rackservers services facade."""
return RackServers(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of rackservers services facade. | entailment |
def create_roteiro(self):
"""Get an instance of roteiro services facade."""
return Roteiro(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of roteiro services facade. | entailment |
def create_system(self):
"""Get an instance of Api System Variables services facade."""
return System(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of Api System Variables services facade. | entailment |
def create_tipo_acesso(self):
"""Get an instance of tipo_acesso services facade."""
return TipoAcesso(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of tipo_acesso services facade. | entailment |
def create_tipo_equipamento(self):
"""Get an instance of tipo_equipamento services facade."""
return TipoEquipamento(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of tipo_equipamento services facade. | entailment |
def create_tipo_rede(self):
"""Get an instance of tipo_rede services facade."""
return TipoRede(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of tipo_rede services facade. | entailment |
def create_tipo_roteiro(self):
"""Get an instance of tipo_roteiro services facade."""
return TipoRoteiro(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of tipo_roteiro services facade. | entailment |
def create_usuario(self):
"""Get an instance of usuario services facade."""
return Usuario(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of usuario services facade. | entailment |
def create_usuario_grupo(self):
"""Get an instance of usuario_grupo services facade."""
return UsuarioGrupo(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of usuario_grupo services facade. | entailment |
def create_vip(self):
"""Get an instance of vip services facade."""
return Vip(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of vip services facade. | entailment |
def create_vlan(self):
"""Get an instance of vlan services facade."""
return Vlan(
self.networkapi_url,
self.user,
self.password,
self.user_ldap) | Get an instance of vlan services facade. | entailment |
def deploy(self, id_networkv6):
"""Deploy network in equipments and set column 'active = 1' in tables redeipv6 ]
:param id_networkv6: ID for NetworkIPv6
:return: Equipments configuration output
"""
data = dict()
uri = 'api/networkv6/%s/equipments/' % id_networkv6
return super(ApiNetworkIPv6, self).post(uri, data=data) | Deploy network in equipments and set column 'active = 1' in tables redeipv6 ]
:param id_networkv6: ID for NetworkIPv6
:return: Equipments configuration output | entailment |
def get_by_id(self, id_networkv6):
"""Get IPv6 network
:param id_networkv4: ID for NetworkIPv6
:return: IPv6 Network
"""
uri = 'api/networkv4/%s/' % id_networkv6
return super(ApiNetworkIPv6, self).get(uri) | Get IPv6 network
:param id_networkv4: ID for NetworkIPv6
:return: IPv6 Network | entailment |
def list(self, environment_vip=None):
"""List networks redeipv6 ]
:param environment_vip: environment vip to filter
:return: IPv6 Networks
"""
uri = 'api/networkv6/?'
if environment_vip:
uri += 'environment_vip=%s' % environment_vip
return super(ApiNetworkIPv6, self).get(uri) | List networks redeipv6 ]
:param environment_vip: environment vip to filter
:return: IPv6 Networks | entailment |
def undeploy(self, id_networkv6):
"""Remove deployment of network in equipments and set column 'active = 0' in tables redeipv6 ]
:param id_networkv6: ID for NetworkIPv6
:return: Equipments configuration output
"""
uri = 'api/networkv6/%s/equipments/' % id_networkv6
return super(ApiNetworkIPv6, self).delete(uri) | Remove deployment of network in equipments and set column 'active = 0' in tables redeipv6 ]
:param id_networkv6: ID for NetworkIPv6
:return: Equipments configuration output | entailment |
def check_vip_ip(self, ip, environment_vip):
"""
Check available ipv6 in environment vip
"""
uri = 'api/ipv6/ip/%s/environment-vip/%s/' % (ip, environment_vip)
return super(ApiNetworkIPv6, self).get(uri) | Check available ipv6 in environment vip | entailment |
def delete_ipv6(self, ipv6_id):
"""
Delete ipv6
"""
uri = 'api/ipv6/%s/' % (ipv6_id)
return super(ApiNetworkIPv6, self).delete(uri) | Delete ipv6 | entailment |
def search(self, **kwargs):
"""
Method to search ipv6's based on extends search.
:param search: Dict containing QuerySets to find ipv6'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 default fields.
:param kind: Determine if result will be detailed ('detail') or basic ('basic').
:return: Dict containing ipv6's
"""
return super(ApiNetworkIPv6, self).get(self.prepare_url('api/v3/networkv6/',
kwargs)) | Method to search ipv6's based on extends search.
:param search: Dict containing QuerySets to find ipv6'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 default fields.
:param kind: Determine if result will be detailed ('detail') or basic ('basic').
:return: Dict containing ipv6's | entailment |
def delete(self, ids):
"""
Method to delete network-ipv6's by their ids
:param ids: Identifiers of network-ipv6's
:return: None
"""
url = build_uri_with_ids('api/v3/networkv6/%s/', ids)
return super(ApiNetworkIPv6, self).delete(url) | Method to delete network-ipv6's by their ids
:param ids: Identifiers of network-ipv6's
:return: None | entailment |
def update(self, networkipv6s):
"""
Method to update network-ipv6's
:param networkipv6s: List containing network-ipv6's desired to updated
:return: None
"""
data = {'networks': networkipv6s}
networkipv6s_ids = [str(networkipv6.get('id'))
for networkipv6 in networkipv6s]
return super(ApiNetworkIPv6, self).put('api/v3/networkv6/%s/' %
';'.join(networkipv6s_ids), data) | Method to update network-ipv6's
:param networkipv6s: List containing network-ipv6's desired to updated
:return: None | entailment |
def create(self, networkipv6s):
"""
Method to create network-ipv6's
:param networkipv6s: List containing networkipv6's desired to be created on database
:return: None
"""
data = {'networks': networkipv6s}
return super(ApiNetworkIPv6, self).post('api/v3/networkv6/', data) | Method to create network-ipv6's
:param networkipv6s: List containing networkipv6's desired to be created on database
:return: None | entailment |
def list_all(self):
"""
List all environment vips
:return: Following dictionary:
::
{'environment_vip': [{'id': <id>,
'finalidade_txt': <finalidade_txt>,
'cliente_txt': <cliente_txt>,
'ambiente_p44_txt': <ambiente_p44_txt> } {... other environments vip ...}]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
url = 'environmentvip/all/'
code, xml = self.submit(None, 'GET', url)
key = 'environment_vip'
return get_list_map(self.response(code, xml, [key]), key) | List all environment vips
:return: Following dictionary:
::
{'environment_vip': [{'id': <id>,
'finalidade_txt': <finalidade_txt>,
'cliente_txt': <cliente_txt>,
'ambiente_p44_txt': <ambiente_p44_txt> } {... other environments vip ...}]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def list_all_available(self, id_vlan):
"""
List all environment vips availables
:return: Following dictionary:
::
{'environment_vip': [{'id': <id>,
'finalidade_txt': <finalidade_txt>,
'cliente_txt': <cliente_txt>,
'ambiente_p44_txt': <ambiente_p44_txt> }
{... other environments vip ...}]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
url = 'environmentvip/search/' + str(id_vlan)
code, xml = self.submit(None, 'GET', url)
key = 'environment_vip'
return get_list_map(self.response(code, xml, [key]), key) | List all environment vips availables
:return: Following dictionary:
::
{'environment_vip': [{'id': <id>,
'finalidade_txt': <finalidade_txt>,
'cliente_txt': <cliente_txt>,
'ambiente_p44_txt': <ambiente_p44_txt> }
{... other environments vip ...}]}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def add(self, finalidade_txt, cliente_txt, ambiente_p44_txt, description):
"""Inserts a new Environment VIP and returns its identifier.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
{'environment_vip': {'id': < id >}}
:raise InvalidParameterError: The value of finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
environmentvip_map = dict()
environmentvip_map['finalidade_txt'] = finalidade_txt
environmentvip_map['cliente_txt'] = cliente_txt
environmentvip_map['ambiente_p44_txt'] = ambiente_p44_txt
environmentvip_map['description'] = description
code, xml = self.submit(
{'environment_vip': environmentvip_map}, 'POST', 'environmentvip/')
return self.response(code, xml) | Inserts a new Environment VIP and returns its identifier.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
{'environment_vip': {'id': < id >}}
:raise InvalidParameterError: The value of finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def alter(
self,
id_environment_vip,
finalidade_txt,
cliente_txt,
ambiente_p44_txt,
description):
"""Change Environment VIP from by the identifier.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: None
:raise InvalidParameterError: Environment VIP identifier is null and invalid.
:raise InvalidParameterError: The value of finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
if not is_valid_int_param(id_environment_vip):
raise InvalidParameterError(
u'The identifier of Environment VIP is invalid or was not informed.')
environmentvip_map = dict()
environmentvip_map['finalidade_txt'] = finalidade_txt
environmentvip_map['cliente_txt'] = cliente_txt
environmentvip_map['ambiente_p44_txt'] = ambiente_p44_txt
environmentvip_map['description'] = description
url = 'environmentvip/' + str(id_environment_vip) + '/'
code, xml = self.submit(
{'environment_vip': environmentvip_map}, 'PUT', url)
return self.response(code, xml) | Change Environment VIP from by the identifier.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: None
:raise InvalidParameterError: Environment VIP identifier is null and invalid.
:raise InvalidParameterError: The value of finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def remove(self, id_environment_vip):
"""Remove Environment VIP from by the identifier.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Environment VIP identifier is null and invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise EnvironmentVipError: There networkIPv4 or networkIPv6 associated with environment vip.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
if not is_valid_int_param(id_environment_vip):
raise InvalidParameterError(
u'The identifier of Environment VIP is invalid or was not informed.')
url = 'environmentvip/' + str(id_environment_vip) + '/'
code, xml = self.submit(None, 'DELETE', url)
return self.response(code, xml) | Remove Environment VIP from by the identifier.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:return: None
:raise InvalidParameterError: Environment VIP identifier is null and invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise EnvironmentVipError: There networkIPv4 or networkIPv6 associated with environment vip.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def search(
self,
id_environment_vip=None,
finalidade_txt=None,
cliente_txt=None,
ambiente_p44_txt=None):
"""Search Environment VIP from by parameters.
Case the id parameter has been passed, the same it has priority over the other parameters.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
{‘environment_vip’:
{‘id’: < id >,
‘finalidade_txt’: < finalidade_txt >,
‘finalidade’: < finalidade >,
‘cliente_txt’: < cliente_txt >,
‘ambiente_p44_txt’: < ambiente_p44_txt >}}
:raise InvalidParameterError: The value of id_environment_vip, finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
environmentvip_map = dict()
environmentvip_map['id_environment_vip'] = id_environment_vip
environmentvip_map['finalidade_txt'] = finalidade_txt
environmentvip_map['cliente_txt'] = cliente_txt
environmentvip_map['ambiente_p44_txt'] = ambiente_p44_txt
code, xml = self.submit(
{'environment_vip': environmentvip_map}, 'POST', 'environmentvip/search/')
return self.response(code, xml) | Search Environment VIP from by parameters.
Case the id parameter has been passed, the same it has priority over the other parameters.
:param id_environment_vip: Identifier of the Environment VIP. Integer value and greater than zero.
:param finalidade_txt: Finality. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param cliente_txt: ID Client. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:param ambiente_p44_txt: Environment P44. String with a maximum of 50 characters and respect [a-zA-Z\_-]
:return: Following dictionary:
::
{‘environment_vip’:
{‘id’: < id >,
‘finalidade_txt’: < finalidade_txt >,
‘finalidade’: < finalidade >,
‘cliente_txt’: < cliente_txt >,
‘ambiente_p44_txt’: < ambiente_p44_txt >}}
:raise InvalidParameterError: The value of id_environment_vip, finalidade_txt, cliente_txt or ambiente_p44_txt is invalid.
:raise EnvironmentVipNotFoundError: Environment VIP not registered.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def buscar_finalidade(self):
"""Search finalidade_txt environment vip
:return: Dictionary with the following structure:
::
{‘finalidade’: ‘finalidade’: <'finalidade_txt'>}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
url = 'environment-vip/get/finality'
code, xml = self.submit(None, 'GET', url)
return self.response(code, xml) | Search finalidade_txt environment vip
:return: Dictionary with the following structure:
::
{‘finalidade’: ‘finalidade’: <'finalidade_txt'>}
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def buscar_cliente_por_finalidade(self, finalidade_txt):
"""Search cliente_txt environment vip
:return: Dictionary with the following structure:
::
{‘cliente_txt’:
‘finalidade’: <'finalidade_txt'>,
'cliente_txt: <'cliente_txt'>'}
:raise InvalidParameterError: finalidade_txt is null and invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
vip_map = dict()
vip_map['finalidade_txt'] = finalidade_txt
url = 'environment-vip/get/cliente_txt/'
code, xml = self.submit({'vip': vip_map}, 'POST', url)
return self.response(code, xml) | Search cliente_txt environment vip
:return: Dictionary with the following structure:
::
{‘cliente_txt’:
‘finalidade’: <'finalidade_txt'>,
'cliente_txt: <'cliente_txt'>'}
:raise InvalidParameterError: finalidade_txt is null and invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def buscar_ambientep44_por_finalidade_cliente(
self,
finalidade_txt,
cliente_txt):
"""Search ambiente_p44_txt environment vip
:return: Dictionary with the following structure:
::
{‘ambiente_p44_txt’:
'id':<'id_ambientevip'>,
‘finalidade’: <'finalidade_txt'>,
'cliente_txt: <'cliente_txt'>',
'ambiente_p44: <'ambiente_p44'>',}
:raise InvalidParameterError: finalidade_txt and cliente_txt is null and invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
vip_map = dict()
vip_map['finalidade_txt'] = finalidade_txt
vip_map['cliente_txt'] = cliente_txt
url = 'environment-vip/get/ambiente_p44_txt/'
code, xml = self.submit({'vip': vip_map}, 'POST', url)
return self.response(code, xml) | Search ambiente_p44_txt environment vip
:return: Dictionary with the following structure:
::
{‘ambiente_p44_txt’:
'id':<'id_ambientevip'>,
‘finalidade’: <'finalidade_txt'>,
'cliente_txt: <'cliente_txt'>',
'ambiente_p44: <'ambiente_p44'>',}
:raise InvalidParameterError: finalidade_txt and cliente_txt is null and invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def environmentvip_step(self, finality='', client='', environmentp44=''):
"""
List finality, client or environment vip list.
Param finality: finality of environment(optional)
Param client: client of environment(optional)
Param environmentp44: environmentp44(optional)
Return finality list: when request has no finality and client.
Return client list: when request has only finality.
Return list environment vip: when request has finality and client.
Return environment vip: when request has finality, client and environmentvip
"""
uri = 'api/v3/environment-vip/step/?finality=%s&client=%s&environmentp44=%s' % (
finality, client, environmentp44)
return super(ApiEnvironmentVip, self).get(
uri) | List finality, client or environment vip list.
Param finality: finality of environment(optional)
Param client: client of environment(optional)
Param environmentp44: environmentp44(optional)
Return finality list: when request has no finality and client.
Return client list: when request has only finality.
Return list environment vip: when request has finality and client.
Return environment vip: when request has finality, client and environmentvip | entailment |
def search(self, **kwargs):
"""
Method to search environments vip based on extends search.
:param search: Dict containing QuerySets to find environments vip.
: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 default fields.
:param kind: Determine if result will be detailed ('detail')
or basic ('basic').
:return: Dict containing environments vip
"""
return super(ApiEnvironmentVip, self).get(
self.prepare_url('api/v3/environment-vip/', kwargs)) | Method to search environments vip based on extends search.
:param search: Dict containing QuerySets to find environments vip.
: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 default fields.
:param kind: Determine if result will be detailed ('detail')
or basic ('basic').
:return: Dict containing environments vip | entailment |
def get(self, ids, **kwargs):
"""
Method to get environments vip by their ids
:param ids: List containing identifiers of environments vip
: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 default fields.
:param kind: Determine if result will be detailed ('detail')
or basic ('basic').
:return: Dict containing environments vip
"""
uri = build_uri_with_ids('api/v3/environment-vip/%s/', ids)
return super(ApiEnvironmentVip, self).get(
self.prepare_url(uri, kwargs)) | Method to get environments vip by their ids
:param ids: List containing identifiers of environments vip
: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 default fields.
:param kind: Determine if result will be detailed ('detail')
or basic ('basic').
:return: Dict containing environments vip | entailment |
def delete(self, ids):
"""
Method to delete environments vip by their id's.
:param ids: Identifiers of environments vip
:return: None
"""
url = build_uri_with_ids('api/v3/environment-vip/%s/', ids)
return super(ApiEnvironmentVip, self).delete(url) | Method to delete environments vip by their id's.
:param ids: Identifiers of environments vip
:return: None | entailment |
def update(self, environments):
"""
Method to update environments vip
:param environments vip: List containing environments vip desired
to updated
:return: None
"""
data = {'environments_vip': environments}
environments_ids = [str(env.get('id')) for env in environments]
uri = 'api/v3/environment-vip/%s/' % ';'.join(environments_ids)
return super(ApiEnvironmentVip, self).put(uri, data) | Method to update environments vip
:param environments vip: List containing environments vip desired
to updated
:return: None | entailment |
def create(self, environments):
"""
Method to create environments vip
:param environments vip: Dict containing environments vip desired
to be created on database
:return: None
"""
data = {'environments_vip': environments}
uri = 'api/v3/environment-vip/'
return super(ApiEnvironmentVip, self).post(uri, data) | Method to create environments vip
:param environments vip: Dict containing environments vip desired
to be created on database
:return: None | entailment |
def get_ipv4(self, id_ip):
"""Get IPv4 by id.
:param id_ip: ID of IPv4.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'networkipv4': < networkipv4 >,
'oct4': < oct4 >,
'oct3': < oct3 >,
'oct2': < oct2 >,
'oct1': < oct1 >,
'descricao': < descricao >,
'equipamentos': [ { all name of equipments related } ] , }}
:raise IpNaoExisteError: IP is not registered.
:raise InvalidParameterError: IP identifier is null or invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
if not is_valid_int_param(id_ip):
raise InvalidParameterError(
u'The IPv4 identifier is invalid or was not informed.')
url = 'ip/get-ipv4/' + str(id_ip) + '/'
code, xml = self.submit(None, 'GET', url)
key = 'ipv4'
return get_list_map(self.response(code, xml, ["equipamentos"]), key) | Get IPv4 by id.
:param id_ip: ID of IPv4.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'networkipv4': < networkipv4 >,
'oct4': < oct4 >,
'oct3': < oct3 >,
'oct2': < oct2 >,
'oct1': < oct1 >,
'descricao': < descricao >,
'equipamentos': [ { all name of equipments related } ] , }}
:raise IpNaoExisteError: IP is not registered.
:raise InvalidParameterError: IP identifier is null or invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def get_ipv6(self, id_ip):
"""Get IPv6 by id.
:param id_ip: ID of IPv6.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'networkipv6': < networkipv6 >,
'block1': < block1 >,
'block2': < block2 >,
'block3': < block3 >,
'block4': < block4 >,
'block5': < block5 >,
'block6': < block6 >,
'block7': < block7 >,
'block8': < block8 >,
'description': < description >,
'equipamentos': [ { all name of equipments related } ] , }}
:raise IpNaoExisteError: IP is not registered.
:raise InvalidParameterError: IP identifier is null or invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response.
"""
if not is_valid_int_param(id_ip):
raise InvalidParameterError(
u'The IPv6 identifier is invalid or was not informed.')
url = 'ip/get-ipv6/' + str(id_ip) + '/'
code, xml = self.submit(None, 'GET', url)
key = 'ipv6'
return get_list_map(self.response(code, xml, ["equipamentos"]), key) | Get IPv6 by id.
:param id_ip: ID of IPv6.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'networkipv6': < networkipv6 >,
'block1': < block1 >,
'block2': < block2 >,
'block3': < block3 >,
'block4': < block4 >,
'block5': < block5 >,
'block6': < block6 >,
'block7': < block7 >,
'block8': < block8 >,
'description': < description >,
'equipamentos': [ { all name of equipments related } ] , }}
:raise IpNaoExisteError: IP is not registered.
:raise InvalidParameterError: IP identifier is null or invalid.
:raise DataBaseError: Networkapi failed to access the database.
:raise XMLError: Networkapi failed to generate the XML response. | entailment |
def buscar_por_ip_ambiente(self, ip, id_environment):
"""Get IP with an associated environment.
:param ip: IP address in the format x1.x2.x3.x4.
:param id_environment: Identifier of the environment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'id_vlan': < id_vlan >,
'oct4': < oct4 >,
'oct3': < oct3 >,
'oct2': < oct2 >,
'oct1': < oct1 >,
'descricao': < descricao > }}
:raise IpNaoExisteError: IP is not registered or not associated with environment.
:raise InvalidParameterError: The environment identifier and/or IP is/are null or invalid.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_environment):
raise InvalidParameterError(
u'Environment identifier is invalid or was not informed.')
if not is_valid_ip(ip):
raise InvalidParameterError(u'IP is invalid or was not informed.')
url = 'ip/' + str(ip) + '/ambiente/' + str(id_environment) + '/'
code, xml = self.submit(None, 'GET', url)
return self.response(code, xml) | Get IP with an associated environment.
:param ip: IP address in the format x1.x2.x3.x4.
:param id_environment: Identifier of the environment. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip': {'id': < id >,
'id_vlan': < id_vlan >,
'oct4': < oct4 >,
'oct3': < oct3 >,
'oct2': < oct2 >,
'oct1': < oct1 >,
'descricao': < descricao > }}
:raise IpNaoExisteError: IP is not registered or not associated with environment.
:raise InvalidParameterError: The environment identifier and/or IP is/are null or invalid.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def get_available_ip4(self, id_network):
"""
Get a available IP in the network ipv4
:param id_network: Network identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip': {'ip': < available_ip >}}
:raise IpNotAvailableError: Network dont have available IP for insert a new IP
:raise NetworkIPv4NotFoundError: Network is not found
:raise UserNotAuthorizedError: User dont have permission to get a available IP
:raise InvalidParameterError: Network identifier is null or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_network):
raise InvalidParameterError(
u'Network identifier is invalid or was not informed.')
url = 'ip/availableip4/' + str(id_network) + "/"
code, xml = self.submit(None, 'GET', url)
return self.response(code, xml) | Get a available IP in the network ipv4
:param id_network: Network identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip': {'ip': < available_ip >}}
:raise IpNotAvailableError: Network dont have available IP for insert a new IP
:raise NetworkIPv4NotFoundError: Network is not found
:raise UserNotAuthorizedError: User dont have permission to get a available IP
:raise InvalidParameterError: Network identifier is null or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def get_ip_by_equip_and_vip(self, equip_name, id_evip):
"""
Get a available IP in the Equipment related Environment VIP
:param equip_name: Equipment Name.
:param id_evip: Vip environment identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ 'ipv4': [ {'id': < id >, 'ip': < ip >, 'network': { 'id': < id >, 'network': < network >, 'mask': < mask >, }} ... ],
'ipv6': [ {'id': < id >, 'ip': < ip >, 'network': { 'id': < id >, 'network': < network >, 'mask': < mask >, }} ... ] }
:raise InvalidParameterError: Vip environment identifier or equipment name is none or invalid.
:raise EquipamentoNotFoundError: Equipment not registered.
:raise EnvironmentVipNotFoundError: Vip environment not registered.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_evip):
raise InvalidParameterError(
u'Vip environment is invalid or was not informed.')
ip_map = dict()
ip_map['equip_name'] = equip_name
ip_map['id_evip'] = id_evip
url = "ip/getbyequipandevip/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Get a available IP in the Equipment related Environment VIP
:param equip_name: Equipment Name.
:param id_evip: Vip environment identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ 'ipv4': [ {'id': < id >, 'ip': < ip >, 'network': { 'id': < id >, 'network': < network >, 'mask': < mask >, }} ... ],
'ipv6': [ {'id': < id >, 'ip': < ip >, 'network': { 'id': < id >, 'network': < network >, 'mask': < mask >, }} ... ] }
:raise InvalidParameterError: Vip environment identifier or equipment name is none or invalid.
:raise EquipamentoNotFoundError: Equipment not registered.
:raise EnvironmentVipNotFoundError: Vip environment not registered.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def get_ipv4_or_ipv6(self, ip):
"""
Get a Ipv4 or Ipv6 by IP
:param ip: IPv4 or Ipv6. 'xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'
:return: Dictionary with the following structure:
::
{'ips': [{'oct4': < oct4 >, 'oct2': < oct2 >, 'oct3': < oct3 >,
'oct1': < oct1 >, 'version': < version >,
'networkipv4': < networkipv4 >, 'id': < id >, 'descricao': < descricao >}, ... ] }.
or
{'ips': [ {'block1': < block1 >, 'block2': < block2 >, 'block3': < block3 >, 'block4': < block4 >, 'block5': < block5 >, 'block6': < block6 >, 'block7': < block7 >, 'block8': < block8 >,
'version': < version >, 'networkipv6': < networkipv6 >, 'id': < id >, 'descricao': < descricao >}, ... ] }.
:raise IpNaoExisteError: Ipv4 or Ipv6 not found.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip string is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
ip_map = dict()
ip_map['ip'] = ip
url = "ip/getbyoctblock/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Get a Ipv4 or Ipv6 by IP
:param ip: IPv4 or Ipv6. 'xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'
:return: Dictionary with the following structure:
::
{'ips': [{'oct4': < oct4 >, 'oct2': < oct2 >, 'oct3': < oct3 >,
'oct1': < oct1 >, 'version': < version >,
'networkipv4': < networkipv4 >, 'id': < id >, 'descricao': < descricao >}, ... ] }.
or
{'ips': [ {'block1': < block1 >, 'block2': < block2 >, 'block3': < block3 >, 'block4': < block4 >, 'block5': < block5 >, 'block6': < block6 >, 'block7': < block7 >, 'block8': < block8 >,
'version': < version >, 'networkipv6': < networkipv6 >, 'id': < id >, 'descricao': < descricao >}, ... ] }.
:raise IpNaoExisteError: Ipv4 or Ipv6 not found.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip string is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def check_vip_ip(self, ip, id_evip):
"""
Get a Ipv4 or Ipv6 for Vip request
:param ip: IPv4 or Ipv6. 'xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'
:return: Dictionary with the following structure:
::
{'ip': {'ip': < ip - octs for ipv4, blocks for ipv6 - >,
'id': <id>,
'network4 or network6'}}.
:raise IpNaoExisteError: Ipv4 or Ipv6 not found.
:raise EnvironemntVipNotFoundError: Vip environment not found.
:raise IPNaoDisponivelError: Ip not available for Vip Environment.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip string or vip environment is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
ip_map = dict()
ip_map['ip'] = ip
ip_map['id_evip'] = id_evip
url = "ip/checkvipip/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Get a Ipv4 or Ipv6 for Vip request
:param ip: IPv4 or Ipv6. 'xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'
:return: Dictionary with the following structure:
::
{'ip': {'ip': < ip - octs for ipv4, blocks for ipv6 - >,
'id': <id>,
'network4 or network6'}}.
:raise IpNaoExisteError: Ipv4 or Ipv6 not found.
:raise EnvironemntVipNotFoundError: Vip environment not found.
:raise IPNaoDisponivelError: Ip not available for Vip Environment.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip string or vip environment is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def get_available_ip6(self, id_network6):
"""
Get a available IP in Network ipv6
:param id_network6: Network ipv6 identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip6': {'ip6': < available_ip6 >}}
:raise IpNotAvailableError: Network dont have available IP.
:raise NetworkIPv4NotFoundError: Network was not found.
:raise UserNotAuthorizedError: User dont have permission to get a available IP.
:raise InvalidParameterError: Network ipv6 identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_network6):
raise InvalidParameterError(
u'Network ipv6 identifier is invalid or was not informed.')
url = 'ip/availableip6/' + str(id_network6) + "/"
code, xml = self.submit(None, 'GET', url)
return self.response(code, xml) | Get a available IP in Network ipv6
:param id_network6: Network ipv6 identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{'ip6': {'ip6': < available_ip6 >}}
:raise IpNotAvailableError: Network dont have available IP.
:raise NetworkIPv4NotFoundError: Network was not found.
:raise UserNotAuthorizedError: User dont have permission to get a available IP.
:raise InvalidParameterError: Network ipv6 identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def get_available_ip6_for_vip(self, id_evip, name):
"""
Get and save a available IP in the network ipv6 for vip request
:param id_evip: Vip environment identifier. Integer value and greater than zero.
:param name: Ip description
:return: Dictionary with the following structure:
::
{'ip': {'bloco1':<bloco1>,
'bloco2':<bloco2>,
'bloco3':<bloco3>,
'bloco4':<bloco4>,
'bloco5':<bloco5>,
'bloco6':<bloco6>,
'bloco7':<bloco7>,
'bloco8':<bloco8>,
'id':<id>,
'networkipv6':<networkipv6>,
'description':<description>}}
:raise IpNotAvailableError: Network dont have available IP for vip environment.
:raise EnvironmentVipNotFoundError: Vip environment not registered.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Vip environment identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_evip):
raise InvalidParameterError(
u'Vip environment identifier is invalid or was not informed.')
url = 'ip/availableip6/vip/' + str(id_evip) + "/"
ip_map = dict()
ip_map['id_evip'] = id_evip
ip_map['name'] = name
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Get and save a available IP in the network ipv6 for vip request
:param id_evip: Vip environment identifier. Integer value and greater than zero.
:param name: Ip description
:return: Dictionary with the following structure:
::
{'ip': {'bloco1':<bloco1>,
'bloco2':<bloco2>,
'bloco3':<bloco3>,
'bloco4':<bloco4>,
'bloco5':<bloco5>,
'bloco6':<bloco6>,
'bloco7':<bloco7>,
'bloco8':<bloco8>,
'id':<id>,
'networkipv6':<networkipv6>,
'description':<description>}}
:raise IpNotAvailableError: Network dont have available IP for vip environment.
:raise EnvironmentVipNotFoundError: Vip environment not registered.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Vip environment identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
def edit_ipv4(self, ip4, descricao, id_ip):
"""
Edit a IP4
:param ip4: An IP4 available to save in format x.x.x.x.
:param id_ip: IP identifier. Integer value and greater than zero.
:param descricao: IP description.
:return: None
"""
if not is_valid_int_param(id_ip):
raise InvalidParameterError(
u'Ip identifier is invalid or was not informed.')
if ip4 is None or ip4 == "":
raise InvalidParameterError(
u'The IP4 is invalid or was not informed.')
ip_map = dict()
ip_map['descricao'] = descricao
ip_map['ip4'] = ip4
ip_map['id_ip'] = id_ip
url = "ip4/edit/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Edit a IP4
:param ip4: An IP4 available to save in format x.x.x.x.
:param id_ip: IP identifier. Integer value and greater than zero.
:param descricao: IP description.
:return: None | entailment |
def save_ipv4(self, ip4, id_equip, descricao, id_net):
"""
Save a IP4 and associate with equipment
:param ip4: An IP4 available to save in format x.x.x.x.
:param id_equip: Equipment identifier. Integer value and greater than zero.
:param descricao: IP description.
:param id_net: Network identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ ip: { id: <id_ip4>,
oct1: <oct1>,
oct2: <oct2>,
oct3: <oct3>,
oct4: <oct4>,
equipamento: [ { all equipamentos related } ] ,
descricao: <descricao> } }
"""
if not is_valid_int_param(id_net):
raise InvalidParameterError(
u'Network identifier is invalid or was not informed.')
if not is_valid_int_param(id_equip):
raise InvalidParameterError(
u'Equipment identifier is invalid or was not informed.')
if ip4 is None or ip4 == "":
raise InvalidParameterError(u'IP4 is invalid or was not informed.')
ip_map = dict()
ip_map['id_net'] = id_net
ip_map['descricao'] = descricao
ip_map['ip4'] = ip4
ip_map['id_equip'] = id_equip
url = "ipv4/save/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Save a IP4 and associate with equipment
:param ip4: An IP4 available to save in format x.x.x.x.
:param id_equip: Equipment identifier. Integer value and greater than zero.
:param descricao: IP description.
:param id_net: Network identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ ip: { id: <id_ip4>,
oct1: <oct1>,
oct2: <oct2>,
oct3: <oct3>,
oct4: <oct4>,
equipamento: [ { all equipamentos related } ] ,
descricao: <descricao> } } | entailment |
def edit_ipv6(self, ip6, descricao, id_ip):
"""
Edit a IP6
:param ip6: An IP6 available to save in format xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx.
:param descricao: IP description.
:param id_ip: Ipv6 identifier. Integer value and greater than zero.
:return: None
"""
if not is_valid_int_param(id_ip):
raise InvalidParameterError(
u'Ipv6 identifier is invalid or was not informed.')
if ip6 is None or ip6 == "":
raise InvalidParameterError(u'IP6 is invalid or was not informed.')
ip_map = dict()
ip_map['descricao'] = descricao
ip_map['ip6'] = ip6
ip_map['id_ip'] = id_ip
url = "ipv6/edit/"
code, xml = self.submit({'ip_map': ip_map}, 'POST', url)
return self.response(code, xml) | Edit a IP6
:param ip6: An IP6 available to save in format xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx.
:param descricao: IP description.
:param id_ip: Ipv6 identifier. Integer value and greater than zero.
:return: None | entailment |
def find_ip4_by_id(self, id_ip):
"""
Get an IP by ID
:param id_ip: IP identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ ips { id: <id_ip4>,
oct1: <oct1>,
oct2: <oct2>,
oct3: <oct3>,
oct4: <oct4>,
equipamento: [ {all equipamentos related} ] ,
descricao: <descricao>} }
:raise IpNotAvailableError: Network dont have available IP.
:raise NetworkIPv4NotFoundError: Network was not found.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database.
"""
if not is_valid_int_param(id_ip):
raise InvalidParameterError(
u'Ip identifier is invalid or was not informed.')
url = 'ip/get/' + str(id_ip) + "/"
code, xml = self.submit(None, 'GET', url)
return self.response(code, xml) | Get an IP by ID
:param id_ip: IP identifier. Integer value and greater than zero.
:return: Dictionary with the following structure:
::
{ ips { id: <id_ip4>,
oct1: <oct1>,
oct2: <oct2>,
oct3: <oct3>,
oct4: <oct4>,
equipamento: [ {all equipamentos related} ] ,
descricao: <descricao>} }
:raise IpNotAvailableError: Network dont have available IP.
:raise NetworkIPv4NotFoundError: Network was not found.
:raise UserNotAuthorizedError: User dont have permission to perform operation.
:raise InvalidParameterError: Ip identifier is none or invalid.
:raise XMLError: Networkapi failed to generate the XML response.
:raise DataBaseError: Networkapi failed to access the database. | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.