[Confluence] Add get_all_spaces and switch Cloud space methods to v2 plural endpoint (#1638)
* [Confluence] Add get_all_spaces and switch Cloud space methods to v2 plural endpoint
Fixes #1560.
After commit 63e744f the legacy `get_all_spaces` was removed entirely from
the Cloud module — `Confluence("https://api.atlassian.com/ex/confluence/...")`
routes to the new `Cloud` class, which only has `get_spaces` (singular path).
Calling `c.get_all_spaces()` now raises AttributeError; users with OAuth/PAT
tokens routed through the API gateway lose the paginated enumeration they had
under the old v1 path.
Cloud's space methods also use the singular `space` path (e.g.
`self.get("space")`) while `api_root="wiki/api/v2"`, so the constructed URL
`/wiki/api/v2/space` doesn't match the documented v2 endpoint
`/wiki/api/v2/spaces` (plural — see
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/).
This change:
- Adds `Cloud.get_all_spaces()` returning a paginated generator over
`_get_paged("spaces")`, restoring the back-compat surface and using v2.
- Switches `get_spaces`, `get_space`, `create_space`, `update_space`,
`delete_space`, `get_space_content` from `space[/...]` to `spaces[/...]`.
- Updates the existing space mock-tests to assert the v2 plural path and
adds a pagination test for `get_all_spaces`.
The Server implementation is unchanged (still uses v1 `space` paths
correctly, since Server is not affected by gateway routing).
Signed-off-by: 1fanwang <1fannnw@gmail.com>
* [Confluence] Fix multi-line docstrings in cloud space methods to D213 (summary on second line)
Signed-off-by: 1fanwang <1fannnw@gmail.com>
---------
Signed-off-by: 1fanwang <1fannnw@gmail.com> S
Stefan Wang committed
ab3adf60455553fab349881bf5d66314d5247e2a
Parent: 2fc67b7
Committed by GitHub <noreply@github.com>
on 5/4/2026, 2:53:55 PM