Set VCS Virtual IP.

        Args:
            vip (str): IPv4/IPv6 Virtual IP Address.
            rbridge_id (str): rbridge-id for device. Only required when type is
                `ve`.
            delete (bool): Deletes the virtual ip if `delete` is ``True``.
            get (bool): Get config instead of editing config. (True, False)
            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 `vip` is not passed.
            ValueError: if `vip` 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:
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24')
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64')
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               delete=True)
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               get=True)
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',delete=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               delete=True)

def vcs_vip(self, **kwargs):
        """Set VCS Virtual IP.

        Args:
            vip (str): IPv4/IPv6 Virtual IP Address.
            rbridge_id (str): rbridge-id for device. Only required when type is
                `ve`.
            delete (bool): Deletes the virtual ip if `delete` is ``True``.
            get (bool): Get config instead of editing config. (True, False)
            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 `vip` is not passed.
            ValueError: if `vip` 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:
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24')
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64')
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               delete=True)
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',get=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               get=True)
            ...         dev.interface.vcs_vip(vip='10.1.1.1/24',delete=True)
            ...         dev.interface.vcs_vip(vip='fe80::cafe:beef:1000:1/64',
            ...                               delete=True)
        """

        get_config = kwargs.pop('get', False)
        delete = kwargs.pop('delete', False)
        callback = kwargs.pop('callback', self._callback)
        method_class = self._vcs

        if not get_config:
            vip = str(kwargs.pop('vip'))
            ipaddress = ip_interface(unicode(vip))
            vcs_vip = None

            if ipaddress.version == 4:
                method_name = 'vcs_virtual_ip_address_address'
                vcs_args = dict(address=vip)
                vcs_vip = getattr(method_class, method_name)
            elif ipaddress.version == 6:
                method_name = 'vcs_virtual_ipv6_address_ipv6address'
                vcs_args = dict(ipv6address=vip)
                vcs_vip = getattr(method_class, method_name)

            if not delete:
                config = vcs_vip(**vcs_args)
            else:
                if ipaddress.version == 4:
                    config = vcs_vip(**vcs_args)
                    config.find('.//*address').set('operation', 'delete')
                elif ipaddress.version == 6:
                    config = vcs_vip(**vcs_args)
                    config.find('.//*ipv6address').set('operation', 'delete')

        elif get_config:
            vip_info = {}

            method_name = 'vcs_virtual_ip_address_address'
            vcs_args = dict(address='')
            vcs_vip = getattr(method_class, method_name)
            config = vcs_vip(**vcs_args)
            vip_info['ipv4_vip'] = callback(config, handler='get_config')

            method_name = 'vcs_virtual_ipv6_address_ipv6address'
            vcs_args = dict(ipv6address='')
            vcs_vip = getattr(method_class, method_name)
            config = vcs_vip(**vcs_args)
            vip_info['ipv6_vip'] = callback(config, handler='get_config')
            return vip_info

        return callback(config)