Displays Information about Swarm Nodes with passing in the server

    server
        The minion/server name

    CLI Example:

    .. code-block:: bash

        salt '*' swarm.node_ls server=minion1

def node_ls(server=str):
    '''
    Displays Information about Swarm Nodes with passing in the server

    server
        The minion/server name

    CLI Example:

    .. code-block:: bash

        salt '*' swarm.node_ls server=minion1
    '''
    try:
        salt_return = {}
        client = docker.APIClient(base_url='unix://var/run/docker.sock')
        service = client.nodes(filters=({'name': server}))
        getdata = salt.utils.json.dumps(service)
        dump = salt.utils.json.loads(getdata)
        for items in dump:
            docker_version = items['Description']['Engine']['EngineVersion']
            platform = items['Description']['Platform']
            hostnames = items['Description']['Hostname']
            ids = items['ID']
            role = items['Spec']['Role']
            availability = items['Spec']['Availability']
            status = items['Status']
            version = items['Version']['Index']
            salt_return.update({'Docker Version': docker_version,
                                'Platform': platform,
                                'Hostname': hostnames,
                                'ID': ids,
                                'Roles': role,
                                'Availability': availability,
                                'Status': status,
                                'Version': version})
    except TypeError:
        salt_return = {}
        salt_return.update({'Error': 'The server arg is missing or you not targeting a Manager node?'})
    return salt_return