import logging
from flexget.ui.webui import register_plugin, db_session
from flask import render_template, Module, jsonify
from flexget.plugin import DependencyError, plugins, get_plugin_by_name

log = logging.getLogger('ui.schema')
schema = Module(__name__)


@schema.route('/plugins')
def index():
    return jsonify(plugins=plugins.keys())


@schema.route('/plugin/<name>')
def plugin_schema(name):
    return jsonify( get_plugin_by_name(name).instance.validator().schema())


register_plugin(schema)
@@ -57,20 +57,8 @@
 ugin
-, db_session
 %0D%0Afr
@@ -76,25 +76,8 @@
 port
- render_template,
  Mod
@@ -161,16 +161,60 @@
 _by_name
+, get_plugins_by_phase, get_plugins_by_group
 %0D%0A%0D%0Alog 
@@ -393,13 +393,21 @@
 ugin
-/%3Cnam
+s/phase/%3Cphas
 e%3E')
@@ -422,89 +422,722 @@
 ugin
-_schema(name):%0D%0A    return jsonify( get_plugin_by_name(name).instance.validator()
+s_by_phase(phase):%0D%0A    try:%0D%0A        return jsonify(plugins=%5Bplugin.name for plugin in get_plugins_by_phase(phase)%5D)%0D%0A    except Exception, e:%0D%0A        return e.message, 404%0D%0A%0D%0A%0D%0A@schema.route('/plugins/group/%3Cgroup%3E')%0D%0Adef plugins_by_group(group):%0D%0A    return jsonify(plugins=%5Bplugin.name for plugin in get_plugins_by_group(group)%5D)%0D%0A%0D%0A%0D%0A@schema.route('/plugin/%3Cname%3E')%0D%0Adef plugin_schema(name):%0D%0A    try:%0D%0A        plugin = get_plugin_by_name(name).instance%0D%0A    except DependencyError:%0D%0A        return 'Plugin %25s does not exist' %25 name, 404%0D%0A    try:%0D%0A        validator = plugin.validator()%0D%0A    except AttributeError:%0D%0A        return 'Plugin %25s does not have a schema' %25 name, 404%0D%0A    return jsonify(validator
 .sch

Add endpoints to get plugins by phase or group in webui. Better error handling for webui schema plugin.