← Back to team overview

dhis2-devs team mailing list archive

Re: analyticsTablesClear

 

Morten, not sure about the 000 code still. Depending on how I call it
(using commands I use for just about everything API related) I will either
get a 200, or an 000. I'm looking more into it, but I have a workaround now:

curl -X POST --user "${DHIS_USERNAME:?}:${DHIS_PASSWORD:?}"
"${DHIS_BASEURL:?}/api/24/maintenance/analyticsTablesClear" -w
"%{http_code}"
or

curl -X PUT --user "${DHIS_USERNAME:?}:${DHIS_PASSWORD:?}"
"${DHIS_BASEURL:?}/api/24/maintenance/analyticsTablesClear" -w
"%{http_code}"

It does come back with a "null" though:

curl -X PUT --user "${DHIS_USERNAME:?}:${DHIS_PASSWORD:?}"
"${DHIS_BASEURL:?}/api/24/maintenance/analyticsTablesClear" -w
"%{http_code}"
null200


*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007

On Mon, Nov 21, 2016 at 10:04 PM, Morten Olav Hansen <morten@xxxxxxxxx>
wrote:

> Hi
>
> Code 000.. what does that mean? what is the status that cURL is returning?
> that endpoint should return a 201 No Content
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Tue, Nov 22, 2016 at 1:47 AM, Timothy Harding <tharding@xxxxxxxxxxxxxx>
> wrote:
>
>> Hello Devs!!
>>
>> Version:2.24Build revision:57640e2
>> Build date:2016-11-19 04:24
>> Quick question, I'm trying to clear the analytics tables from dhis2 and
>> using the command in the manual _works_ but it comes back with an error:
>>
>> ++ [2016-11-21 18:28:08] API URL "http://localhost:8080/api/24/
>> maintenance/analyticsTablesClear" to be requested with "POST"
>> ++ [2016-11-21 18:29:13] API request output:
>> *ERROR: API request returned code 000, exiting...*
>>
>> This happens if I use PUT or POST.
>>
>> I've tried the following command as well:
>>
>> curl -X PUT -H -u "${DHIS_USERNAME:?}:${DHIS_PASSWORD:?}"
>> "${DHIS_BASEURL:?}/api/24/maintenance/analyticsTablesClear"
>>
>> Any ideas? Ideally it would return a 200 whether the tables are there and
>> it cleared them, or if they don't exist yet (first time using that db after
>> a refresh from backup).
>>
>>
>> *Timothy Harding*
>> Sr. Systems Analyst, BAO Systems
>> +1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
>> hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>

Follow ups

References