summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-04-26 22:34:42 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2016-04-26 22:34:42 +0200
commitc6ea930ef902a24122b5ea802c4bdf1107cc66ec (patch)
tree5e2f2e9bad19dbb84e0c8482a636f179b75bf544 /docs
parent28ca8f124cea3d8ec7f8f1c8639f03336cda1aeb (diff)
Add update api
Diffstat (limited to 'docs')
-rw-r--r--docs/api/v2/README.md82
1 files changed, 80 insertions, 2 deletions
diff --git a/docs/api/v2/README.md b/docs/api/v2/README.md
index cb9369745..c5106a865 100644
--- a/docs/api/v2/README.md
+++ b/docs/api/v2/README.md
@@ -476,7 +476,85 @@ The attributes mean the following:
## Updater
-TBD
+Instead of using the built in, slow cron updater you can use the parallel update API to update feeds. The API can be accessed through REST or ownCloud console API.
+
+The API should be used in the following way:
+
+* Clean up before the update
+* Get all feeds and user ids
+* For each feed and user id, run the update command
+* Clean up after the update.
+
+The reference [implementation in Python](https://github.com/owncloud/news-updater) should give you a good idea how to design your own updater.
+
+If the REST API is used, Authorization is required via Basic Auth and the user needs to be in the admin group. When using the ownCloud console API, no authorization is required.
+
+### Clean Up Before Update
+This is used to clean up the database. It deletes folders and feeds that are marked for deletion.
+
+**Console API**:
+
+ php -f owncloud/occ news:updater:before-update
+
+**REST API**:
+
+* **Method**: GET
+* **Route**: /updater/before-update
+
+### Get All Feeds And User Ids
+This call returns pairs of feed ids and user ids.
+
+**Console API**:
+
+ php -f owncloud/occ news:updater:all-feeds
+
+**REST API**:
+
+* **Method**: GET
+* **Route**: /updater/all-feeds
+
+Will return the following response body:
+
+```js
+{
+ "data": {
+ "feeds": [{
+ "id": 3,
+ "userId": "john"
+ }, /* etc */]
+ }
+}
+```
+
+### Update A User's Feed
+After all feed ids and user ids are known, feeds can be updated in parallel
+
+**Console API**:
+* **Positional Parameters**:
+ * **{feedId}**: the feed's id
+ * **{userId}**: the user's id
+
+ php -f owncloud/occ news:updater:update-feed {feedId} {userId}
+
+**REST API**:
+
+* **Method**: GET
+* **Route**: /updater/update-feed?feedId={feedId}&userId={userId}
+* **Route Parameters**:
+ * **{feedId}**: the feed's id
+ * **{userId}**: the user's id
+
+### Clean Up After Update
+This is used to clean up the database. It removes old read articles which are not starred.
+
+**Console API**:
+
+ php -f owncloud/occ news:updater:after-update
+
+**REST API**:
+
+* **Method**: GET
+* **Route**: /updater/after-update
## Meta Data
The retrieve meta data about the app, use the following request:
@@ -487,7 +565,7 @@ The retrieve meta data about the app, use the following request:
The following response is being returned:
Status codes:
-* **200**: Feed was deleted successfully
+* **200**: Meta data accessed successfully
* Other ownCloud errors, see **Response Format**