Run analytics from the API?

Hi,

Does anyone know if there is a API call or similar to run analytics from command line? Useful whenever I am restoring a database I need to immediately run analytics if the table is removed from the backup. Couldn’t find anything in the documentation on that.

Thanks!

Trøyel

Best Regards

Halvar Trøyel Nerbø

Reporting Advisor

+47 992 39 817

Skype: nrc_troyel

www.nrc.no

nrclogo

1 Like

Hi Trøyel,

see here:

https://docs.dhis2.org/master/en/developer/html/webapi_generating_resource_analytics_tables.html

Lars

image

···

On Thu, Mar 16, 2017 at 10:08 AM, Trøyel Nerbø troyel.nerbo@nrc.no wrote:

Hi,

Does anyone know if there is a API call or similar to run analytics from command line? Useful whenever I am restoring a database I need to immediately run analytics if the table is removed from the backup. Couldn’t find anything in the documentation on that.

Thanks!

Trøyel

Best Regards

Halvar Trøyel Nerbø

Reporting Advisor

+47 992 39 817

Skype: nrc_troyel

www.nrc.no


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Oh I missed that, thanks Lars!

Trøyel

image

···

Hi Trøyel,

see here:

https://docs.dhis2.org/master/en/developer/html/webapi_generating_resource_analytics_tables.html

Lars

On Thu, Mar 16, 2017 at 10:08 AM, Trøyel Nerbø troyel.nerbo@nrc.no wrote:

Hi,

Does anyone know if there is a API call or similar to run analytics from command line? Useful whenever I am restoring a database I need to immediately run analytics if the table is removed from the backup. Couldn’t find anything in the documentation on that.

Thanks!

Trøyel

Best Regards

Halvar Trøyel Nerbø

Reporting Advisor

+47 992 39 817

Skype: nrc_troyel

www.nrc.no


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

You can look at the api call here: https://docs.dhis2.org/master/en/developer/html/dhis2_developer_manual_full.html#webapi_generating_resource_analytics_tables

Then you can create a curl based on that.

Remember you need to have the right authority to start this process. (Administrate data mart)

Hope this helps

···

——
Stian Sandvold
Software developer, DHIS 2
University of Oslo
http://www.dhis2.org

On 16 Mar 2017, at 10:08, Trøyel Nerbø <troyel.nerbo@nrc.no> wrote:

Hi,
Does anyone know if there is a API call or similar to run analytics from command line? Useful whenever I am restoring a database I need to immediately run analytics if the table is removed from the backup. Couldn’t find anything in the documentation on that.

Thanks!
Trøyel

Best Regards
Halvar Trøyel Nerbø
Reporting Advisor
+47 992 39 817
Skype: nrc_troyel
www.nrc.no <http://www.nrc.no/>
<image001.jpg> <http://www.nrc.no/>

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net <mailto:dhis2-devs@lists.launchpad.net>
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

1 Like

So this is how I managed to run analytics via API and even set a cron job for it:

00 */12 * * * curl -X POST -u username:password https://example.com/api/29/resourceTables/analytics

The cron job runs twice a day, after every twelve hours.

2 Likes