[Kimchi-devel] [PATCH] [WoK 01/10] /config/plugins API: docs changes

dhbarboza82 at gmail.com dhbarboza82 at gmail.com
Fri Jan 20 17:32:35 UTC 2017


From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>

This patch adds a new API called /config/plugins in
docs/API/config.md file. A new message was also added
in i18n.py.

Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
---
 docs/API/config.md | 31 +++++++++++++++++++++++++++++++
 src/wok/i18n.py    |  1 +
 2 files changed, 32 insertions(+)

diff --git a/docs/API/config.md b/docs/API/config.md
index 0c273e2..22420f1 100644
--- a/docs/API/config.md
+++ b/docs/API/config.md
@@ -26,3 +26,34 @@ GET /config
  websockets_port: 64667,
  version: 2.0
 }
+
+### Collection: Plugins
+
+**URI:** /config/plugins
+
+**Methods:**
+
+* **GET**: Retrieve a summarized list of all UI Plugins.
+
+#### Examples
+GET /plugins
+[{'name': 'pluginA', 'enabled': True}, {'name': 'pluginB', 'enabled': False}]
+
+### Resource: Plugins
+
+**URI:** /config/plugins/*:name*
+
+Represents the current state of a given WoK plug-in.
+
+**Methods:**
+
+* **GET**: Retrieve the state of the plug-in.
+    * name: The name of the plug-in.
+    * enabled: True if the plug-in is currently enabled in WoK, False otherwise.
+
+* **POST**: *See Plugin Actions*
+
+**Actions (POST):**
+
+* enable: Enable the plug-in in the configuration file.
+* disable: Disable the plug-in in the configuration file.
diff --git a/src/wok/i18n.py b/src/wok/i18n.py
index e454e31..c96d14f 100644
--- a/src/wok/i18n.py
+++ b/src/wok/i18n.py
@@ -62,4 +62,5 @@ messages = {
     "WOKRES0001L": _("Request made on resource"),
     "WOKROOT0001L": _("User '%(username)s' login"),
     "WOKROOT0002L": _("User '%(username)s' logout"),
+    "WOKPLUGIN0001E": _("Unable to find plug-in %(name)s"),
 }
-- 
2.7.4



More information about the Kimchi-devel mailing list