.. versionadded:: 2019.2.0

    Check that a private ip address is available within the specified
    virtual network.

    :param ip_address: The ip_address to query.

    :param virtual_network: The virtual network to query for the IP address
        in question.

    :param resource_group: The resource group name assigned to the
        virtual network.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.check_ip_address_availability 10.0.0.4 testnet testgroup

def check_ip_address_availability(ip_address, virtual_network, resource_group,
                                  **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Check that a private ip address is available within the specified
    virtual network.

    :param ip_address: The ip_address to query.

    :param virtual_network: The virtual network to query for the IP address
        in question.

    :param resource_group: The resource group name assigned to the
        virtual network.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.check_ip_address_availability 10.0.0.4 testnet testgroup

    '''
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        check_ip = netconn.virtual_networks.check_ip_address_availability(
            resource_group_name=resource_group,
            virtual_network_name=virtual_network,
            ip_address=ip_address)
        result = check_ip.as_dict()
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result