Set vrrpe VIP.

        Args:
            int_type (str): Type of interface. (gigabitethernet,
                tengigabitethernet, ve, etc).
            name (str): Name of interface. (1/0/5, 1/0/10, VE name etc).
            vrid (str): vrrpev3 ID.
            get (bool): Get config instead of editing config. (True, False)
            delete (bool): True, the VIP address is added and False if its to
                be deleted (True, False). Default value will be False if not
                specified.
            vip (str): IPv4/IPv6 Virtual IP Address.
            rbridge_id (str): rbridge-id for device. Only required when type is
                `ve`.
            callback (function): A function executed upon completion of the
                method.  The only parameter passed to `callback` will be the
                ``ElementTree`` `config`.

        Raises:
            KeyError: if `int_type`, `name`, `vrid`, or `vip` is not passed.
            ValueError: if `int_type`, `name`, `vrid`, or `vip` is invalid.

        Returns:
            Return value of `callback`.

        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.vrrpe_vip(int_type='ve',
            ...         name='89', rbridge_id = '1',
            ...         vrid='11', vip='10.0.1.10')
            ...         output = dev.interface.vrrpe_vip(get=True,
            ...         int_type='ve', name='89', rbridge_id = '1')
            ...         output =dev.interface.vrrpe_vip(delete=True,
            ...         int_type='ve', name='89', rbridge_id = '1',vrid='1',
            ...         vip='10.0.0.10')

def vrrpe_vip(self, **kwargs):
        """Set vrrpe VIP.

        Args:
            int_type (str): Type of interface. (gigabitethernet,
                tengigabitethernet, ve, etc).
            name (str): Name of interface. (1/0/5, 1/0/10, VE name etc).
            vrid (str): vrrpev3 ID.
            get (bool): Get config instead of editing config. (True, False)
            delete (bool): True, the VIP address is added and False if its to
                be deleted (True, False). Default value will be False if not
                specified.
            vip (str): IPv4/IPv6 Virtual IP Address.
            rbridge_id (str): rbridge-id for device. Only required when type is
                `ve`.
            callback (function): A function executed upon completion of the
                method.  The only parameter passed to `callback` will be the
                ``ElementTree`` `config`.

        Raises:
            KeyError: if `int_type`, `name`, `vrid`, or `vip` is not passed.
            ValueError: if `int_type`, `name`, `vrid`, or `vip` is invalid.

        Returns:
            Return value of `callback`.

        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.vrrpe_vip(int_type='ve',
            ...         name='89', rbridge_id = '1',
            ...         vrid='11', vip='10.0.1.10')
            ...         output = dev.interface.vrrpe_vip(get=True,
            ...         int_type='ve', name='89', rbridge_id = '1')
            ...         output =dev.interface.vrrpe_vip(delete=True,
            ...         int_type='ve', name='89', rbridge_id = '1',vrid='1',
            ...         vip='10.0.0.10')
        """

        int_type = kwargs.pop('int_type').lower()
        name = kwargs.pop('name',)
        vip = kwargs.pop('vip', '')
        get = kwargs.pop('get', False)
        delete = kwargs.pop('delete', False)
        callback = kwargs.pop('callback', self._callback)
        valid_int_types = ['gigabitethernet', 'tengigabitethernet',
                           'fortygigabitethernet', 'hundredgigabitethernet',
                           'port_channel', 've']

        if vip != '':
            ipaddress = ip_interface(unicode(vip))
            version = ipaddress.version
        else:
            version = 4

        if int_type not in valid_int_types:
            raise ValueError('`int_type` must be one of: %s' %
                             repr(valid_int_types))
        if delete:
            vrid = kwargs.pop('vrid')
            rbridge_id = kwargs.pop('rbridge_id', '1')
            vrrpe_args = dict(rbridge_id=rbridge_id, name=name,
                              vrid=vrid, virtual_ipaddr=vip)
        elif get:
            rbridge_id = kwargs.pop('rbridge_id', '1')
            vrrpe_args = dict(name=name, vrid='', virtual_ipaddr='')
        else:
            vrid = kwargs.pop('vrid')
            ipaddress = ip_interface(unicode(vip))
            if int_type == 've':
                rbridge_id = kwargs.pop('rbridge_id', '1')
            vrrpe_args = dict(name=name, vrid=vrid,
                              virtual_ipaddr=str(ipaddress.ip))
        method_name = None
        method_class = self._interface
        if version == 4:
            vrrpe_args['version'] = '3'
            method_name = 'interface_%s_vrrpe_virtual_ip_virtual_' \
                          'ipaddr' % int_type
        elif version == 6:
            method_name = 'interface_%s_ipv6_vrrpv3e_group_virtual_ip_' \
                          'virtual_ipaddr' % int_type

        if int_type == 've':
            method_name = 'rbridge_id_%s' % method_name
            if version == 6:
                method_name = method_name.replace('group_', '')
            method_class = self._rbridge
            vrrpe_args['rbridge_id'] = rbridge_id
            if not pynos.utilities.valid_vlan_id(name):
                raise InvalidVlanId("`name` must be between `1` and `8191`")
        elif not pynos.utilities.valid_interface(int_type, name):
            raise ValueError('`name` must be in the format of x/y/z for '
                             'physical interfaces or x for port channel.')

        vrrpe_vip = getattr(method_class, method_name)
        config = vrrpe_vip(**vrrpe_args)
        result = []

        if delete:
            config.find('.//*virtual-ip').set('operation', 'delete')
        if get:
            output = callback(config, handler='get_config')
            for item in output.data.findall('.//{*}vrrpe'):
                vrid = item.find('.//{*}vrid').text
                if item.find('.//{*}virtual-ipaddr') is not None:
                    vip = item.find('.//{*}virtual-ipaddr').text
                else:
                    vip = ''
                tmp = {"vrid": vrid,
                       "vip": vip}
                result.append(tmp)
        else:
            result = callback(config)

        return result