#248 ✓resolved

Job delete API requires a redirect, which is a bit of work for some clients.

Reported by aaron.meier | March 28th, 2011 @ 11:18 AM | in Rundeck 1.3 (closed)

When hitting /api/1/job/[id] with http DELETE, it causes a redirect to /job/apiDeleteJob/[id], but this is a problem without adding redirect logic in modules like Python's urllib2, or adding a handler to support it. Other tools, like Poster's API/REST emulator, do not pass DELETE along with the redirect, so a 405 is returned.

From the IRC:

[11:10] <ameier> Hi all, I'm trying to delete a job via the API, but sending http DELETE to /api/1/job/[id] is failing with 405 Method Not Allowed... any suggestions? This occurs with using Python's urllib2, or through the Poster module in Firefox. Authentication is working, and job creation works (as long as the content type is multipart/form).
[12:02] <gschueler> however if i try with the Poster extension, it fails with 405.  i think it may not use DELETE when following the 302 redirect
[12:03] <ameier> Ah, so the trick is to follow the redirect
[12:03] <ameier> ?
[12:03] <gschueler> try bypassing the /api request and use /job/apiJobDelete/3
[12:04] <gschueler> (your job id instead of 3)
[12:04] <gschueler> if that works i think the redirect is the issue here
[12:04] <ameier> got it, thanks for your help, will update in a few
[12:05] <gschueler> nb: testing with Poster that seems to work ok for me
[12:09] <ameier> Yup, both Python and Poster don't follow the redirects, and when I was using the test-job-delete.sh script, I think there was a cookie issue on my end. Thank you very much for your help!
[12:09] <Alex-SF> cool. thanks for that gschueler
[12:10] <gschueler> sure, no problem
[12:10] <gschueler> ameier: so did you fix it by using that secondary URL, or by enabling redirects?
[12:11] <gschueler> btw please file this as a bug, i can change the /api url usage so that it doesn't have to perform a redirect

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues

Shared Ticket Bins

People watching this ticket

Referenced by