Issue #4672
closedClarify Tasks REST API Docs (including response codes)
Description
1 - There is no mention in the docs about not being possible to delete a running task, what status code, and expected response.
Attempt to delete a running task is returning a 409.
{'_content': b'',
'_content_consumed': True,
'_next': None,
'connection': <requests.adapters.HTTPAdapter object at 0x7f87dc15fb00>,
'cookies': <RequestsCookieJar[]>,
'elapsed': datetime.timedelta(microseconds=128350),
'encoding': None,
'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 21 Dec 2018 00:46:37 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Vary': 'Accept, Cookie', 'Allow': 'GET, DELETE, HEAD, OPTIONS', 'X-Frame-Options': 'SAMEORIGIN'},
'history': [],
'raw': <urllib3.response.HTTPResponse object at 0x7f87dc15fd68>,
'reason': 'Conflict',
'request': <PreparedRequest [DELETE]>,
'status_code': 409,
'url': 'http://192.168.122.138/pulp/api/v3/tasks/80aeaad0-6323-447d-9a24-b2a8ab7f9a4f/'
Not clear why the user is getting back a 409. 'reason': 'Conflict'
2 - It is not stated in the documentation in what state a task has to be in order to be cancelled.
See: https://docs.pulpproject.org/en/3.0/nightly/restapi.html#tag/tasks
Related issues
Updated by kersom over 5 years ago
- Related to Story #3527: As an authenticated user, I can delete tasks that aren't running or waiting. added
Updated by kersom over 5 years ago
- Related to Test #3634: Write functional tests for task delete and cancel code added
Updated by amacdona@redhat.com over 5 years ago
+1, this is a docs gap. +1 changes should be made to https://docs.pulpproject.org/en/3.0/nightly/restapi.html#operation/tasks_delete
Updated by amacdona@redhat.com over 5 years ago
- Sprint/Milestone set to 3.0.0
- Triaged changed from No to Yes
Updated by daviddavis over 5 years ago
I think this 409 response is problematic: to quote RFC2616[0], "The response body SHOULD include enough information for the user to recognize the source of the conflict." I don't think we're doing that?
Updated by amacdona@redhat.com over 5 years ago
- Subject changed from Actions over task system missing documentation to Clarify Tasks REST API Docs (including response codes)
Updated by dkliban@redhat.com about 4 years ago
- Status changed from NEW to CLOSED - CURRENTRELEASE
REST API docs provide information about the status codes and not being able to DELETE a running task.