Document SSH commands gerrit plugin {ls|install|remove|reload}
Change-Id: If6a45760cbc4ebdfb6cfeea4b39034cae1415b82
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/Documentation/cmd-index.txt b/Documentation/cmd-index.txt
index c4f222b..fd49ae5 100644
--- a/Documentation/cmd-index.txt
+++ b/Documentation/cmd-index.txt
@@ -126,6 +126,24 @@
link:cmd-show-queue.html[gerrit show-queue]::
Display the background work queues, including replication.
+link:cmd-plugin-install.html[gerrit plugin add]::
+ Alias for 'gerrit plugin install'.
+
+link:cmd-plugin-install.html[gerrit plugin install]::
+ Install/Add a plugin.
+
+link:cmd-plugin-ls.html[gerrit plugin ls]::
+ List the installed plugins.
+
+link:cmd-plugin-reload.html[gerrit plugin reload]::
+ Reload/Restart plugins.
+
+link:cmd-plugin-remove.html[gerrit plugin remove]::
+ Disable plugins.
+
+link:cmd-plugin-remove.html[gerrit plugin rm]::
+ Alias for 'gerrit plugin remove'.
+
link:cmd-kill.html[kill]::
Kills a scheduled or running task.
diff --git a/Documentation/cmd-plugin-install.txt b/Documentation/cmd-plugin-install.txt
new file mode 100644
index 0000000..79d1f4a
--- /dev/null
+++ b/Documentation/cmd-plugin-install.txt
@@ -0,0 +1,71 @@
+plugin install
+==============
+
+NAME
+----
+plugin install - Install/Add a plugin.
+
+plugin add - Install/Add a plugin.
+
+SYNOPSIS
+--------
+[verse]
+'ssh' -p <port> <host> 'gerrit plugin install | add'
+ [--name <NAME> | -n <NAME>]
+ - | <URL> | <PATH>
+
+DESCRIPTION
+-----------
+Install/Add a plugin. The plugin will be copied into the site path's
+`plugins` directory.
+
+ACCESS
+------
+Caller must be a member of the privileged 'Administrators' group.
+
+SCRIPTING
+---------
+This command is intended to be used in scripts.
+
+OPTIONS
+-------
+-::
+ Plugin jar as piped input.
+
+<URL>::
+ URL from where the plugin should be downloaded. This can be an
+ HTTP or FTP site.
+
+<PATH>::
+ Absolute file path to the plugin jar.
+
+--name::
+-n::
+ The name under which the plugin should be installed.
+
+EXAMPLES
+--------
+Install a plugin from an absolute file path on the server's host:
+
+====
+ ssh -p 29418 localhost gerrit plugin install -n name \
+ $(pwd)/my-plugin.jar
+====
+
+Install a plugin from an HTTP site:
+
+====
+ ssh -p 29418 localhost gerrit plugin install -n name \
+ http://build-server/output/our-plugin.jar
+====
+
+Install a plugin from piped input:
+
+====
+ ssh -p 29418 localhost gerrit plugin install -n name \
+ - <target/name-0.1.jar
+====
+
+GERRIT
+------
+Part of link:index.html[Gerrit Code Review]
diff --git a/Documentation/cmd-plugin-ls.txt b/Documentation/cmd-plugin-ls.txt
new file mode 100644
index 0000000..6cce83c
--- /dev/null
+++ b/Documentation/cmd-plugin-ls.txt
@@ -0,0 +1,44 @@
+plugin ls
+=========
+
+NAME
+----
+plugin ls - List the installed plugins.
+
+SYNOPSIS
+--------
+[verse]
+'ssh' -p <port> <host> 'gerrit plugin ls'
+ [--all | -a]
+ [--format {text | json | json_compact}]
+
+DESCRIPTION
+-----------
+List the installed plugins and show their version and status.
+
+ACCESS
+------
+Caller must be a member of the privileged 'Administrators' group.
+
+SCRIPTING
+---------
+This command is intended to be used in scripts.
+
+OPTIONS
+-------
+--all::
+-a::
+ List all plugins, including disabled plugins.
+
+--format::
+ What output format to display the results in.
++
+--
+`text`:: Simple text based format.
+`json`:: Map of JSON objects describing each project.
+`json_compact`:: Minimized JSON output.
+--
+
+GERRIT
+------
+Part of link:index.html[Gerrit Code Review]
diff --git a/Documentation/cmd-plugin-reload.txt b/Documentation/cmd-plugin-reload.txt
new file mode 100644
index 0000000..8c22afd
--- /dev/null
+++ b/Documentation/cmd-plugin-reload.txt
@@ -0,0 +1,43 @@
+plugin reload
+=============
+
+NAME
+----
+plugin reload - Reload/Restart plugins.
+
+SYNOPSIS
+--------
+[verse]
+'ssh' -p <port> <host> 'gerrit plugin reload'
+ <NAME> ...
+
+DESCRIPTION
+-----------
+Reload/Restart plugins. Whether a plugin is reloaded or restarted
+is defined by the plugin's link:dev-plugins.html#reload_method[reload method].
+
+ACCESS
+------
+Caller must be a member of the privileged 'Administrators' group.
+
+SCRIPTING
+---------
+This command is intended to be used in scripts.
+
+OPTIONS
+-------
+<NAME>::
+ Name of the plugin that should be reloaded. Multiple names of
+ plugins that should be reloaded may be specified.
+
+EXAMPLES
+--------
+Reload a plugin:
+
+====
+ ssh -p 29418 localhost gerrit plugin reload my-plugin
+====
+
+GERRIT
+------
+Part of link:index.html[Gerrit Code Review]
diff --git a/Documentation/cmd-plugin-remove.txt b/Documentation/cmd-plugin-remove.txt
new file mode 100644
index 0000000..ab8f95b
--- /dev/null
+++ b/Documentation/cmd-plugin-remove.txt
@@ -0,0 +1,45 @@
+plugin remove
+=============
+
+NAME
+----
+plugin remove - Disable plugins.
+
+plugin rm - Disable plugins.
+
+SYNOPSIS
+--------
+[verse]
+'ssh' -p <port> <host> 'gerrit plugin remove | rm'
+ <NAME> ...
+
+DESCRIPTION
+-----------
+Disable plugins. The plugins will be disabled by renaming the plugin
+jars in the site path's `plugins` directory to `<plugin-jar-name>.disabled`.
+
+ACCESS
+------
+Caller must be a member of the privileged 'Administrators' group.
+
+SCRIPTING
+---------
+This command is intended to be used in scripts.
+
+OPTIONS
+-------
+<NAME>::
+ Name of the plugin that should be disabled. Multiple names of
+ plugins that should be disabled may be specified.
+
+EXAMPLES
+--------
+Disable a plugin:
+
+====
+ ssh -p 29418 localhost gerrit plugin remove my-plugin
+====
+
+GERRIT
+------
+Part of link:index.html[Gerrit Code Review]
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt
index e6c332e..a3e05c2 100644
--- a/Documentation/dev-plugins.txt
+++ b/Documentation/dev-plugins.txt
@@ -93,6 +93,7 @@
Gerrit-HttpModule: tld.example.project.HttpModuleClassName
====
+[[reload_method]]
Reload Method
~~~~~~~~~~~~~
@@ -132,6 +133,9 @@
may still route to the old plugin if the swap wasn't complete yet).
The old plugin is stopped.
+To reload/restart a plugin the link:cmd-plugin-reload.html[plugin reload]
+command can be used.
+
Classpath
---------
@@ -330,32 +334,8 @@
Deployment
----------
-Compiled plugins and extensions can be deployed to a
-running Gerrit server using the SSH interface by any user with
-link:access-control.html#capability_administrateServer[Administrate Server]
-capability. Binaries can be specified in three different formats:
-
-* Absolute file path on the server's host. The server will copy
- the plugin from this location to its own site path.
-+
-----
-$ ssh -p 29418 localhost gerrit plugin install -n name $(pwd)/my-plugin.jar
-----
-
-* Valid URL, including any HTTP or FTP site reachable by the
- server. The server will download the plugin and save a copy in
- its own site path.
-+
-----
-$ ssh -p 29418 localhost gerrit plugin install -n name http://build-server/output/our-plugin.jar
-----
-
-* As piped input to the plugin install command. The server will
- copy input until EOF, and save a copy under its own site path.
-+
-----
-$ ssh -p 29418 localhost gerrit plugin install -n name - <target/name-0.1.jar
-----
+Compiled plugins and extensions can be deployed to a running Gerrit
+server using the link:cmd-plugin-install.html[plugin install] command.
Plugins can also be copied directly into the server's
directory at `$site_path/plugins/$name.jar`. The name of
@@ -364,6 +344,9 @@
directory for updated plugins. The time can be adjusted by
link:config-gerrit.html#plugins.checkFrequency[plugins.checkFrequency].
+For disabling plugins the link:cmd-plugin-remove.html[plugin remove]
+command can be used.
+
GERRIT
------
Part of link:index.html[Gerrit Code Review]