List all available public IPs.

    CLI Example:
    .. code-block:: bash

        salt-cloud -f list_public_ips <provider>

    To list unavailable (assigned) IPs, use:

    CLI Example:
    .. code-block:: bash

        salt-cloud -f list_public_ips <provider> state=assigned

    .. versionadded:: 2015.8.0

def list_public_ips(kwargs=None, call=None):
    '''
    List all available public IPs.

    CLI Example:
    .. code-block:: bash

        salt-cloud -f list_public_ips <provider>

    To list unavailable (assigned) IPs, use:

    CLI Example:
    .. code-block:: bash

        salt-cloud -f list_public_ips <provider> state=assigned

    .. versionadded:: 2015.8.0
    '''
    if kwargs is None:
        kwargs = {}

    args = {}
    if 'state' in kwargs:
        if kwargs['state'] == 'assigned':
            args['ip.state'] = 'Assigned'
        else:
            args['ip.state'] = 'Unassigned'
    else:
        args['ip.state'] = 'Unassigned'

    args['ip.type'] = 'Public'

    response = _query('grid', 'ip/list', args=args)

    ret = {}
    for item in response['list']:
        name = item['ip']
        ret[name] = item

    return ret