Project

Profile

Help

Issue #4672

Clarify Tasks REST API Docs (including response codes)

Added by kersom 6 months ago. Updated about 1 month ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Documentation
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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. MODIFIED Actions
Related to Pulp - Test #3634: Write functional tests for task delete and cancel code CLOSED - COMPLETE Actions

History

#1 Updated by bherring 6 months ago

  • Project changed from Pulp CLI to Pulp

#2 Updated by kersom 6 months ago

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

#3 Updated by kersom 6 months ago

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

#4 Updated by amacdona@redhat.com 6 months 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

#5 Updated by amacdona@redhat.com 6 months ago

  • Sprint/Milestone set to 3.0
  • Triaged changed from No to Yes

#6 Updated by daviddavis 6 months ago

I think this 409 response is problematic: to quote RFC26160, "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

#7 Updated by amacdona@redhat.com 6 months ago

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

#8 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

#9 Updated by daviddavis about 1 month ago

  • Sprint/Milestone deleted (3.0)

Please register to edit this issue

Also available in: Atom PDF