Project

Profile

Help

Issue #4672

closed

Clarify Tasks REST API Docs (including response codes)

Added by kersom about 5 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Documentation
Sprint:
Quarter:

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

Related to Pulp - Story #3527: As an authenticated user, I can delete tasks that aren't running or waiting.CLOSED - CURRENTRELEASECodeHeeler

Actions
Related to Pulp - Test #3634: Write functional tests for task delete and cancel codeCLOSED - COMPLETEkersomActions
Actions #1

Updated by bherring about 5 years ago

  • Project changed from 31 to Pulp
Actions #2

Updated by kersom about 5 years ago

  • Related to Story #3527: As an authenticated user, I can delete tasks that aren't running or waiting. added
Actions #3

Updated by kersom about 5 years ago

  • Related to Test #3634: Write functional tests for task delete and cancel code added
Actions #5

Updated by amacdona@redhat.com about 5 years ago

  • Sprint/Milestone set to 3.0.0
  • Triaged changed from No to Yes
Actions #6

Updated by daviddavis about 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?

[0] https://www.ietf.org/rfc/rfc2616.txt

Actions #7

Updated by amacdona@redhat.com about 5 years ago

  • Subject changed from Actions over task system missing documentation to Clarify Tasks REST API Docs (including response codes)
Actions #8

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #9

Updated by daviddavis over 4 years ago

  • Sprint/Milestone deleted (3.0.0)
Actions #10

Updated by dkliban@redhat.com over 3 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.

Also available in: Atom PDF