qiskit/backends/ibmq/ibmqbackend.py
def jobs(self, limit=50, skip=0, status=None, db_filter=None):
        """Attempt to get the jobs submitted to the backend.

        Args:
            limit (int): number of jobs to retrieve
            skip (int): starting index of retrieval
            status (None or JobStatus or str): only get jobs with this status,
                where status is e.g. `JobStatus.RUNNING` or `'RUNNING'`
            db_filter (dict): `loopback-based filter
                <https://loopback.io/doc/en/lb2/Querying-data.html>`_.
                This is an interface to a database ``where`` filter. Some
                examples of its usage are:

                Filter last five jobs with errors::

                   job_list = backend.jobs(limit=5, status=JobStatus.ERROR)

                Filter last five jobs with counts=1024, and counts for
                states ``00`` and ``11`` each exceeding 400::

                  cnts_filter = {'shots': 1024,
                                 'qasms.result.data.counts.00': {'gt': 400},
                                 'qasms.result.data.counts.11': {'gt': 400}}
                  job_list = backend.jobs(limit=5, db_filter=cnts_filter)

                Filter last five jobs from 30 days ago::

                   past_date = datetime.datetime.now() - datetime.timedelta(days=30)
                   date_filter = {'creationDate': {'lt': past_date.isoformat()}}
                   job_list = backend.jobs(limit=5, db_filter=date_filter)

        Returns:
            list(IBMQJob): list of IBMQJob instances

        Raises:
            IBMQBackendValueError: status keyword value unrecognized
        """
        backend_name = self.configuration()['name']
        api_filter = {'backend.name': backend_name}
        if status:
            if isinstance(status, str):
                status = JobStatus[status]
            if status == JobStatus.RUNNING:
                this_filter = {'status': 'RUNNING',
                               'infoQueue': {'exists': False}}
            elif status == JobStatus.QUEUED:
                this_filter = {'status': 'RUNNING',
                               'infoQueue.status': 'PENDING_IN_QUEUE'}
            elif status == JobStatus.CANCELLED:
                this_filter = {'status': 'CANCELLED'}
            elif status == JobStatus.DONE:
                this_filter = {'status': 'COMPLETED'}
            elif status == JobStatus.ERROR:
                this_filter = {'status': {'regexp': '^ERROR'}}
            else:
                raise IBMQBackendValueError('unrecongized value for "status" keyword '
                                            'in job filter')
            api_filter.update(this_filter)
        if db_filter:
            # status takes precendence over db_filter for same keys
            api_filter = {**db_filter, **api_filter}
        job_info_list = self._api.get_jobs(limit=limit, skip=skip,
                                           filter=api_filter)
        job_list = []
        for job_info in job_info_list:
            job_class = _job_class_from_job_response(job_info)
            is_device = not bool(self._configuration.get('simulator'))
            job = job_class(self, job_info.get('id'), self._api, is_device,
                            creation_date=job_info.get('creationDate'))
            job_list.append(job)
        return job_list
Attempt to get the jobs submitted to the backend.

        Args:
            limit (int): number of jobs to retrieve
            skip (int): starting index of retrieval
            status (None or JobStatus or str): only get jobs with this status,
                where status is e.g. `JobStatus.RUNNING` or `'RUNNING'`
            db_filter (dict): `loopback-based filter
                <https://loopback.io/doc/en/lb2/Querying-data.html>`_.
                This is an interface to a database ``where`` filter. Some
                examples of its usage are:

                Filter last five jobs with errors::

                   job_list = backend.jobs(limit=5, status=JobStatus.ERROR)

                Filter last five jobs with counts=1024, and counts for
                states ``00`` and ``11`` each exceeding 400::

                  cnts_filter = {'shots': 1024,
                                 'qasms.result.data.counts.00': {'gt': 400},
                                 'qasms.result.data.counts.11': {'gt': 400}}
                  job_list = backend.jobs(limit=5, db_filter=cnts_filter)

                Filter last five jobs from 30 days ago::

                   past_date = datetime.datetime.now() - datetime.timedelta(days=30)
                   date_filter = {'creationDate': {'lt': past_date.isoformat()}}
                   job_list = backend.jobs(limit=5, db_filter=date_filter)

        Returns:
            list(IBMQJob): list of IBMQJob instances

        Raises:
            IBMQBackendValueError: status keyword value unrecognized
        
Attempt to get the jobs submitted to the backend.
Attempt to get the jobs submitted to the backend .
def jobs(self, limit=50, skip=0, status=None, db_filter=None):
        backend_name = self.configuration()['name']
        api_filter = {'backend.name': backend_name}
        if status:
            if isinstance(status, str):
                status = JobStatus[status]
            if status == JobStatus.RUNNING:
                this_filter = {'status': 'RUNNING',
                               'infoQueue': {'exists': False}}
            elif status == JobStatus.QUEUED:
                this_filter = {'status': 'RUNNING',
                               'infoQueue.status': 'PENDING_IN_QUEUE'}
            elif status == JobStatus.CANCELLED:
                this_filter = {'status': 'CANCELLED'}
            elif status == JobStatus.DONE:
                this_filter = {'status': 'COMPLETED'}
            elif status == JobStatus.ERROR:
                this_filter = {'status': {'regexp': '^ERROR'}}
            else:
                raise IBMQBackendValueError('unrecongized value for "status" keyword '
                                            'in job filter')
            api_filter.update(this_filter)
        if db_filter:
            api_filter = {**db_filter, **api_filter}
        job_info_list = self._api.get_jobs(limit=limit, skip=skip,
                                           filter=api_filter)
        job_list = []
        for job_info in job_info_list:
            job_class = _job_class_from_job_response(job_info)
            is_device = not bool(self._configuration.get('simulator'))
            job = job_class(self, job_info.get('id'), self._api, is_device,
                            creation_date=job_info.get('creationDate'))
            job_list.append(job)
        return job_list
