[Kimchi-devel] [PATCH][Wok 5/5] Change plugins API documentation by pluginsmanager API

Aline Manera alinefm at linux.vnet.ibm.com
Wed Jun 1 03:20:21 UTC 2016


Please, also add new test cases to cover the API changes.

One question below:

On 05/31/2016 02:51 PM, Rodrigo Trujillo wrote:
> This patch creates the documentation for pluginsmanager API
>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
> ---
>   docs/API/plugins.md        | 13 ----------
>   docs/API/pluginsmanager.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 61 insertions(+), 13 deletions(-)
>   delete mode 100644 docs/API/plugins.md
>   create mode 100644 docs/API/pluginsmanager.md
>
> diff --git a/docs/API/plugins.md b/docs/API/plugins.md
> deleted file mode 100644
> index aaa37b5..0000000
> --- a/docs/API/plugins.md
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -## REST API Specification for Plugins
> -
> -### Collection: Plugins
> -
> -**URI:** /plugins
> -
> -**Methods:**
> -
> -* **GET**: Retrieve a summarized list names of all UI Plugins
> -
> -#### Examples
> -GET /plugins
> -[pluginA, pluginB, pluginC]
> diff --git a/docs/API/pluginsmanager.md b/docs/API/pluginsmanager.md
> new file mode 100644
> index 0000000..23381d3
> --- /dev/null
> +++ b/docs/API/pluginsmanager.md
> @@ -0,0 +1,61 @@
> +## REST API Specification for Plugins Manager
> +
> +### Collection: Plugins
> +
> +**URI:** /pluginsmanager
> +
> +**Methods:**
> +
> +* **GET**: Retrieve a list of all Plugins configured in Wok, showing name and state.
> +
> +#### Examples
> +GET /pluginsmanager
> +[
> +  {
> +    "enabled":true,
> +    "name":"gingerbase"
> +  },
> +  {
> +    "enabled":true,
> +    "name":"kimchi"
> +  },
> +  {
> +    "enabled":false,
> +    "name":"sample"
> +  }
> +]
> +
> +### Resource: Plugin
> +
> +**URI:** /pluginsmanager/*:name*
> +
> +A plugin represents a software that will make use of infrastructure provided
> +by Wok. It should be installed in a directory with its <name> in Wok directory
> +'plugins' and contains an <name>.conf file.
> +Example: "/usr/lib/python2.7/site-packages/wok/plugins/kimchi"
> +
> +**Methods:**
> +
> +* **GET**: Retrieve the full description of the plugin.
> +    * name: The plugin name
> +    * enabled: State of the plugin. If not enabled, Wok will not load it
> +* **POST**: *See Task Actions*
> +
> +**Actions (POST):**
> +
> +* enable: enable a disabled plugin. Also changes plugin's configuration file
> +
> +* disable: disable a enabled plugin. Also changes plugin's configuration file
> +

Does that mean trying to enable a enabled plugin will raise an error? 
And similar to disable a disabled plugin?

> +#### Examples
> +GET /pluginsmanager/sample
> +{
> +    "enabled":false,
> +    "name":"sample"
> +}
> +
> +POST /pluginsmanager/sample/enable
> +{
> +    "enabled":true,
> +    "name":"sample"
> +}




More information about the Kimchi-devel mailing list