::
        
            GET /:login/machines
        
        Query for machines in the current DataCenter matching the input 
        criteria, returning a :py:class:`list` of instantiated 
        :py:class:`smartdc.machine.Machine` objects.
        
        :param machine_type: virtualmachine or smartmachine
        :type machine_type: :py:class:`basestring`
        
        :param name: machine name to find (will make the return list size 
            1 or 0)
        :type name: :py:class:`basestring`
        
        :param dataset: unique ID or URN for a dataset
        :type dataset: :py:class:`basestring` or :py:class:`dict`
        
        :param state: current running state
        :type state: :py:class:`basestring`
        
        :param memory: current size of the RAM deployed for the machine (Mb)
        :type memory: :py:class:`int`
        
        :param tombstone: include machines destroyed in the last N minutes
        :type tombstone: :py:class:`int`
        
        :param tags: keys and values to query in the machines' tag space
        :type tags: :py:class:`dict`
        
        :param credentials: whether to include the generated credentials for 
            machines, if present
        :type credentials: :py:class:`bool`
        
        :param paged: whether to return in pages
        :type paged: :py:class:`bool`
        
        :param limit: return N machines
        :type limit: :py:class:`int`
        
        :param offset: get the next `limit` of machines starting at this point
        :type offset: :py:class:`int`
        
        :rtype: :py:class:`list` of :py:class:`smartdc.machine.Machine`\s
        
        The `limit` and `offset` are the REST API's raw paging mechanism. 
        Alternatively, one can let `paged` remain `False`, and let the method 
        call attempt to collect all of the machines in multiple calls.

def machines(self, machine_type=None, name=None, dataset=None, state=None, 
            memory=None, tombstone=None, tags=None, credentials=False, 
            paged=False, limit=None, offset=None):
        """
        ::
        
            GET /:login/machines
        
        Query for machines in the current DataCenter matching the input 
        criteria, returning a :py:class:`list` of instantiated 
        :py:class:`smartdc.machine.Machine` objects.
        
        :param machine_type: virtualmachine or smartmachine
        :type machine_type: :py:class:`basestring`
        
        :param name: machine name to find (will make the return list size 
            1 or 0)
        :type name: :py:class:`basestring`
        
        :param dataset: unique ID or URN for a dataset
        :type dataset: :py:class:`basestring` or :py:class:`dict`
        
        :param state: current running state
        :type state: :py:class:`basestring`
        
        :param memory: current size of the RAM deployed for the machine (Mb)
        :type memory: :py:class:`int`
        
        :param tombstone: include machines destroyed in the last N minutes
        :type tombstone: :py:class:`int`
        
        :param tags: keys and values to query in the machines' tag space
        :type tags: :py:class:`dict`
        
        :param credentials: whether to include the generated credentials for 
            machines, if present
        :type credentials: :py:class:`bool`
        
        :param paged: whether to return in pages
        :type paged: :py:class:`bool`
        
        :param limit: return N machines
        :type limit: :py:class:`int`
        
        :param offset: get the next `limit` of machines starting at this point
        :type offset: :py:class:`int`
        
        :rtype: :py:class:`list` of :py:class:`smartdc.machine.Machine`\s
        
        The `limit` and `offset` are the REST API's raw paging mechanism. 
        Alternatively, one can let `paged` remain `False`, and let the method 
        call attempt to collect all of the machines in multiple calls.
        """
        params = {}
        if machine_type:
            params['type'] = machine_type
        if name:
            params['name'] = name
        if dataset:
            if isinstance(dataset, dict):
                dataset = dataset.get('urn', dataset['id'])
            params['dataset'] = dataset
        if state:
            params['state'] = state
        if memory:
            params['memory'] = memory
        if tombstone:
            params['tombstone'] = tombstone
        if tags:
            for k, v in tags.items():
                params['tag.' + str(k)] = v
        if credentials:
            params['credentials'] = True
        if limit:
            params['limit'] = limit
        else:
            limit = 1000
        if offset:
            params['offset'] = offset
        else:
            offset = 0
        machines = []
        while True:
            j, r = self.request('GET', '/machines', params=params)
            machines.extend(j)
            if not paged:
                query_limit = int(r.headers['x-query-limit'])
                resource_count = int(r.headers['x-resource-count'])
                if resource_count > query_limit:
                    data['offset'] = (params.get('offset', offset) + 
                                      params.get('limit', limit)    )
                else:
                    break
            else:
                break
        return [Machine(datacenter=self, data=m) for m in machines]