Repository navigation
[Confluence] ConfluenceCloud: add remove_page - #1705
Merged
gonchik merged 1 commit intoOct 25, 2026
Merged
Conversation
docs/confluence.rst documents remove_page(page_id, status=None,
recursive=False), 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_page'".
Add remove_page to Cloud with the same arguments, return value and
error mapping as the Server client. It sends DELETE to
/wiki/rest/api/content/{id}, the endpoint delete_content already uses,
and with recursive=True lists all children before removing them.
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_page(page_id, status=None, recursive=False), and the Server client has it. The Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) doesn't, so deleting a page fails with:The only option on
Cloudtoday isdelete_content(), which has nostatusorrecursiveand returns something different, so code written against 4.x has to be changed for Cloud.This adds
remove_page(page_id, status=None, recursive=False)toCloud, with the same behaviour as the Server client:DELETE /wiki/rest/api/content/{id}(withstatuswhen given), the same v1 endpointdelete_content()already uses;recursive=True, lists all children throughget_page_child_by_type()before deleting any of them, then removes the page;204), or the raw response withadvanced_mode=True;ApiPermissionError/ApiError/ApiConflictErrorlike Server does.I also added a line to the
remove_pageentry indocs/confluence.rstsaying it works on Cloud.Tests: added five
test_remove_page_*tests totests/confluence/test_confluence_cloud.py(default call,status, recursive order, 403, 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.