'Get list of registered plugins'

@etag
@api.response(200, model=plugin_list_reply_schema)
@api.response(BadRequest)
@api.response(NotFoundError)
@api.doc(parser=plugins_parser)
def get(self, session=None):

    args = plugins_parser.parse_args()
    page = args[u'page']
    per_page = args[u'per_page']
    if (per_page > 100):
        per_page = 100
    start = (per_page * (page - 1))
    stop = (start + per_page)
    plugin_list = []
    try:
        for plugin in get_plugins(phase=args[u'phase'], interface=args[u'interface']):
            p = plugin_to_dict(plugin)
            if args[u'include_schema']:
                p[u'schema'] = plugin.schema
            plugin_list.append(p)
    except ValueError as e:
        raise BadRequest(str(e))
    total_items = len(plugin_list)
    sliced_list = plugin_list[start:stop]
    total_pages = int(ceil((total_items / float(per_page))))
    if ((page > total_pages) and (total_pages != 0)):
        raise NotFoundError((u'page    %s    does    not    exist' % page))
    actual_size = min(per_page, len(sliced_list))
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    rsp = jsonify(sliced_list)
    rsp.headers.extend(pagination)
    return rsp
