Repository navigation
Conversation
docs/confluence.rst documents remove_content(content_id), and the Server
client has it, but the Cloud client does not, so
Confluence(url="https://<site>.atlassian.net") and ConfluenceCloud raise
"'Cloud' object has no attribute 'remove_content'".
Add remove_content to Cloud with the same behaviour as the Server client:
it sends DELETE to /wiki/rest/api/content/{id}, the endpoint
delete_content and remove_page already use, returns the response and
maps 403/404/409 to the same errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/confluence.rstdocumentsconfluence.remove_content(content_id)("Remove any content"), and the Server client has it. The Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) doesn't, so it fails with:This adds
remove_content(content_id)toCloud, with the same behaviour as the Server client:DELETE /wiki/rest/api/content/{id}, the same v1 endpointdelete_content()andremove_page()already use;ApiPermissionError/ApiError/ApiConflictErrorlike Server does.I also added a line to the
remove_contententry indocs/confluence.rstsaying it works on Cloud.Tests: added three
test_remove_content_*tests totests/confluence/test_confluence_cloud.py(default call, 404, and a call throughConfluence(url="https://test.atlassian.net")); they fail on master with the error above. The full pytest suite,tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.