Roundup Tracker - Issues

Issue 2551039

classification
Restore function in rest interface does not seem to work.
Type: behavior Severity: normal
Components: Web interface Versions: devel
process
Status: fixed fixed
:
: rouilj : rouilj, schlatterbeck
Priority: normal : rest

Created on 2019-04-03 00:20 by rouilj, last changed 2019-10-19 13:08 by rouilj.

Files
File name Uploaded Description Edit Remove
delete-restore schlatterbeck, 2019-10-15 14:21
Messages
msg6450 Author: [hidden] (rouilj) Date: 2019-04-03 00:20
From roundup-devel mailing list:

>> I also tried restoring the status with:
>> 
>>   curl -X PATCH -s -u amin:amin --header \
>>      'if-match: "ff974f63e4ebfba1ecf29aa4cc508c15"'\
>>        '.../rest/data/status/9?@op=action&@action_name=restore'
>> 
>> I got back:
>> 
>>   {
>>     "data": {
>>        "type": "status",
>>        "link": ".../rest/data/status/9",
>>        "id": "9",
>>        "attribute": {}
>>     }
>>   }
>> 
>> but it doesn't show up in rest/data/status.
>> 
>> I finally was able to restore it using roundup-admin.

so looks like there may be an issue here.
msg6745 Author: [hidden] (rouilj) Date: 2019-10-15 01:54
Ralf were you able to confirm this issue?
msg6748 Author: [hidden] (schlatterbeck) Date: 2019-10-15 14:21
On Tue, Oct 15, 2019 at 01:54:10AM +0000, John Rouillard wrote:
> Ralf were you able to confirm this issue?

Thanks for the reminder.

With the attached script it works for me. So maybe an issue of
specifying the parameters in the URL (get-like) instead of as json?

The script gets the @action_name (delete or restore) as the first
parameter on the command-line.

I'll also commit a small fix that makes the code more robust
(uninitialized 'name' variable if no @action_name given) and improves
the error message.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com
msg6755 Author: [hidden] (rouilj) Date: 2019-10-19 13:08
Hi Ralf,

You were correct. I have to pass params to PATCH using a data
payload and not in the URL. That's required by spec.

I added curl based examples to the rest.txt doc on 
rev5933:0bac8b9a0ecc.

I also fixed a doc example. It was missing session.auth setting.

Also for those reading along at home, the attached file only work if 
you don't require auth on your tracker. The session variables are set 
in the script but you need to use session.get session.patch not 
requests.{get,patch} to use the auth variables.

Thanks for your help Ralf. Sorry for the PEBKAC issue.

Closing.
History
Date User Action Args
2019-10-19 13:08:08rouiljsetstatus: new -> fixed
assignee: rouilj
resolution: fixed
messages: + msg6755
2019-10-15 14:21:32schlatterbecksetfiles: + delete-restore
messages: + msg6748
2019-10-15 01:54:10rouiljsetnosy: + schlatterbeck
messages: + msg6745
2019-04-03 00:20:05rouiljcreate