Skip to content

Commit

Permalink
Setting api_version=cloud when Cloud=true (#532)
Browse files Browse the repository at this point in the history
* Add method for add_space_permission (https://developer.atlassian.com/cloud/confluence/rest/api-group-experimental/#api-api-space-spacekey-permission-post). Needs some exception catching to deal with 400 errors, but it works!

* Cleanup JSON

* Removing id

* Might be good to use that cloud property to set api_version

* Documenting the cloud parameter

Co-authored-by: Darryl Lee <dlee@coyotecrk.com>
  • Loading branch information
darryllee and Darryl Lee authored Jul 16, 2020
1 parent 2161198 commit b4082eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Here's a short example of how to create a Confluence page:
print(status)
(Note that for Confluence Cloud, some API calls are different, so you'll
want to add cloud=True to the Confluence() connection.)

And here's another example of how to get issues from Jira using JQL Query:

.. code-block:: python
Expand Down
2 changes: 2 additions & 0 deletions atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def __init__(self, url, username=None, password=None, timeout=60, api_root='rest
and '/wiki' not in url \
and self.__class__.__name__ in 'Confluence':
url = self.url_joiner(url, '/wiki')
if (cloud == True):
api_version = 'cloud'
self.url = url
self.username = username
self.password = password
Expand Down

0 comments on commit b4082eb

Please sign in to comment.