From 6e046d5782feb9b6165101b46d8ac2b9bdec17b1 Mon Sep 17 00:00:00 2001 From: dlavigne Date: Mon, 28 Mar 2016 12:40:37 -0400 Subject: [PATCH] Doc pkg_update action. --- api/classes/pkg.rst | 57 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/api/classes/pkg.rst b/api/classes/pkg.rst index 7532b50..6484976 100644 --- a/api/classes/pkg.rst +++ b/api/classes/pkg.rst @@ -21,7 +21,7 @@ Every pkg class request contains the following parameters: | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ | action | | supported actions include "pkg_info", "pkg_search", "list_categories", "list_repos", "pkg_audit", "pkg_upgrade", | -| | | "pkg_check_upgrade" | +| | | "pkg_check_upgrade", "pkg_update" | | | | | +---------------------------------+---------------+----------------------------------------------------------------------------------------------------------------------+ @@ -641,7 +641,7 @@ instructions on how to subscribe to and query dispatcher events. "namespace": "sysadm" } -.. index:: pkg_check, pkg +.. index:: pkg_check_upgrade, pkg .. _Check Packages: @@ -688,4 +688,57 @@ instructions on how to subscribe to and query dispatcher events. "id": "fooid", "name": "response", "namespace": "sysadm" + } + +.. index:: pkg_update, pkg + +.. _Update Package Database: + +Update Package Database +======================= + +The "pkg_update" action instructs :command:`pkg` to update its databases. This action is typically not required. It returns any information as a dispatcher event. Refer to the +:ref:`Dispatcher Subsystem` for instructions on how to subscribe to and query dispatcher events. + +If you include "force" = "true", it forces :command:`pkg` to completely resync all of its databases with all known repositories which may take some time. + +**REST Request** + +.. code-block:: json + + PUT /sysadm/pkg + { + "force" : "true", + "action" : "pkg_update" + } + +**WebSocket Request** + +.. code-block:: json + + { + "id" : "fooid", + "name" : "pkg", + "namespace" : "sysadm", + "args" : { + "force" : "true", + "action" : "pkg_update" + } + } + +**Response** + +.. code-block:: json + + { + "args": { + "pkg_update": { + "proc_cmd": "pkg update -f", + "proc_id": "sysadm_pkg_update-{8d65bbc5-fefc-4f34-8743-167e61a54c4c}", + "status": "pending" + } + }, + "id": "fooid", + "name": "response", + "namespace": "sysadm" } \ No newline at end of file