1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/25ea95428c50/ Changeset: 25ea95428c50 User: nsoranzo Date: 2014-10-31 16:16:20+00:00 Summary: API: Return also metrics for jobs when full=True and user is admin. Affected #: 1 file diff -r bd2ec092d2f57aa8526b7d6612403b7ae4354907 -r 25ea95428c508c7982a3f9ff2af855eac7c62dbb lib/galaxy/webapps/galaxy/api/jobs.py --- a/lib/galaxy/webapps/galaxy/api/jobs.py +++ b/lib/galaxy/webapps/galaxy/api/jobs.py @@ -89,6 +89,9 @@ :type id: string :param id: Specific job id + :type full: boolean + :param full: whether to return extra information + :rtype: dictionary :returns: dictionary containing full description of job data """ @@ -97,6 +100,12 @@ full_output = util.asbool( kwd.get( 'full', 'false' ) ) if full_output: job_dict.update( dict( stderr=job.stderr, stdout=job.stdout ) ) + if trans.user_is_admin(): + + def metric_to_dict(metric): + return dict(zip(['title', 'value'], trans.app.job_metrics.format(metric.plugin, metric.metric_name, metric.metric_value))) + + job_dict['job_metrics'] = [metric_to_dict(metric) for metric in job.metrics] return job_dict @expose_api @@ -248,11 +257,11 @@ ) ) for k, v in input_data.items(): - """ - Here we are attempting to link the inputs to the underlying dataset (not the dataset association) - This way, if the calulation was done using a copied HDA (copied from the library or another history) - the search will still find the job - """ + # Here we are attempting to link the inputs to the underlying + # dataset (not the dataset association). + # This way, if the calculation was done using a copied HDA + # (copied from the library or another history), the search will + # still find the job a = aliased( trans.app.model.JobToInputDatasetAssociation ) b = aliased( trans.app.model.HistoryDatasetAssociation ) query = query.filter( and_( @@ -264,9 +273,7 @@ out = [] for job in query.all(): - """ - check to make sure none of the output files have been deleted - """ + # check to make sure none of the output files have been deleted if all( list( a.dataset.deleted == False for a in job.output_datasets ) ): out.append( self.encode_all_ids( trans, job.to_dict( 'element' ), True ) ) return out Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.