@api_experimental.route('<STR_LIT>', methods=['<STR_LIT:GET>'])<EOL>@requires_authentication<EOL>def dag_runs(dag_id):
try:<EOL><INDENT>state = request.args.get('<STR_LIT:state>')<EOL>dagruns = get_dag_runs(dag_id, state)<EOL><DEDENT>except AirflowException as err:<EOL><INDENT>_log.info(err)<EOL>response = jsonify(error="<STR_LIT:{}>".format(err))<EOL>response.status_code = <NUM_LIT><EOL>return response<EOL><DEDENT>return jsonify(dagruns)<EOL>
Returns a list of Dag Runs for a specific DAG ID.
:query param state: a query string parameter '?state=queued|running|success...'
:param dag_id: String identifier of a DAG
:return: List of DAG runs of a DAG with requested state,
or all runs if the state is not specified