Skip to content

Commit 1578ea5

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
Gonchik Tsymzhitov
authored and
Gonchik Tsymzhitov
committed
Add doc info
1 parent 2b9602a commit 1578ea5

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

atlassian/confluence.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,29 @@ def get_page_by_title(self, space, title, start=0, limit=1, expand=None):
154154
log.debug(e)
155155
return None
156156

157-
def get_page_by_id(self, page_id, expand=None):
157+
def get_page_by_id(self, page_id, expand=None, status=None, version=None):
158158
"""
159-
Get page by ID
159+
Returns a piece of Content.
160+
Example request URI(s):
161+
http://example.com/confluence/rest/api/content/1234?expand=space,body.view,version,container
162+
http://example.com/confluence/rest/api/content/1234?status=any
160163
:param page_id: Content ID
164+
:param status: (str) list of Content statuses to filter results on. Default value: [current]
165+
:param version: (int)
161166
:param expand: OPTIONAL: A comma separated list of properties to expand on the content.
162-
Default value: history,space,version We can also specify some extensions
163-
such as extensions.inlineProperties
167+
Default value: history,space,version
168+
We can also specify some extensions such as extensions.inlineProperties
164169
(for getting inline comment-specific properties) or extensions.resolution
165170
for the resolution status of each comment in the results
166171
:return:
167172
"""
168173
params = {}
169174
if expand:
170-
params = {'expand': expand}
175+
params['expand'] = expand
176+
if status:
177+
params['status'] = status
178+
if version:
179+
params['version'] = version
171180
url = 'rest/api/content/{page_id}'.format(page_id=page_id)
172181
return self.get(url, params=params)
173182

docs/confluence.rst

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@ Get page info
2222
confluence.get_page_by_title(space, title, start=None, limit=None)
2323
2424
# Get page by ID
25-
confluence.get_page_by_id(page_id, expand=None)
25+
# Example request URI(s):
26+
# http://example.com/confluence/rest/api/content/1234?expand=space,body.view,version,container
27+
# http://example.com/confluence/rest/api/content/1234?status=any
28+
# page_id: Content ID
29+
# status: (str) list of Content statuses to filter results on. Default value: [current]
30+
# version: (int)
31+
# expand: OPTIONAL: A comma separated list of properties to expand on the content.
32+
# Default value: history,space,version
33+
# We can also specify some extensions such as extensions.inlineProperties
34+
# (for getting inline comment-specific properties) or extensions.resolution
35+
# for the resolution status of each comment in the results
36+
confluence.get_page_by_id(self, page_id, expand=None, status=None, version=None)
2637
2738
# The list of labels on a piece of Content
2839
confluence.get_page_labels(page_id, prefix=None, start=None, limit=None)
@@ -76,6 +87,9 @@ Page actions
7687
# Update page or create page if it is not exists
7788
confluence.update_or_create(parent_id, title, body, representation='storage')
7889
90+
# Append body to page if already exist
91+
confluence.append_page(self, page_id, title, append_body, parent_id=None, type='page', representation='storage', minor_edit=False)
92+
7993
# Set the page (content) property e.g. add hash parameters
8094
confluence.set_page_property(page_id, data)
8195

0 commit comments

Comments
 (0)