Configure Target VPN Extended Communities
        Args:
            rbridge_id (str): rbridge-id for device.
            vrf_name (str): Name of the vrf (vrf101, vrf-1 etc).
            rt (str): Route Target(import/export/both).
            rt_value (str): Route Target Value  ASN:nn Target
                            VPN Extended Community.
            afi (str): Address family (ip/ipv6).
            get (bool): Get config instead of editing config.
                        List all the details of
                        all afi under all vrf(True, False)
            delete_rt (bool): True to delete the route-target under
                              address family (True, False).
                              Default value will be False if not
                              specified.
            delete_afi (bool): True to delet the ip/ipv6 address family
                Default value will be False if not specified.
            callback (function): A function executed upon completion of the
                method.  The only parameter passed to `callback` will be the
                ``ElementTree`` `config`.
        Returns:
            Return value of `callback`.
        Raises:
            KeyError: if `rbridge_id`,`vrf_name`, 'afi', 'rt', 'rt_value'
                      is not passed.
            ValueError: if `rbridge_id`, `vrf_name`, 'afi', 'rt', rt_value
                        is invalid.
        Examples:
            >>> import pynos.device
            >>> switches = ['10.24.39.211', '10.24.39.203']
            >>> auth = ('admin', 'password')
            >>> for switch in switches:
            ...     conn = (switch, '22')
            ...     with pynos.device.Device(conn=conn, auth=auth) as dev:
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1")
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1",delete_rt=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1",delete_afi=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", get=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", vrf_name="vrf2", get=True)

def vrf_afi_rt_evpn(self, **kwargs):
        """Configure Target VPN Extended Communities
        Args:
            rbridge_id (str): rbridge-id for device.
            vrf_name (str): Name of the vrf (vrf101, vrf-1 etc).
            rt (str): Route Target(import/export/both).
            rt_value (str): Route Target Value  ASN:nn Target
                            VPN Extended Community.
            afi (str): Address family (ip/ipv6).
            get (bool): Get config instead of editing config.
                        List all the details of
                        all afi under all vrf(True, False)
            delete_rt (bool): True to delete the route-target under
                              address family (True, False).
                              Default value will be False if not
                              specified.
            delete_afi (bool): True to delet the ip/ipv6 address family
                Default value will be False if not specified.
            callback (function): A function executed upon completion of the
                method.  The only parameter passed to `callback` will be the
                ``ElementTree`` `config`.
        Returns:
            Return value of `callback`.
        Raises:
            KeyError: if `rbridge_id`,`vrf_name`, 'afi', 'rt', 'rt_value'
                      is not passed.
            ValueError: if `rbridge_id`, `vrf_name`, 'afi', 'rt', rt_value
                        is invalid.
        Examples:
            >>> import pynos.device
            >>> switches = ['10.24.39.211', '10.24.39.203']
            >>> auth = ('admin', 'password')
            >>> for switch in switches:
            ...     conn = (switch, '22')
            ...     with pynos.device.Device(conn=conn, auth=auth) as dev:
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1")
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1",delete_rt=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", rt='import', rt_value='101:101',
            ...         vrf_name="vrf1",delete_afi=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", get=True)
            ...         output = dev.interface.vrf_vni(rbridge_id="1",
            ...         afi="ip", vrf_name="vrf2", get=True)

        """
        rbridge_id = kwargs['rbridge_id']
        afi = kwargs['afi']
        get_config = kwargs.pop('get', False)
        delete_rt = kwargs.pop('delete_rt', False)
        delete_afi = kwargs.pop('delete_afi', False)
        callback = kwargs.pop('callback', self._callback)
        result = []

        method_class = self._rbridge
        method_name = 'rbridge_id_vrf_address_family_%s_unicast_' \
                      'route_target_evpn' % afi
        vrf_rt = getattr(method_class, method_name)

        if not get_config:
            vrf_name = kwargs['vrf_name']
            rt = kwargs['rt']
            rt_value = kwargs['rt_value']
            rt_args = dict(rbridge_id=rbridge_id, vrf_name=vrf_name,
                           action=rt, target_community=rt_value)
            config = vrf_rt(**rt_args)

            if delete_afi is True:
                if config.find('.//*ipv6') is not None:
                    config.find('.//*ipv6').set('operation', 'delete')
                if config.find('.//*ip') is not None:
                    config.find('.//*ip').set('operation', 'delete')
            if delete_rt is True:
                config.find('.//*route-target').set('operation', 'delete')
            result = callback(config)

        elif get_config:
            vrf_name = kwargs.pop('vrf_name', '')

            rt_args = dict(rbridge_id=rbridge_id, vrf_name=vrf_name,
                           action='', target_community='')
            config = vrf_rt(**rt_args)
            output = callback(config, handler='get_config')
            for vrf_node in output.data.findall('.//{*}vrf'):
                afi = ''
                vrfrt = []
                vrfrtval = []
                vrfname = vrf_node.find('.//{*}vrf-name').text
                if vrf_node.find('.//{*}ip') is not None:
                    afi = "ip"
                    if vrf_node.find('.//{*}route-target') is not None:
                        for ipv4_action in vrf_node.findall('.//{*}action'):
                            rttemp = ipv4_action.text
                            vrfrt.append(rttemp)
                        for ipv4_rt in vrf_node.findall('.//{'
                                                        '*}target-community'):
                            valtemp = ipv4_rt.text
                            vrfrtval.append(valtemp)
                if vrf_node.find('.//{*}ipv6') is not None:
                    afi = "ipv6"
                    if vrf_node.find('.//{*}route-target') is not None:
                        for ipv6_action in vrf_node.findall('.//{*}action'):
                            rttemp = ipv6_action.text
                            vrfrt.append(rttemp)
                        for ipv6_rt in vrf_node.findall('.//{'
                                                        '*}target-community'):
                            valtemp = ipv6_rt.text
                            vrfrtval.append(valtemp)

                tmp = {'rbridge_id': rbridge_id, 'vrf_name': vrfname,
                       'afi': afi, 'rt': vrfrt, 'rtvalue': vrfrtval}
                result.append(tmp)

        return result