Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Updater 1.2

Bernhard Posselt edited this page Apr 14, 2016 · 2 revisions

To enable people to write their own update scripts instead of relying on the sequential built in web and system cron, API routes and console commands have been created.

Updating should be done in the following fashion:

  • Run the cleanup before the update
  • Get all feeds and user ids
  • For each feed and user id, run the update command
  • Run the cleanup after the update.

This implementation in Python should give you a good idea how to design and run it.

Trigger cleanup before update

This is used to clean up the database. It deletes folders and feeds that are marked for deletion

  • Status: Implemented in 1.601
  • Authentication: Requires admin user
  • Method: GET
  • Route: /cleanup/before-update
  • Returns: Nothing

New in 8.1.0: The console command for achieving the same result is:

php -f owncloud/occ news:updater:before-update

Get feed ids and usernames for all feeds

  • Status: Implemented in 1.203
  • Authentication: Requires admin user
  • Method: GET
  • Route: /feeds/all
  • Parameters: none
  • Returns:
{
  "feeds": [
    {
      "id": 39,
      "userId": "john",
    }, // etc
  ]
}

New in 8.1.0: The console command for achieving the same result is:

php -f owncloud/occ news:updater:all-feeds

Trigger a feed update

  • Status: Implemented in 1.601
  • Authentication: Requires admin user
  • Method: GET
  • Route: /feeds/update
  • Parameters:
{
  "userId": "john",
  "feedId": 3
}
  • Return codes:
  • HTTP 404: If the feed does not exist
  • Returns: Nothing

New in 8.1.0: The console command for achieving the same result is:

php -f owncloud/occ news:updater:update-feed 3 john

Trigger cleanup after update

This is used to clean up the database. It removes old read articles which are not starred

  • Status: Implemented in 1.601
  • Authentication: Requires admin user
  • Method: GET
  • Route: /cleanup/after-update
  • Returns: Nothing

New in 8.1.0: The console command for achieving the same result is:

php -f owncloud/occ news:updater:after-update