'List all nodes.
@inherits: :class:`NodeDriver.create_node`
:keyword  ex_node_ids: a list of node\'s ids used to filter nodes.
Only the nodes which\'s id in this list
will be returned.
:type   ex_node_ids: ``list`` of ``str``
:keyword  ex_filters: node attribute and value pairs to filter nodes.
Only the nodes which matchs all the pairs will
be returned.
If the filter attribute need a json array value,
use ``list`` object, the driver will convert it.
:type   ex_filters: ``dict``'

def list_nodes(self, ex_node_ids=None, ex_filters=None):

    params = {'Action': 'DescribeInstances', 'RegionId': self.region}
    if ex_node_ids:
        if isinstance(ex_node_ids, list):
            params['InstanceIds'] = self._list_to_json_array(ex_node_ids)
        else:
            raise AttributeError('ex_node_ids    should    be    a    list    of    node    ids.')
    if ex_filters:
        if isinstance(ex_filters, dict):
            params.update(ex_filters)
        else:
            raise AttributeError('ex_filters    should    be    a    dict    of    node    attributes.')
    nodes = self._request_multiple_pages(self.path, params, self._to_nodes)
    return nodes
