Configure the update of the data

There are several ways to launch a synchronization of the data in Themis :

  • Manually via the interface of Administration
  • By using the REST API
  • By planing a cron to plan the execution

These 3 ways are not exclusive, and may work jointly without any problem. By default, a cron is defined and plans daily updates, between 5 am and 10 pm hourly.

To manage these parameters, go in the Administration part then Update of the data.

Admin_SyncData.png

 

Modify the cron

That way allows to set a specific planification for the updates of the data of Themis. Select the "Cron" way, then fill the form to set finely the planning of the execution. Here several examples of cron

  • 0 0 10 ? * *: Daily at 10 am.
  • 0 0 * ? * MON-FRI: Hourly from Monday to Friday.
  • 0 0 6-22 ? * MON-FRI: Hourly between 6 am and 10 pm, from Monday to Friday.
  • 0 0/30 * ? * MON-FRI: Every 30 minutes from Monday to Friday.
  • 0 0 5 ? * MON-FRI: At 5 am, from Monday to Friday.
  • 0 0 10 ? * SAT-SUN: Every Saturday and Sunday at 10 am.

Deactivate the cron

Go in the Administration part the Update of the data. Deactivate simply the "Cron" button by selecting the "Manual" button.

Manual update

In the Administration part then Projects, you may click at any time on the button with the icon Refresh.png that you will find alongside every project, but also every source.

Trigger by the REST API

It is possible to trigger an update thanks to the API provided by Themis. We recommend the use of this way in particular if you have established an environment of continuous integration for your project. The advantage of this way is that you may specify which projects even which sources you wish to update.

To use this way, you have to first generate a key of API. Then, you have to identify the key of the projects and/or sources that you wish to update.

Where to find the key of a project?

in the Administration part, then Projets, identify the line of the wished project. Identify the Key column then click on the  button to copy the key in the clip board.

Example of request with the curl utilitarian (remplace PROJECT_KEY by the key of the source) :

curl -v -f -H 'themis-api-key:<API_KEY>' <THEMIS_URL>/api/refreshProject/<PROJECT_KEY>

Where to find the key of a source?

In the Administration part, then Projects, identify the line of the projects containing the wished source. Click on the Sources column on the button allowing to list the sources. Identify the wished line the in the Key column click on the following button  to copy the key of the source in the clipboard.

Example of request with the curl utilitarian (replace SOURCE_KEY by the key of the source) :

curl -v -f -H 'themis-api-key:<API_KEY>' <THEMIS_URL>/api/refreshSource/<SOURCE_KEY>

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.