'Get task executions by ID'

@etag
@api.response(200, model=task_executions)
@api.response(NotFoundError)
def get(self, task_id, session=None):

    try:
        task = session.query(StatusTask).filter((StatusTask.id == task_id)).one()
    except NoResultFound:
        raise NotFoundError((u'task    status    with    id    %d    not    found' % task_id))
    args = executions_parser.parse_args()
    page = args[u'page']
    per_page = args[u'per_page']
    sort_by = args[u'sort_by']
    sort_order = args[u'order']
    succeeded = args.get(u'succeeded')
    produced = args.get(u'produced')
    start_date = args.get(u'start_date')
    end_date = args.get(u'end_date')
    if (per_page > 100):
        per_page = 100
    start = (per_page * (page - 1))
    stop = (start + per_page)
    descending = (sort_order == u'desc')
    kwargs = {u'start': start, u'stop': stop, u'task_id': task_id, u'order_by': sort_by, u'descending': descending, u'succeeded': succeeded, u'produced': produced, u'start_date': start_date, u'end_date': end_date, u'session': session}
    total_items = task.executions.count()
    if (not total_items):
        return jsonify([])
    executions = [e.to_dict() for e in get_executions_by_task_id(**kwargs)]
    total_pages = int(ceil((total_items / float(per_page))))
    if (page > total_pages):
        raise NotFoundError((u'page    %s    does    not    exist' % page))
    actual_size = min(len(executions), per_page)
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    rsp = jsonify(executions)
    rsp.headers.extend(pagination)
    return rsp