def jobs ( self , limit = 50 , skip = 0 , status = None , db_filter = None ) : backend_name = self . configuration ( ) [ 'name' ] api_filter = { 'backend.name' : backend_name } if status : if isinstance ( status , str ) : status = JobStatus [ status ] if status == JobStatus . RUNNING : this_filter = { 'status' : 'RUNNING' , 'infoQueue' : { 'exists' : False } } elif status == JobStatus . QUEUED : this_filter = { 'status' : 'RUNNING' , 'infoQueue.status' : 'PENDING_IN_QUEUE' } elif status == JobStatus . CANCELLED : this_filter = { 'status' : 'CANCELLED' } elif status == JobStatus . DONE : this_filter = { 'status' : 'COMPLETED' } elif status == JobStatus . ERROR : this_filter = { 'status' : { 'regexp' : '^ERROR' } } else : raise IBMQBackendValueError ( 'unrecongized value for "status" keyword ' 'in job filter' ) api_filter . update ( this_filter ) if db_filter : api_filter = { ** db_filter , ** api_filter } job_info_list = self . _api . get_jobs ( limit = limit , skip = skip , filter = api_filter ) job_list = [ ] for job_info in job_info_list : job_class = _job_class_from_job_response ( job_info ) is_device = not bool ( self . _configuration . get ( 'simulator' ) ) job = job_class ( self , job_info . get ( 'id' ) , self . _api , is_device , creation_date = job_info . get ( 'creationDate' ) ) job_list . append ( job ) return job_list
Attempt to get the jobs submitted to the backend.
Attempt to get the jobs submitted to the backend .
"""Attempt to get the jobs submitted to the backend.

        Args:
            limit (int): number of jobs to retrieve
            skip (int): starting index of retrieval
            status (None or JobStatus or str): only get jobs with this status,
                where status is e.g. `JobStatus.RUNNING` or `'RUNNING'`
            db_filter (dict): `loopback-based filter
                <https://loopback.io/doc/en/lb2/Querying-data.html>`_.
                This is an interface to a database ``where`` filter. Some
                examples of its usage are:

                Filter last five jobs with errors::

                   job_list = backend.jobs(limit=5, status=JobStatus.ERROR)

                Filter last five jobs with counts=1024, and counts for
                states ``00`` and ``11`` each exceeding 400::

                  cnts_filter = {'shots': 1024,
                                 'qasms.result.data.counts.00': {'gt': 400},
                                 'qasms.result.data.counts.11': {'gt': 400}}
                  job_list = backend.jobs(limit=5, db_filter=cnts_filter)

                Filter last five jobs from 30 days ago::

                   past_date = datetime.datetime.now() - datetime.timedelta(days=30)
                   date_filter = {'creationDate': {'lt': past_date.isoformat()}}
                   job_list = backend.jobs(limit=5, db_filter=date_filter)

        Returns:
            list(IBMQJob): list of IBMQJob instances

        Raises:
            IBMQBackendValueError: status keyword value unrecognized
        """ # status takes precendence over db_filter for same keys
list of IBMQJob instances
list of IBMQJob instances
list(IBMQJob)
status keyword value unrecognized
status keyword value unrecognized
IBMQBackendValueError
self
limit
number of jobs to retrieve
number of jobs to retrieve
skip
starting index of retrieval
starting index of retrieval
status
only get jobs with this status,
where status is e.g. `JobStatus.RUNNING` or `'RUNNING'`
only get jobs with this status where status is e . g . ` JobStatus . RUNNING ` or ` ' RUNNING ' `
db_filter
`loopback-based filter
`_.
This is an interface to a database ``where`` filter. Some
examples of its usage are.

Filter last five jobs with errors:.

job_list = backend.jobs(limit=5, status=JobStatus.ERROR)

Filter last five jobs with counts=1024, and counts for
states ``00`` and ``11`` each exceeding 400:.



Filter last five jobs from 30 days ago:.

past_date = datetime.datetime.now() - datetime.timedelta(days=30)
date_filter = {'creationDate': {'lt': past_date.isoformat()}}
job_list = backend.jobs(limit=5, db_filter=date_filter)
` loopback - based filter ` _ . This is an interface to a database ` ` where ` ` filter . Some examples of its usage are . Filter last five jobs with errors : . job_list = backend . jobs ( limit = 5 status = JobStatus . ERROR ) Filter last five jobs with counts = 1024 and counts for states ` ` 00 ` ` and ` ` 11 ` ` each exceeding 400 : . Filter last five jobs from 30 days ago : . past_date = datetime . datetime . now () - datetime . timedelta ( days = 30 ) date_filter = { ' creationDate ' : { ' lt ' : past_date . isoformat () }} job_list = backend . jobs ( limit = 5 db_filter = date_filter )