'List all nodes.
:param ex_resource_group: List nodes in a specific resource group.
:type ex_urn: ``str``
:param ex_fetch_nic: Fetch NIC resources in order to get
IP address information for nodes (requires extra API calls).
:type ex_urn: ``bool``
:return:  list of node objects
:rtype: ``list`` of :class:`.Node`'

def list_nodes(self, ex_resource_group=None, ex_fetch_nic=True):

    if ex_resource_group:
        action = ('/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines' % (self.subscription_id, ex_resource_group))
    else:
        action = ('/subscriptions/%s/providers/Microsoft.Compute/virtualMachines' % self.subscription_id)
    r = self.connection.request(action, params={'api-version': '2015-06-15'})
    return [self._to_node(n, fetch_nic=ex_fetch_nic) for n in r.object['value']]
