text_prompt
stringlengths
157
13.1k
code_prompt
stringlengths
7
19.8k
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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 con...
return super(ApiVipRequest, self).get(self.prepare_url('api/v3/vip-request/', kwargs))
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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/' % ';'.join(vips_ids), data)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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(ApiVipRequest, self).delete(url)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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 a...
#optionpool_map = dict() #optionpool_map['type'] = tipo_opcao #optionpool_map['name'] = nome_opcao url='api/pools/options/save/' return self.post(url, {'type': tipo_opcao, "name":nome_opcao })
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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 a...
if not is_valid_int_param(id_option_pool): raise InvalidParameterError( u'The identifier of Option Pool is invalid or was not informed.') #optionpool_map = dict() #optionpool_map['type'] = tipo_opcao #optionpool_map['name'] = nome_opcao_txt url = '...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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...
if not is_valid_int_param(id_option_pool): raise InvalidParameterError( u'The identifier of Option Pool is invalid or was not informed.') url = 'api/pools/options/' + str(id_option_pool) + '/' return self.delete(url)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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...
if not is_valid_int_param(id_option_pool): raise InvalidParameterError( u'The identifier of Option Pool is invalid or was not informed.') url = 'api/pools/options/' + str(id_option_pool) + '/' return self.get(url)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def get_all_option_pool(self, option_type=None): """Get all Option Pool. :return: Dictionary with the following structure: :: {[{‘id’: < id >, ‘type’: < tipo_opc...
if option_type: url = 'api/pools/options/?type='+option_type else: url = 'api/pools/options/' return self.get(url)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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...
url='api/pools/environment_options/' if id_environment: if option_id: if option_type: url = url + "?environment_id=" + str(id_environment)+ "&option_id=" + str(option_id) + "&option_type=" + option_type else: url = u...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def associate_environment_option_pool(self, id_option_pool, id_environment): """Create a relationship of optionpool with Environment. :param id_option_pool: Iden...
if not is_valid_int_param(id_option_pool): raise InvalidParameterError( u'The identifier of Option Pool is invalid or was not informed.') if not is_valid_int_param(id_environment): raise InvalidParameterError( u'The identifier of Environment Poo...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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-z...
filter_map = dict() filter_map['name'] = name filter_map['description'] = description code, xml = self.submit({'filter': filter_map}, 'POST', 'filter/') return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def alter(self, id_filter, name, description): """Change Filter by the identifier. :param id_filter: Identifier of the Filter. Integer value and greater than zer...
if not is_valid_int_param(id_filter): raise InvalidParameterError( u'The identifier of Filter is invalid or was not informed.') filter_map = dict() filter_map['name'] = name filter_map['description'] = description url = 'filter/' + str(id_filter) +...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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 :...
if not is_valid_int_param(id_filter): raise InvalidParameterError( u'The identifier of Filter is invalid or was not informed.') url = 'filter/' + str(id_filter) + '/' code, xml = self.submit(None, 'DELETE', url) return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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: ::...
url = 'filter/get/' + str(id_filter) + '/' code, xml = self.submit(None, 'GET', url) return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def associate(self, et_id, id_filter): """Create a relationship between Filter and TipoEquipamento. :param et_id: Identifier of TipoEquipamento. Integer value an...
if not is_valid_int_param(et_id): raise InvalidParameterError( u'The identifier of TipoEquipamento is invalid or was not informed.') if not is_valid_int_param(id_filter): raise InvalidParameterError( u'The identifier of Filter is invalid or was ...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dissociate(self, id_filter, id_eq_type): """Removes relationship between Filter and TipoEquipamento. :param id_filter: Identifier of Filter. Integer value an...
if not is_valid_int_param(id_filter): raise InvalidParameterError( u'The identifier of Filter is invalid or was not informed.') if not is_valid_int_param(id_eq_type): raise InvalidParameterError( u'The identifier of TipoEquipamento is invalid or...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def search(self, id_egroup): """Search Group Equipament from by the identifier. :param id_egroup: Identifier of the Group Equipament. Integer value and greater t...
if not is_valid_int_param(id_egroup): raise InvalidParameterError( u'The identifier of Group Equipament is invalid or was not informed.') url = 'egroup/' + str(id_egroup) + '/' code, xml = self.submit(None, 'GET', url) return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def inserir(self, name): """Inserts a new Logical Environment and returns its identifier. :param name: Logical Environment name. String with a minimum 2 and maxi...
logical_environment_map = dict() logical_environment_map['name'] = name code, xml = self.submit( {'logical_environment': logical_environment_map}, 'POST', 'logicalenvironment/') return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def alterar(self, id_logicalenvironment, name): """Change Logical Environment from by the identifier. :param id_logicalenvironment: Identifier of the Logical Env...
if not is_valid_int_param(id_logicalenvironment): raise InvalidParameterError( u'The identifier of Logical Environment is invalid or was not informed.') url = 'logicalenvironment/' + str(id_logicalenvironment) + '/' logical_environment_map = dict() logical...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def remover(self, id_logicalenvironment): """Remove Logical Environment from by the identifier. :param id_logicalenvironment: Identifier of the Logical Environme...
if not is_valid_int_param(id_logicalenvironment): raise InvalidParameterError( u'The identifier of Logical Environment is invalid or was not informed.') url = 'logicalenvironment/' + str(id_logicalenvironment) + '/' code, xml = self.submit(None, 'DELETE', url) ...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def list_by_group(self, id_ugroup): """Search Administrative Permission by Group User by identifier. :param id_ugroup: Identifier of the Group User. Integer valu...
if id_ugroup is None: raise InvalidParameterError( u'The identifier of Group User is invalid or was not informed.') url = 'aperms/group/' + str(id_ugroup) + '/' code, xml = self.submit(None, 'GET', url) return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def search(self, id_perm): """Search Administrative Permission from by the identifier. :param id_perm: Identifier of the Administrative Permission. Integer value...
if not is_valid_int_param(id_perm): raise InvalidParameterError( u'The identifier of Administrative Permission is invalid or was not informed.') url = 'aperms/get/' + str(id_perm) + '/' code, xml = self.submit(None, 'GET', url) return self.response(code, ...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def inserir(self, id_permission, read, write, id_group): """Inserts a new Administrative Permission and returns its identifier. :param id_permission: Identifier ...
perms_map = dict() perms_map['id_permission'] = id_permission perms_map['read'] = read perms_map['write'] = write perms_map['id_group'] = id_group code, xml = self.submit( {'administrative_permission': perms_map}, 'POST', 'aperms/') return self.resp...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def alterar(self, id_perm, id_permission, read, write, id_group): """Change Administrative Permission from by the identifier. :param id_perm: Identifier of the A...
if not is_valid_int_param(id_perm): raise InvalidParameterError( u'The identifier of Administrative Permission is invalid or was not informed.') url = 'aperms/' + str(id_perm) + '/' perms_map = dict() perms_map['id_perm'] = id_perm perms_map['id_per...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def remover(self, id_perms): """Remove Administrative Permission from by the identifier. :param id_perms: Identifier of the Administrative Permission. Integer va...
if not is_valid_int_param(id_perms): raise InvalidParameterError( u'The identifier of Administrative Permission is invalid or was not informed.') url = 'aperms/' + str(id_perms) + '/' code, xml = self.submit(None, 'DELETE', url) return self.response(code, ...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_ambiente(self): """Get an instance of ambiente services facade."""
return Ambiente( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_rule(self): """Get an instance of block rule services facade."""
return BlockRule( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_equipamento(self): """Get an instance of equipamento services facade."""
return Equipamento( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_log(self): """Get an instance of log services facade."""
return EventLog( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_filter(self): """Get an instance of filter services facade."""
return Filter( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_interface(self): """Get an instance of interface services facade."""
return Interface( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_ip(self): """Get an instance of ip services facade."""
return Ip( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_marca(self): """Get an instance of marca services facade."""
return Marca( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_modelo(self): """Get an instance of modelo services facade."""
return Modelo( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_dhcprelay_ipv4(self): """Get an instance of DHCPRelayIPv4 services facade."""
return DHCPRelayIPv4( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_dhcprelay_ipv6(self): """Get an instance of DHCPRelayIPv6 services facade."""
return DHCPRelayIPv6( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_permission(self): """Get an instance of permission services facade."""
return Permission( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_rack(self): """Get an instance of rack services facade."""
return Rack( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_rackservers(self): """Get an instance of rackservers services facade."""
return RackServers( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_roteiro(self): """Get an instance of roteiro services facade."""
return Roteiro( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_usuario(self): """Get an instance of usuario services facade."""
return Usuario( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create_vip(self): """Get an instance of vip services facade."""
return Vip( self.networkapi_url, self.user, self.password, self.user_ldap)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def deploy(self, id_networkv6): """Deploy network in equipments and set column 'active = 1' in tables redeipv6 ] :param id_networkv6: ID for NetworkIPv6 :return:...
data = dict() uri = 'api/networkv6/%s/equipments/' % id_networkv6 return super(ApiNetworkIPv6, self).post(uri, data=data)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def undeploy(self, id_networkv6): """Remove deployment of network in equipments and set column 'active = 0' in tables redeipv6 ] :param id_networkv6: ID for Netw...
uri = 'api/networkv6/%s/equipments/' % id_networkv6 return super(ApiNetworkIPv6, self).delete(uri)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def create(self, networkipv6s): """ Method to create network-ipv6's :param networkipv6s: List containing networkipv6's desired to be created on database :return:...
data = {'networks': networkipv6s} return super(ApiNetworkIPv6, self).post('api/v3/networkv6/', data)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def list_all(self): """ List all environment vips :return: Following dictionary: :: {'environment_vip': [{'id': <id>, 'finalidade_txt': <finalidade_txt>, 'client...
url = 'environmentvip/all/' code, xml = self.submit(None, 'GET', url) key = 'environment_vip' return get_list_map(self.response(code, xml, [key]), key)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def list_all_available(self, id_vlan): """ List all environment vips availables :return: Following dictionary: :: {'environment_vip': [{'id': <id>, 'finalidade_t...
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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def add(self, finalidade_txt, cliente_txt, ambiente_p44_txt, description): """Inserts a new Environment VIP and returns its identifier. :param finalidade_txt: Fi...
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( ...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def alter( self, id_environment_vip, finalidade_txt, cliente_txt, ambiente_p44_txt, description): """Change Environment VIP from by the identifier. :param id_env...
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_t...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def remove(self, id_environment_vip): """Remove Environment VIP from by the identifier. :param id_environment_vip: Identifier of the Environment VIP. Integer val...
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 s...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: 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 ...
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.sub...
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def buscar_finalidade(self): """Search finalidade_txt environment vip :return: Dictionary with the following structure: :: {‘finalidade’: ‘finalidade’: <'finalid...
url = 'environment-vip/get/finality' code, xml = self.submit(None, 'GET', url) return self.response(code, xml)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def buscar_cliente_por_finalidade(self, finalidade_txt): """Search cliente_txt environment vip :return: Dictionary with the following structure: :: {‘cliente_txt...
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)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def buscar_ambientep44_por_finalidade_cliente( self, finalidade_txt, cliente_txt): """Search ambiente_p44_txt environment vip :return: Dictionary with the follow...
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)