atlassian-python-api 5.0.4__py3-none-any.whl → 5.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atlassian/VERSION +1 -1
- atlassian/bamboo.py +31 -12
- atlassian/bitbucket/cloud/repositories/__init__.py +3 -3
- atlassian/bitbucket/cloud/workspaces/projects.py +1 -1
- atlassian/bitbucket/server/common/permissions.py +1 -1
- atlassian/bitbucket/server/globalPermissions.py +1 -1
- atlassian/bitbucket/server/projects/__init__.py +1 -1
- atlassian/bitbucket/server/projects/repos/__init__.py +2 -2
- atlassian/confluence/cloud/cloud.py +38 -3
- atlassian/confluence/server/__init__.py +291 -111
- atlassian/confluence_base.py +1 -1
- atlassian/jira/jira_server.py +10 -0
- atlassian/rest_client.py +30 -0
- {atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/METADATA +1 -4
- {atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/RECORD +18 -18
- {atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/WHEEL +0 -0
- {atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/licenses/LICENSE +0 -0
- {atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/top_level.txt +0 -0
atlassian/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.0.
|
|
1
|
+
5.0.5
|
atlassian/bamboo.py
CHANGED
|
@@ -49,13 +49,16 @@ class Bamboo(AtlassianRestAPI):
|
|
|
49
49
|
except HTTPError as e:
|
|
50
50
|
logging.error(f"Broken response: {e}")
|
|
51
51
|
yield e
|
|
52
|
+
return
|
|
52
53
|
try:
|
|
53
54
|
results = response[elements_key]
|
|
54
55
|
size = 0
|
|
55
56
|
# Check if we still can get results
|
|
56
|
-
if
|
|
57
|
+
if results["size"] == 0:
|
|
57
58
|
return
|
|
58
59
|
for r in results[element_key]:
|
|
60
|
+
if max_results is not None and size >= max_results:
|
|
61
|
+
return
|
|
59
62
|
size += 1
|
|
60
63
|
yield r
|
|
61
64
|
except TypeError:
|
|
@@ -87,16 +90,18 @@ class Bamboo(AtlassianRestAPI):
|
|
|
87
90
|
# API representation for filtering by multiple labels.
|
|
88
91
|
params["label"] = label if isinstance(label, str) else list(label)
|
|
89
92
|
params.update(kwargs)
|
|
90
|
-
|
|
93
|
+
params["start-index"] = start_index
|
|
94
|
+
elements_key = params.pop("elements_key", None)
|
|
95
|
+
element_key = params.pop("element_key", None)
|
|
96
|
+
if elements_key and element_key:
|
|
91
97
|
return self._get_generator(
|
|
92
98
|
self.resource_url(resource),
|
|
93
99
|
flags=flags,
|
|
94
100
|
params=params,
|
|
95
|
-
elements_key=
|
|
96
|
-
element_key=
|
|
101
|
+
elements_key=elements_key,
|
|
102
|
+
element_key=element_key,
|
|
97
103
|
max_results=max_results,
|
|
98
104
|
)
|
|
99
|
-
params["start-index"] = start_index
|
|
100
105
|
return self.get(self.resource_url(resource), flags=flags, params=params)
|
|
101
106
|
|
|
102
107
|
""" Projects & Plans """
|
|
@@ -347,9 +352,12 @@ class Bamboo(AtlassianRestAPI):
|
|
|
347
352
|
while params["start-index"] < size:
|
|
348
353
|
results = self.get(self.resource_url("search/branches"), params=params)
|
|
349
354
|
size = results["size"]
|
|
355
|
+
page_size = results["max-result"]
|
|
356
|
+
if page_size <= 0:
|
|
357
|
+
break
|
|
350
358
|
for r in results["searchResults"]:
|
|
351
359
|
yield r
|
|
352
|
-
params["start-index"] +=
|
|
360
|
+
params["start-index"] += page_size
|
|
353
361
|
|
|
354
362
|
def plan_branches(
|
|
355
363
|
self,
|
|
@@ -454,6 +462,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
454
462
|
max_results=25,
|
|
455
463
|
include_all_states=False,
|
|
456
464
|
build_state=None,
|
|
465
|
+
**kwargs,
|
|
457
466
|
):
|
|
458
467
|
"""
|
|
459
468
|
Get results as generic method
|
|
@@ -471,6 +480,8 @@ class Bamboo(AtlassianRestAPI):
|
|
|
471
480
|
:param include_all_states:
|
|
472
481
|
:param build_state: Optional Bamboo result state, such as
|
|
473
482
|
``Successful`` or ``Failed``.
|
|
483
|
+
:param kwargs: Additional query parameters forwarded to the Bamboo
|
|
484
|
+
REST API.
|
|
474
485
|
:return:
|
|
475
486
|
"""
|
|
476
487
|
resource = "result"
|
|
@@ -500,7 +511,8 @@ class Bamboo(AtlassianRestAPI):
|
|
|
500
511
|
elements_key="results",
|
|
501
512
|
element_key="result",
|
|
502
513
|
label=label,
|
|
503
|
-
**
|
|
514
|
+
**kwargs,
|
|
515
|
+
**params,
|
|
504
516
|
) # fmt: skip
|
|
505
517
|
|
|
506
518
|
def latest_results(
|
|
@@ -587,6 +599,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
587
599
|
max_results=25,
|
|
588
600
|
include_all_states=False,
|
|
589
601
|
build_state=None,
|
|
602
|
+
**kwargs,
|
|
590
603
|
):
|
|
591
604
|
"""
|
|
592
605
|
Get Plan results
|
|
@@ -602,6 +615,8 @@ class Bamboo(AtlassianRestAPI):
|
|
|
602
615
|
:param include_all_states:
|
|
603
616
|
:param build_state: Optional Bamboo result state, such as
|
|
604
617
|
``Successful`` or ``Failed``.
|
|
618
|
+
:param kwargs: Additional query parameters passed to the Bamboo REST
|
|
619
|
+
API (for example ``issueStatus`` or ``jobKey`` filters).
|
|
605
620
|
:return:
|
|
606
621
|
"""
|
|
607
622
|
return self.results(
|
|
@@ -616,6 +631,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
616
631
|
max_results=max_results,
|
|
617
632
|
include_all_states=include_all_states,
|
|
618
633
|
build_state=build_state,
|
|
634
|
+
**kwargs,
|
|
619
635
|
)
|
|
620
636
|
|
|
621
637
|
def ordered_plan_results(
|
|
@@ -960,9 +976,12 @@ class Bamboo(AtlassianRestAPI):
|
|
|
960
976
|
while params["start-index"] < size:
|
|
961
977
|
results = self.get(self.resource_url(resource), params=params)
|
|
962
978
|
size = results["size"]
|
|
979
|
+
page_size = results["max-result"]
|
|
980
|
+
if page_size <= 0:
|
|
981
|
+
break
|
|
963
982
|
for r in results["results"]:
|
|
964
983
|
yield r
|
|
965
|
-
params["start-index"] +=
|
|
984
|
+
params["start-index"] += page_size
|
|
966
985
|
|
|
967
986
|
def deployment_dashboard(self, project_id=None):
|
|
968
987
|
"""
|
|
@@ -1110,7 +1129,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
1110
1129
|
"""
|
|
1111
1130
|
params = {"limit": limit, "start": start}
|
|
1112
1131
|
if filter_name:
|
|
1113
|
-
params
|
|
1132
|
+
params["name"] = filter_name
|
|
1114
1133
|
resource = f"permissions/deployment/{deployment_id}/users"
|
|
1115
1134
|
return self.get(self.resource_url(resource), params=params)
|
|
1116
1135
|
|
|
@@ -1149,7 +1168,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
1149
1168
|
"""
|
|
1150
1169
|
params = {"limit": limit, "start": start}
|
|
1151
1170
|
if filter_name:
|
|
1152
|
-
params
|
|
1171
|
+
params["name"] = filter_name
|
|
1153
1172
|
resource = f"permissions/deployment/{deployment_id}/groups"
|
|
1154
1173
|
return self.get(self.resource_url(resource), params=params)
|
|
1155
1174
|
|
|
@@ -1188,7 +1207,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
1188
1207
|
"""
|
|
1189
1208
|
params = {"limit": limit, "start": start}
|
|
1190
1209
|
if filter_name:
|
|
1191
|
-
params
|
|
1210
|
+
params["name"] = filter_name
|
|
1192
1211
|
resource = f"permissions/environment/{environment_id}/users"
|
|
1193
1212
|
return self.get(self.resource_url(resource), params=params)
|
|
1194
1213
|
|
|
@@ -1227,7 +1246,7 @@ class Bamboo(AtlassianRestAPI):
|
|
|
1227
1246
|
"""
|
|
1228
1247
|
params = {"limit": limit, "start": start}
|
|
1229
1248
|
if filter_name:
|
|
1230
|
-
params
|
|
1249
|
+
params["name"] = filter_name
|
|
1231
1250
|
resource = f"permissions/environment/{environment_id}/groups"
|
|
1232
1251
|
return self.get(self.resource_url(resource), params=params)
|
|
1233
1252
|
|
|
@@ -183,7 +183,7 @@ class WorkspaceRepositories(RepositoriesBase):
|
|
|
183
183
|
if r.name == repository:
|
|
184
184
|
return r
|
|
185
185
|
else:
|
|
186
|
-
ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
186
|
+
raise ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
187
187
|
|
|
188
188
|
raise Exception(f"Unknown repository {by} '{repository}'")
|
|
189
189
|
|
|
@@ -207,7 +207,7 @@ class WorkspaceRepositories(RepositoriesBase):
|
|
|
207
207
|
if e.response.status_code in (401, 404):
|
|
208
208
|
pass
|
|
209
209
|
except Exception as e:
|
|
210
|
-
if not str(e) == f"Unknown
|
|
210
|
+
if not str(e) == f"Unknown repository {by} '{repository}'":
|
|
211
211
|
raise e
|
|
212
212
|
return exists
|
|
213
213
|
|
|
@@ -247,7 +247,7 @@ class ProjectRepositories(RepositoriesBase):
|
|
|
247
247
|
https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/projects/%7Bproject_key%7D#get
|
|
248
248
|
"""
|
|
249
249
|
if by not in ("slug", "name"):
|
|
250
|
-
ValueError(f"Unknown value '{by}' for argument [by], expected 'slug' or 'name'")
|
|
250
|
+
raise ValueError(f"Unknown value '{by}' for argument [by], expected 'slug' or 'name'")
|
|
251
251
|
|
|
252
252
|
for r in self.each():
|
|
253
253
|
if ((by == "slug") and (r.slug == repository)) or ((by == "name") and (r.name == repository)):
|
|
@@ -92,7 +92,7 @@ class Projects(BitbucketCloudBase):
|
|
|
92
92
|
if p.name == project:
|
|
93
93
|
return p
|
|
94
94
|
else:
|
|
95
|
-
ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
95
|
+
raise ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
96
96
|
|
|
97
97
|
raise Exception(f"Unknown project {by} '{project}'")
|
|
98
98
|
|
|
@@ -47,7 +47,7 @@ class Permissions(BitbucketServerBase):
|
|
|
47
47
|
- For repository groups see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp282
|
|
48
48
|
- For repository users see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp288
|
|
49
49
|
"""
|
|
50
|
-
self.put(name, permission)
|
|
50
|
+
self.put(None, params={"name": name, "permission": permission})
|
|
51
51
|
return
|
|
52
52
|
|
|
53
53
|
def each(self, filter=None):
|
|
@@ -47,7 +47,7 @@ class GlobalPermissions(BitbucketServerBase):
|
|
|
47
47
|
- For groups see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp64
|
|
48
48
|
- For users see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp70
|
|
49
49
|
"""
|
|
50
|
-
self.put(name, permission)
|
|
50
|
+
self.put(None, params={"name": name, "permission": permission})
|
|
51
51
|
return
|
|
52
52
|
|
|
53
53
|
def each(self, filter=None):
|
|
@@ -82,7 +82,7 @@ class Projects(BitbucketServerBase):
|
|
|
82
82
|
if p.name == project:
|
|
83
83
|
return p
|
|
84
84
|
else:
|
|
85
|
-
ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
85
|
+
raise ValueError(f"Unknown value '{by}' for argument [by], expected 'key' or 'name'")
|
|
86
86
|
|
|
87
87
|
raise Exception(f"Unknown project {by} '{project}'")
|
|
88
88
|
|
|
@@ -53,7 +53,7 @@ class Repositories(BitbucketServerBase):
|
|
|
53
53
|
if r.name == repository:
|
|
54
54
|
return r
|
|
55
55
|
else:
|
|
56
|
-
ValueError(f"Unknown value '{by}' for argument [by], expected 'slug' or 'name'")
|
|
56
|
+
raise ValueError(f"Unknown value '{by}' for argument [by], expected 'slug' or 'name'")
|
|
57
57
|
|
|
58
58
|
raise Exception(f"Unknown repository {by} '{repository}'")
|
|
59
59
|
|
|
@@ -74,7 +74,7 @@ class Repositories(BitbucketServerBase):
|
|
|
74
74
|
if e.response.status_code in (401, 404):
|
|
75
75
|
pass
|
|
76
76
|
except Exception as e:
|
|
77
|
-
if not str(e) == f"Unknown
|
|
77
|
+
if not str(e) == f"Unknown repository {by} '{repository}'":
|
|
78
78
|
raise e
|
|
79
79
|
return exists
|
|
80
80
|
|
|
@@ -249,6 +249,43 @@ class ConfluenceCloud(
|
|
|
249
249
|
log.error(f"Failed to retrieve pages: {e}")
|
|
250
250
|
raise
|
|
251
251
|
|
|
252
|
+
def get_page_by_title(self, space_key: str, title: str, body_format: str = "storage", **kwargs) -> Dict[str, Any]:
|
|
253
|
+
"""
|
|
254
|
+
Get page by space key and title using the V2 API.
|
|
255
|
+
Resolves the space key to space_id and queries the V2 page endpoint.
|
|
256
|
+
Returns a dictionary with 'results' key containing matching pages
|
|
257
|
+
to maintain backward compatibility with V1 callers.
|
|
258
|
+
"""
|
|
259
|
+
try:
|
|
260
|
+
space = self.get_space_by_key(space_key)
|
|
261
|
+
except Exception as e:
|
|
262
|
+
log.error(f"Failed to retrieve space with key '{space_key}': {e}")
|
|
263
|
+
return {"results": []}
|
|
264
|
+
|
|
265
|
+
if not space or "id" not in space:
|
|
266
|
+
return {"results": []}
|
|
267
|
+
|
|
268
|
+
pages = self.get_pages(
|
|
269
|
+
space_id=space["id"],
|
|
270
|
+
title=title,
|
|
271
|
+
status="current",
|
|
272
|
+
body_format=body_format,
|
|
273
|
+
limit=1,
|
|
274
|
+
**kwargs,
|
|
275
|
+
)
|
|
276
|
+
return {"results": pages if isinstance(pages, list) else []}
|
|
277
|
+
|
|
278
|
+
def get_page_id(self, space: str, title: str, type: str = "page") -> Optional[str]:
|
|
279
|
+
"""
|
|
280
|
+
Get page ID by space key and title using the V2 API.
|
|
281
|
+
Returns the ID from the first result or None if not found.
|
|
282
|
+
"""
|
|
283
|
+
res = self.get_page_by_title(space, title)
|
|
284
|
+
results = res.get("results", [])
|
|
285
|
+
if results:
|
|
286
|
+
return str(results[0]["id"])
|
|
287
|
+
return None
|
|
288
|
+
|
|
252
289
|
def get_page_versions(
|
|
253
290
|
self,
|
|
254
291
|
page_id: str,
|
|
@@ -344,9 +381,7 @@ class ConfluenceCloud(
|
|
|
344
381
|
raise ValueError("Status must be one of 'current', 'archived', 'any'")
|
|
345
382
|
params["status"] = status
|
|
346
383
|
|
|
347
|
-
if
|
|
348
|
-
params["body-format"] = "none"
|
|
349
|
-
elif body_format:
|
|
384
|
+
if body_format:
|
|
350
385
|
if body_format not in ("storage", "atlas_doc_format", "view"):
|
|
351
386
|
raise ValueError("body_format must be one of 'storage', 'atlas_doc_format', or 'view'")
|
|
352
387
|
params["body-format"] = body_format
|
|
@@ -78,7 +78,10 @@ class Server(ConfluenceServerBase):
|
|
|
78
78
|
if "cloud" not in kwargs:
|
|
79
79
|
kwargs["cloud"] = False
|
|
80
80
|
if "api_version" not in kwargs:
|
|
81
|
-
|
|
81
|
+
# Confluence Data Center no longer guarantees the legacy 1.0
|
|
82
|
+
# route. An unversioned REST path is resolved by the server to
|
|
83
|
+
# its supported/latest API version.
|
|
84
|
+
kwargs["api_version"] = "latest"
|
|
82
85
|
if "api_root" not in kwargs:
|
|
83
86
|
kwargs["api_root"] = "rest/api"
|
|
84
87
|
super(Server, self).__init__(url.rstrip("/"), *args, **kwargs)
|
|
@@ -100,6 +103,15 @@ class Server(ConfluenceServerBase):
|
|
|
100
103
|
api_parts.append(normalized_path)
|
|
101
104
|
return "/".join(str(part).strip("/") for part in api_parts if part is not None and str(part).strip("/"))
|
|
102
105
|
|
|
106
|
+
def _ui_url(self, path):
|
|
107
|
+
"""Return an absolute URL for a Confluence UI action.
|
|
108
|
+
|
|
109
|
+
The PDF and Word exporters are UI actions, not REST resources. Some
|
|
110
|
+
existing integrations initialise the client with a REST API URL, so
|
|
111
|
+
remove that suffix before resolving UI paths.
|
|
112
|
+
"""
|
|
113
|
+
return self.url_joiner(self.url.split("/rest/api/", 1)[0], path)
|
|
114
|
+
|
|
103
115
|
def request(
|
|
104
116
|
self,
|
|
105
117
|
method="GET",
|
|
@@ -207,6 +219,110 @@ class Server(ConfluenceServerBase):
|
|
|
207
219
|
"""Get blog post by title and space key."""
|
|
208
220
|
return self.get("content", params={"spaceKey": space_key, "title": title, "type": "blogpost", **kwargs})
|
|
209
221
|
|
|
222
|
+
def get_plugins_info(self):
|
|
223
|
+
"""
|
|
224
|
+
Provide plugins info
|
|
225
|
+
:return a json of installed plugins
|
|
226
|
+
"""
|
|
227
|
+
url = "rest/plugins/1.0/"
|
|
228
|
+
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
229
|
+
|
|
230
|
+
def get_plugin_info(self, plugin_key: str):
|
|
231
|
+
"""
|
|
232
|
+
Provide plugin info
|
|
233
|
+
:return a json of installed plugins
|
|
234
|
+
"""
|
|
235
|
+
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
236
|
+
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
237
|
+
|
|
238
|
+
def get_plugin_license_info(self, plugin_key: str):
|
|
239
|
+
"""
|
|
240
|
+
Provide plugin license info
|
|
241
|
+
:return a json specific License query
|
|
242
|
+
"""
|
|
243
|
+
url = f"rest/plugins/1.0/{plugin_key}-key/license"
|
|
244
|
+
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
245
|
+
|
|
246
|
+
def upload_plugin(self, plugin_path: str):
|
|
247
|
+
"""
|
|
248
|
+
Provide plugin path for upload into Confluence e.g. useful for auto deploy
|
|
249
|
+
:param plugin_path:
|
|
250
|
+
:return:
|
|
251
|
+
"""
|
|
252
|
+
files = {"plugin": open(plugin_path, "rb")}
|
|
253
|
+
upm_token = self.request(
|
|
254
|
+
method="GET",
|
|
255
|
+
path="rest/plugins/1.0/",
|
|
256
|
+
headers=self.no_check_headers,
|
|
257
|
+
trailing=True,
|
|
258
|
+
).headers["upm-token"]
|
|
259
|
+
url = f"rest/plugins/1.0/?token={upm_token}"
|
|
260
|
+
return self.post(url, files=files, headers=self.no_check_headers)
|
|
261
|
+
|
|
262
|
+
def delete_plugin(self, plugin_key: str):
|
|
263
|
+
"""
|
|
264
|
+
Delete plugin
|
|
265
|
+
:param plugin_key:
|
|
266
|
+
:return:
|
|
267
|
+
"""
|
|
268
|
+
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
269
|
+
return self.delete(url)
|
|
270
|
+
|
|
271
|
+
def check_plugin_manager_status(self):
|
|
272
|
+
"""Perform the Confluence check plugin manager status operation.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
See the method signature for API request parameters.
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
Decoded Confluence REST response.
|
|
279
|
+
"""
|
|
280
|
+
url = "rest/plugins/latest/safe-mode"
|
|
281
|
+
return self.request(method="GET", path=url, headers=self.safe_mode_headers)
|
|
282
|
+
|
|
283
|
+
def update_plugin_license(self, plugin_key: str, raw_license: str):
|
|
284
|
+
"""
|
|
285
|
+
Update license for plugin
|
|
286
|
+
:param plugin_key:
|
|
287
|
+
:param raw_license:
|
|
288
|
+
:return:
|
|
289
|
+
"""
|
|
290
|
+
app_headers = {
|
|
291
|
+
"X-Atlassian-Token": "no-check",
|
|
292
|
+
"Content-Type": "application/vnd.atl.plugins+json",
|
|
293
|
+
}
|
|
294
|
+
url = f"/plugins/1.0/{plugin_key}/license"
|
|
295
|
+
data = {"rawLicense": raw_license}
|
|
296
|
+
return self.put(url, data=data, headers=app_headers)
|
|
297
|
+
|
|
298
|
+
def disable_plugin(self, plugin_key: str):
|
|
299
|
+
"""
|
|
300
|
+
Disable a plugin
|
|
301
|
+
:param plugin_key:
|
|
302
|
+
:return:
|
|
303
|
+
"""
|
|
304
|
+
app_headers = {
|
|
305
|
+
"X-Atlassian-Token": "no-check",
|
|
306
|
+
"Content-Type": "application/vnd.atl.plugins+json",
|
|
307
|
+
}
|
|
308
|
+
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
309
|
+
data = {"status": "disabled"}
|
|
310
|
+
return self.put(url, data=data, headers=app_headers)
|
|
311
|
+
|
|
312
|
+
def enable_plugin(self, plugin_key: str):
|
|
313
|
+
"""
|
|
314
|
+
Enable a plugin
|
|
315
|
+
:param plugin_key:
|
|
316
|
+
:return:
|
|
317
|
+
"""
|
|
318
|
+
app_headers = {
|
|
319
|
+
"X-Atlassian-Token": "no-check",
|
|
320
|
+
"Content-Type": "application/vnd.atl.plugins+json",
|
|
321
|
+
}
|
|
322
|
+
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
323
|
+
data = {"status": "enabled"}
|
|
324
|
+
return self.put(url, data=data, headers=app_headers)
|
|
325
|
+
|
|
210
326
|
def page_exists(self, space_key, title, **kwargs):
|
|
211
327
|
"""Check if page exists."""
|
|
212
328
|
try:
|
|
@@ -1101,6 +1217,154 @@ class Server(ConfluenceServerBase):
|
|
|
1101
1217
|
|
|
1102
1218
|
return response
|
|
1103
1219
|
|
|
1220
|
+
# Inline comment management
|
|
1221
|
+
# These endpoints are used by the Confluence Server/Data Center web UI,
|
|
1222
|
+
# but are not part of Atlassian's documented REST API.
|
|
1223
|
+
_inline_comments_resource = "rest/inlinecomments/1.0/comments"
|
|
1224
|
+
|
|
1225
|
+
def get_inline_comments(self, page_id):
|
|
1226
|
+
"""Return the inline annotations anchored in a page's body.
|
|
1227
|
+
|
|
1228
|
+
This uses Confluence Server/Data Center's undocumented inline-comment
|
|
1229
|
+
plugin endpoint. Its response shape is intentionally returned
|
|
1230
|
+
unchanged because it varies between Confluence releases.
|
|
1231
|
+
|
|
1232
|
+
:param page_id: ID of the page containing the annotations.
|
|
1233
|
+
"""
|
|
1234
|
+
return self.get(self._inline_comments_resource, params={"containerId": page_id})
|
|
1235
|
+
|
|
1236
|
+
def add_inline_comment(
|
|
1237
|
+
self,
|
|
1238
|
+
page_id,
|
|
1239
|
+
selection,
|
|
1240
|
+
body,
|
|
1241
|
+
match_index=0,
|
|
1242
|
+
num_matches=1,
|
|
1243
|
+
serialized_highlights="",
|
|
1244
|
+
last_fetch_time=None,
|
|
1245
|
+
):
|
|
1246
|
+
"""Create an inline annotation anchored to selected page text.
|
|
1247
|
+
|
|
1248
|
+
``selection`` must exactly match text in the current page body.
|
|
1249
|
+
``match_index`` selects which matching occurrence should be annotated.
|
|
1250
|
+
Confluence creates the marker in storage automatically; callers must
|
|
1251
|
+
not update the page body or version themselves.
|
|
1252
|
+
|
|
1253
|
+
This is an undocumented Server/Data Center UI endpoint.
|
|
1254
|
+
"""
|
|
1255
|
+
if not selection or not isinstance(selection, str):
|
|
1256
|
+
raise ApiValueError("selection must be a non-empty string")
|
|
1257
|
+
if not body or not isinstance(body, str):
|
|
1258
|
+
raise ApiValueError("body must be a non-empty storage-format string")
|
|
1259
|
+
if not isinstance(match_index, int) or match_index < 0:
|
|
1260
|
+
raise ApiValueError("match_index must be a non-negative integer")
|
|
1261
|
+
if not isinstance(num_matches, int) or num_matches < 1:
|
|
1262
|
+
raise ApiValueError("num_matches must be a positive integer")
|
|
1263
|
+
|
|
1264
|
+
data = {
|
|
1265
|
+
"containerId": page_id,
|
|
1266
|
+
"body": body,
|
|
1267
|
+
"originalSelection": selection,
|
|
1268
|
+
"matchIndex": match_index,
|
|
1269
|
+
"numMatches": num_matches,
|
|
1270
|
+
"lastFetchTime": int(time.time() * 1000) if last_fetch_time is None else last_fetch_time,
|
|
1271
|
+
"serializedHighlights": serialized_highlights,
|
|
1272
|
+
}
|
|
1273
|
+
return self.post(self._inline_comments_resource, data=data)
|
|
1274
|
+
|
|
1275
|
+
def reply_to_inline_comment(self, page_id, comment_id, body):
|
|
1276
|
+
"""Reply to an inline annotation using the regular content API.
|
|
1277
|
+
|
|
1278
|
+
This is supported by Confluence's comment hierarchy even though the
|
|
1279
|
+
annotation itself originates from the inline-comments plugin endpoint.
|
|
1280
|
+
"""
|
|
1281
|
+
if not body or not isinstance(body, str):
|
|
1282
|
+
raise ApiValueError("body must be a non-empty storage-format string")
|
|
1283
|
+
|
|
1284
|
+
data = {
|
|
1285
|
+
"type": "comment",
|
|
1286
|
+
"container": {"id": page_id, "type": "page", "status": "current"},
|
|
1287
|
+
"ancestors": [{"id": comment_id}],
|
|
1288
|
+
"body": self._create_body(body, "storage"),
|
|
1289
|
+
}
|
|
1290
|
+
return self.post("rest/api/content", data=data)
|
|
1291
|
+
|
|
1292
|
+
def resolve_inline_comment(self, page_id, comment_id, resolved=True, dangling=False):
|
|
1293
|
+
"""Resolve or reopen an inline annotation.
|
|
1294
|
+
|
|
1295
|
+
The plugin requires the complete annotation object in the PUT payload,
|
|
1296
|
+
so the method first retrieves annotations for ``page_id``. ``dangling``
|
|
1297
|
+
should be true only when the annotation no longer has a valid anchor.
|
|
1298
|
+
|
|
1299
|
+
This is an undocumented Server/Data Center UI endpoint.
|
|
1300
|
+
"""
|
|
1301
|
+
comments = self.get_inline_comments(page_id)
|
|
1302
|
+
if isinstance(comments, dict):
|
|
1303
|
+
comments = comments.get("results", comments.get("comments", []))
|
|
1304
|
+
if not isinstance(comments, list):
|
|
1305
|
+
raise ApiError("Confluence returned an unexpected inline comments response")
|
|
1306
|
+
|
|
1307
|
+
comment = next((item for item in comments if str(item.get("id")) == str(comment_id)), None)
|
|
1308
|
+
if comment is None:
|
|
1309
|
+
raise ApiNotFoundError(f"Inline comment '{comment_id}' was not found on page '{page_id}'")
|
|
1310
|
+
|
|
1311
|
+
data = dict(comment)
|
|
1312
|
+
data.update(
|
|
1313
|
+
{
|
|
1314
|
+
"containerId": data.get("containerId", page_id),
|
|
1315
|
+
"lastFetchTime": data.get("lastFetchTime", int(time.time() * 1000)),
|
|
1316
|
+
"serializedHighlights": data.get("serializedHighlights", ""),
|
|
1317
|
+
"deleted": data.get("deleted", False),
|
|
1318
|
+
"active": data.get("active", True),
|
|
1319
|
+
}
|
|
1320
|
+
)
|
|
1321
|
+
resolve_path = (
|
|
1322
|
+
f"{self._inline_comments_resource}/{comment_id}/resolve/"
|
|
1323
|
+
f"{str(bool(resolved)).lower()}/dangling/{str(bool(dangling)).lower()}"
|
|
1324
|
+
)
|
|
1325
|
+
return self.put(resolve_path, data=data)
|
|
1326
|
+
|
|
1327
|
+
# Like management
|
|
1328
|
+
# These endpoints are used by the Confluence Server/Data Center web UI,
|
|
1329
|
+
# but are not part of Atlassian's documented REST API.
|
|
1330
|
+
_likes_resource = "rest/likes/1.0/content"
|
|
1331
|
+
|
|
1332
|
+
def get_likes(self, content_id):
|
|
1333
|
+
"""Return likes for a page, blog post, or comment.
|
|
1334
|
+
|
|
1335
|
+
The raw UI endpoint response includes both ``content_type`` and
|
|
1336
|
+
``content_id``. This is an undocumented Server/Data Center endpoint.
|
|
1337
|
+
"""
|
|
1338
|
+
return self.get(f"{self._likes_resource}/{content_id}/likes")
|
|
1339
|
+
|
|
1340
|
+
def add_like(self, content_id, username=None):
|
|
1341
|
+
"""Like content as ``username`` or the configured authenticated user.
|
|
1342
|
+
|
|
1343
|
+
The operation is idempotent: when Confluence reports that the user has
|
|
1344
|
+
already liked the content, the current like list is returned instead of
|
|
1345
|
+
surfacing its otherwise ambiguous HTTP 400 response.
|
|
1346
|
+
"""
|
|
1347
|
+
username = username or self.username
|
|
1348
|
+
if not username:
|
|
1349
|
+
raise ApiValueError("username is required when the client has no configured username")
|
|
1350
|
+
|
|
1351
|
+
try:
|
|
1352
|
+
return self.post(f"{self._likes_resource}/{content_id}/likes", data={"username": username})
|
|
1353
|
+
except HTTPError as error:
|
|
1354
|
+
response = error.response
|
|
1355
|
+
message = response.text.lower() if response is not None else ""
|
|
1356
|
+
if response is not None and response.status_code == 400 and "cannot be liked" in message:
|
|
1357
|
+
return self.get_likes(content_id)
|
|
1358
|
+
raise
|
|
1359
|
+
|
|
1360
|
+
def remove_like(self, content_id):
|
|
1361
|
+
"""Remove the authenticated user's like from content.
|
|
1362
|
+
|
|
1363
|
+
This is an undocumented Server/Data Center UI endpoint. Confluence
|
|
1364
|
+
determines the like to remove from the authenticated user.
|
|
1365
|
+
"""
|
|
1366
|
+
return self.delete(f"{self._likes_resource}/{content_id}/likes")
|
|
1367
|
+
|
|
1104
1368
|
def attach_content(
|
|
1105
1369
|
self,
|
|
1106
1370
|
content,
|
|
@@ -1172,15 +1436,26 @@ class Server(ConfluenceServerBase):
|
|
|
1172
1436
|
pass
|
|
1173
1437
|
|
|
1174
1438
|
if existing_attachment:
|
|
1175
|
-
# Update existing attachment
|
|
1439
|
+
# Update existing attachment on the specific attachment ID
|
|
1176
1440
|
attachment_id = existing_attachment["id"]
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
path
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1441
|
+
if self.api_version == "1.0":
|
|
1442
|
+
# older API versions use POST on data path below the child
|
|
1443
|
+
update_path = f"{path}/{attachment_id}/data"
|
|
1444
|
+
response = self.post(
|
|
1445
|
+
path=update_path,
|
|
1446
|
+
data=data,
|
|
1447
|
+
headers=headers,
|
|
1448
|
+
files={"file": (name, content, content_type)},
|
|
1449
|
+
)
|
|
1450
|
+
else:
|
|
1451
|
+
# newer API versions use PUT on a path derived from the attachment ID directly
|
|
1452
|
+
update_path = f"rest/api/content/{attachment_id}"
|
|
1453
|
+
response = self.put(
|
|
1454
|
+
path=update_path,
|
|
1455
|
+
data=data,
|
|
1456
|
+
headers=headers,
|
|
1457
|
+
files={"file": (name, content, content_type)},
|
|
1458
|
+
)
|
|
1184
1459
|
else:
|
|
1185
1460
|
# Create new attachment using POST
|
|
1186
1461
|
response = self.post(
|
|
@@ -3411,13 +3686,14 @@ class Server(ConfluenceServerBase):
|
|
|
3411
3686
|
:return: PDF File
|
|
3412
3687
|
"""
|
|
3413
3688
|
headers = self.form_token_headers
|
|
3414
|
-
url = f"spaces/flyingpdf/pdfpageexport.action?pageId={page_id}"
|
|
3415
|
-
response = self.get(url, headers=headers, advanced_mode=True)
|
|
3689
|
+
url = self._ui_url(f"spaces/flyingpdf/pdfpageexport.action?pageId={page_id}")
|
|
3690
|
+
response = self.get(url, headers=headers, absolute=True, advanced_mode=True)
|
|
3416
3691
|
content = response.content
|
|
3417
3692
|
if not content.startswith(b"%PDF-"):
|
|
3418
3693
|
raise ApiError(
|
|
3419
|
-
"Confluence returned non-PDF content while exporting the page
|
|
3420
|
-
"Check the page permissions
|
|
3694
|
+
"Confluence returned non-PDF content while exporting the page from "
|
|
3695
|
+
f"{getattr(response, 'url', url)}. Check the page permissions, "
|
|
3696
|
+
"authentication configuration, and Confluence context path."
|
|
3421
3697
|
)
|
|
3422
3698
|
return content
|
|
3423
3699
|
|
|
@@ -3456,8 +3732,8 @@ class Server(ConfluenceServerBase):
|
|
|
3456
3732
|
:return: Legacy Word-export bytes
|
|
3457
3733
|
"""
|
|
3458
3734
|
headers = self.form_token_headers
|
|
3459
|
-
url = f"exportword?pageId={page_id}"
|
|
3460
|
-
return self.get(url, headers=headers, not_json_response=True)
|
|
3735
|
+
url = self._ui_url(f"exportword?pageId={page_id}")
|
|
3736
|
+
return self.get(url, headers=headers, not_json_response=True, absolute=True)
|
|
3461
3737
|
|
|
3462
3738
|
def get_space_export(self, space_key: str, export_type: str) -> str:
|
|
3463
3739
|
"""
|
|
@@ -3715,102 +3991,6 @@ class Server(ConfluenceServerBase):
|
|
|
3715
3991
|
|
|
3716
3992
|
return response
|
|
3717
3993
|
|
|
3718
|
-
def get_plugins_info(self):
|
|
3719
|
-
"""
|
|
3720
|
-
Provide plugins info
|
|
3721
|
-
:return a json of installed plugins
|
|
3722
|
-
"""
|
|
3723
|
-
url = "rest/plugins/1.0/"
|
|
3724
|
-
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
3725
|
-
|
|
3726
|
-
def get_plugin_info(self, plugin_key):
|
|
3727
|
-
"""
|
|
3728
|
-
Provide plugin info
|
|
3729
|
-
:return a json of installed plugins
|
|
3730
|
-
"""
|
|
3731
|
-
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
3732
|
-
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
3733
|
-
|
|
3734
|
-
def get_plugin_license_info(self, plugin_key):
|
|
3735
|
-
"""
|
|
3736
|
-
Provide plugin license info
|
|
3737
|
-
:return a json specific License query
|
|
3738
|
-
"""
|
|
3739
|
-
url = f"rest/plugins/1.0/{plugin_key}-key/license"
|
|
3740
|
-
return self.get(url, headers=self.no_check_headers, trailing=True)
|
|
3741
|
-
|
|
3742
|
-
def upload_plugin(self, plugin_path):
|
|
3743
|
-
"""
|
|
3744
|
-
Provide plugin path for upload into Jira e.g. useful for auto deploy
|
|
3745
|
-
:param plugin_path:
|
|
3746
|
-
:return:
|
|
3747
|
-
"""
|
|
3748
|
-
files = {"plugin": open(plugin_path, "rb")}
|
|
3749
|
-
upm_token = self.request(
|
|
3750
|
-
method="GET",
|
|
3751
|
-
path="rest/plugins/1.0/",
|
|
3752
|
-
headers=self.no_check_headers,
|
|
3753
|
-
trailing=True,
|
|
3754
|
-
).headers["upm-token"]
|
|
3755
|
-
url = f"rest/plugins/1.0/?token={upm_token}"
|
|
3756
|
-
return self.post(url, files=files, headers=self.no_check_headers)
|
|
3757
|
-
|
|
3758
|
-
def disable_plugin(self, plugin_key):
|
|
3759
|
-
"""
|
|
3760
|
-
Disable a plugin
|
|
3761
|
-
:param plugin_key:
|
|
3762
|
-
:return:
|
|
3763
|
-
"""
|
|
3764
|
-
app_headers = {
|
|
3765
|
-
"X-Atlassian-Token": "no-check",
|
|
3766
|
-
"Content-Type": "application/vnd.atl.plugins+json",
|
|
3767
|
-
}
|
|
3768
|
-
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
3769
|
-
data = {"status": "disabled"}
|
|
3770
|
-
return self.put(url, data=data, headers=app_headers)
|
|
3771
|
-
|
|
3772
|
-
def enable_plugin(self, plugin_key):
|
|
3773
|
-
"""
|
|
3774
|
-
Enable a plugin
|
|
3775
|
-
:param plugin_key:
|
|
3776
|
-
:return:
|
|
3777
|
-
"""
|
|
3778
|
-
app_headers = {
|
|
3779
|
-
"X-Atlassian-Token": "no-check",
|
|
3780
|
-
"Content-Type": "application/vnd.atl.plugins+json",
|
|
3781
|
-
}
|
|
3782
|
-
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
3783
|
-
data = {"status": "enabled"}
|
|
3784
|
-
return self.put(url, data=data, headers=app_headers)
|
|
3785
|
-
|
|
3786
|
-
def delete_plugin(self, plugin_key):
|
|
3787
|
-
"""
|
|
3788
|
-
Delete plugin
|
|
3789
|
-
:param plugin_key:
|
|
3790
|
-
:return:
|
|
3791
|
-
"""
|
|
3792
|
-
url = f"rest/plugins/1.0/{plugin_key}-key"
|
|
3793
|
-
return self.delete(url)
|
|
3794
|
-
|
|
3795
|
-
def check_plugin_manager_status(self):
|
|
3796
|
-
url = "rest/plugins/latest/safe-mode"
|
|
3797
|
-
return self.request(method="GET", path=url, headers=self.safe_mode_headers)
|
|
3798
|
-
|
|
3799
|
-
def update_plugin_license(self, plugin_key, raw_license):
|
|
3800
|
-
"""
|
|
3801
|
-
Update license for plugin
|
|
3802
|
-
:param plugin_key:
|
|
3803
|
-
:param raw_license:
|
|
3804
|
-
:return:
|
|
3805
|
-
"""
|
|
3806
|
-
app_headers = {
|
|
3807
|
-
"X-Atlassian-Token": "no-check",
|
|
3808
|
-
"Content-Type": "application/vnd.atl.plugins+json",
|
|
3809
|
-
}
|
|
3810
|
-
url = f"/plugins/1.0/{plugin_key}/license"
|
|
3811
|
-
data = {"rawLicense": raw_license}
|
|
3812
|
-
return self.put(url, data=data, headers=app_headers)
|
|
3813
|
-
|
|
3814
3994
|
def check_long_tasks_result(self, start=None, limit=None, expand=None):
|
|
3815
3995
|
"""
|
|
3816
3996
|
Get result of long tasks
|
atlassian/confluence_base.py
CHANGED
|
@@ -35,7 +35,7 @@ class ConfluenceEndpoints:
|
|
|
35
35
|
"content": "api/v2/pages",
|
|
36
36
|
"page_by_id": "api/v2/pages/{id}",
|
|
37
37
|
"page": "api/v2/pages",
|
|
38
|
-
"child_pages": "api/v2/pages/{id}/children
|
|
38
|
+
"child_pages": "api/v2/pages/{id}/direct-children",
|
|
39
39
|
"page_versions": "api/v2/pages/{id}/versions",
|
|
40
40
|
"page_version": "api/v2/pages/{id}/versions/{version_number}",
|
|
41
41
|
"search": "api/v2/search",
|
atlassian/jira/jira_server.py
CHANGED
|
@@ -3464,6 +3464,16 @@ class Jira(AtlassianRestAPI):
|
|
|
3464
3464
|
"""
|
|
3465
3465
|
return self.add_project_actor_in_role(project_key, role_id, user_name, "atlassian-user-role-actor")
|
|
3466
3466
|
|
|
3467
|
+
def add_group_into_project_role(self, project_key: str, role_id: T_id, group_name: str):
|
|
3468
|
+
"""
|
|
3469
|
+
|
|
3470
|
+
:param project_key:
|
|
3471
|
+
:param role_id:
|
|
3472
|
+
:param group_name:
|
|
3473
|
+
:return:
|
|
3474
|
+
"""
|
|
3475
|
+
return self.add_project_actor_in_role(project_key, role_id, group_name, "atlassian-group-role-actor")
|
|
3476
|
+
|
|
3467
3477
|
def add_project_actor_in_role(self, project_key: str, role_id: T_id, actor: str, actor_type: str):
|
|
3468
3478
|
"""
|
|
3469
3479
|
|
atlassian/rest_client.py
CHANGED
|
@@ -54,6 +54,21 @@ def _curl_quote(value: str) -> str:
|
|
|
54
54
|
return "'" + value.replace("'", "'\"'\"'") + "'"
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
def _merge_extra_kwargs_into_params(kwargs: Optional[dict], params: Optional[dict]) -> Optional[dict]:
|
|
58
|
+
"""Fold extra keyword arguments into query parameters.
|
|
59
|
+
|
|
60
|
+
The HTTP verb helpers have fixed signatures, but many resource wrappers
|
|
61
|
+
forward ``**kwargs`` straight into them. Any additional keyword (e.g.
|
|
62
|
+
``expand=..., status=...``) is therefore treated as a query parameter,
|
|
63
|
+
matching the ergonomics users relied on in earlier releases.
|
|
64
|
+
"""
|
|
65
|
+
if not kwargs:
|
|
66
|
+
return params
|
|
67
|
+
merged = dict(params) if params else {}
|
|
68
|
+
merged.update(kwargs)
|
|
69
|
+
return merged
|
|
70
|
+
|
|
71
|
+
|
|
57
72
|
class _ExplicitTokenAuth(AuthBase):
|
|
58
73
|
"""Prevent Requests from replacing an explicit token with ``.netrc`` auth."""
|
|
59
74
|
|
|
@@ -669,6 +684,7 @@ class AtlassianRestAPI(object):
|
|
|
669
684
|
trailing: Optional[bool] = None,
|
|
670
685
|
absolute: bool = False,
|
|
671
686
|
advanced_mode: bool = False,
|
|
687
|
+
**kwargs,
|
|
672
688
|
) -> T_resp_get:
|
|
673
689
|
"""
|
|
674
690
|
Get request based on the python-requests module. You can override headers, and also, get not json response
|
|
@@ -683,6 +699,8 @@ class AtlassianRestAPI(object):
|
|
|
683
699
|
:param advanced_mode: bool, OPTIONAL: Return the raw response
|
|
684
700
|
:return:
|
|
685
701
|
"""
|
|
702
|
+
params = _merge_extra_kwargs_into_params(kwargs, params)
|
|
703
|
+
|
|
686
704
|
response = self.request(
|
|
687
705
|
"GET",
|
|
688
706
|
path=path,
|
|
@@ -827,6 +845,7 @@ class AtlassianRestAPI(object):
|
|
|
827
845
|
trailing: Optional[bool] = None,
|
|
828
846
|
absolute: bool = False,
|
|
829
847
|
advanced_mode: bool = False,
|
|
848
|
+
**kwargs,
|
|
830
849
|
) -> Union[Response, dict, None]:
|
|
831
850
|
"""
|
|
832
851
|
:param path:
|
|
@@ -840,6 +859,8 @@ class AtlassianRestAPI(object):
|
|
|
840
859
|
:param advanced_mode: bool, OPTIONAL: Return the raw response
|
|
841
860
|
:return: if advanced_mode is not set - returns dictionary. If it is set - returns raw response.
|
|
842
861
|
"""
|
|
862
|
+
params = _merge_extra_kwargs_into_params(kwargs, params)
|
|
863
|
+
|
|
843
864
|
response = self.request(
|
|
844
865
|
"POST",
|
|
845
866
|
path=path,
|
|
@@ -927,6 +948,7 @@ class AtlassianRestAPI(object):
|
|
|
927
948
|
params: Optional[dict] = None,
|
|
928
949
|
absolute: bool = False,
|
|
929
950
|
advanced_mode: bool = False,
|
|
951
|
+
**kwargs,
|
|
930
952
|
) -> Union[Response, dict, None]:
|
|
931
953
|
"""
|
|
932
954
|
:param path: Path of request
|
|
@@ -939,6 +961,8 @@ class AtlassianRestAPI(object):
|
|
|
939
961
|
:param advanced_mode: bool, OPTIONAL: Return the raw response
|
|
940
962
|
:return: if advanced_mode is not set - returns dictionary. If it is set - returns raw response.
|
|
941
963
|
"""
|
|
964
|
+
params = _merge_extra_kwargs_into_params(kwargs, params)
|
|
965
|
+
|
|
942
966
|
response = self.request(
|
|
943
967
|
"PUT",
|
|
944
968
|
path=path,
|
|
@@ -969,6 +993,7 @@ class AtlassianRestAPI(object):
|
|
|
969
993
|
params: Optional[dict] = None,
|
|
970
994
|
absolute: bool = False,
|
|
971
995
|
advanced_mode: bool = False,
|
|
996
|
+
**kwargs,
|
|
972
997
|
) -> T_resp:
|
|
973
998
|
"""
|
|
974
999
|
:param path: Path of request
|
|
@@ -981,6 +1006,8 @@ class AtlassianRestAPI(object):
|
|
|
981
1006
|
:param advanced_mode: bool, OPTIONAL: Return the raw response
|
|
982
1007
|
:return: if advanced_mode is not set - returns dictionary. If it is set - returns raw response.
|
|
983
1008
|
"""
|
|
1009
|
+
params = _merge_extra_kwargs_into_params(kwargs, params)
|
|
1010
|
+
|
|
984
1011
|
response = self.request(
|
|
985
1012
|
"PATCH",
|
|
986
1013
|
path=path,
|
|
@@ -1062,6 +1089,7 @@ class AtlassianRestAPI(object):
|
|
|
1062
1089
|
trailing: Optional[bool] = None,
|
|
1063
1090
|
absolute: bool = False,
|
|
1064
1091
|
advanced_mode: bool = False,
|
|
1092
|
+
**kwargs,
|
|
1065
1093
|
) -> T_resp:
|
|
1066
1094
|
"""
|
|
1067
1095
|
Deletes resources at given paths.
|
|
@@ -1077,6 +1105,8 @@ class AtlassianRestAPI(object):
|
|
|
1077
1105
|
Some of Atlassian REST resources don't return any content.
|
|
1078
1106
|
If advanced_mode is set - returns raw response.
|
|
1079
1107
|
"""
|
|
1108
|
+
params = _merge_extra_kwargs_into_params(kwargs, params)
|
|
1109
|
+
|
|
1080
1110
|
response = self.request(
|
|
1081
1111
|
"DELETE",
|
|
1082
1112
|
path=path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atlassian-python-api
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.5
|
|
4
4
|
Summary: Python Atlassian REST API Wrapper
|
|
5
5
|
Home-page: https://github.com/atlassian-api/atlassian-python-api
|
|
6
6
|
Download-URL: https://github.com/atlassian-api/atlassian-python-api
|
|
@@ -405,12 +405,9 @@ In addition to all the contributors we would like to thank these vendors:
|
|
|
405
405
|
* Atlassian_ for developing such a powerful ecosystem.
|
|
406
406
|
* JetBrains_ for providing us with free licenses of PyCharm_
|
|
407
407
|
* Microsoft_ for providing us with free licenses of VSCode_
|
|
408
|
-
* Cursor.com_ for AI assistance in development
|
|
409
|
-
* John B Batzel (batzel@upenn.edu) for implementing the Confluence Cloud v2 API support
|
|
410
408
|
|
|
411
409
|
.. _Atlassian: https://www.atlassian.com/
|
|
412
410
|
.. _JetBrains: http://www.jetbrains.com
|
|
413
411
|
.. _PyCharm: http://www.jetbrains.com/pycharm/
|
|
414
412
|
.. _Microsoft: https://www.microsoft.com
|
|
415
413
|
.. _VSCode: https://code.visualstudio.com
|
|
416
|
-
.. _Cursor.com: https://cursor.com
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
atlassian/VERSION,sha256=
|
|
1
|
+
atlassian/VERSION,sha256=MNrm5SRFMxj32oZ4FbyLblBIjmF8JvBvTLuDZAdiBXA,5
|
|
2
2
|
atlassian/__init__.py,sha256=SY3OF9chyRpWh4N4r-6XXavJWN8_u_Rt6OuZloiQtWs,2134
|
|
3
|
-
atlassian/bamboo.py,sha256=
|
|
3
|
+
atlassian/bamboo.py,sha256=3sTb8sEpgVlWLGcZeXHBFn88YYQUAPMjwRYZF7bHYHM,87083
|
|
4
4
|
atlassian/cloud_admin.py,sha256=n6wYOBF-pGZy8u-oOZwmear5tGNhfZA1gw1SfMs91G8,25424
|
|
5
5
|
atlassian/company_calendar.py,sha256=62bhEMjm81FEQm3CppD96mSJDgf_KdZL4SCcej_a3-s,7719
|
|
6
|
-
atlassian/confluence_base.py,sha256=
|
|
6
|
+
atlassian/confluence_base.py,sha256=gSICjaD1QF3RkWRMrBinT5ekSWxyZUdAxaTcrUVHDFI,12424
|
|
7
7
|
atlassian/confluence_v2.py,sha256=YdIjMWeX4ltnVB0aZP0NvggdkfWaXjA7_0wc-WSPHJ4,190
|
|
8
8
|
atlassian/crowd.py,sha256=fqr-m62b6p__IinnP0pgmIWLeok5Ia4wpxY8x1OW11w,60019
|
|
9
9
|
atlassian/errors.py,sha256=5Ob7l1ZCF2-mjejJyVt0bkvDZxoUGZVaMdLpeFxasVk,569
|
|
@@ -13,7 +13,7 @@ atlassian/marketplace.py,sha256=dLm4I8GROkdhyu3BdGtK_ssq1g44KZFi8S0HS_ZepLs,2540
|
|
|
13
13
|
atlassian/portfolio.py,sha256=q38sFFC7DHmHM4vsFzl8sT7HcRRGKH3tT5nRlqltDzc,3696
|
|
14
14
|
atlassian/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
atlassian/request_utils.py,sha256=eDWGtbbhGGoqQOqqqclaO7vuJRexzIZeTAYu7aluDuw,510
|
|
16
|
-
atlassian/rest_client.py,sha256=
|
|
16
|
+
atlassian/rest_client.py,sha256=pLyW3s6UnZzWQl75CeKgDjm8xerSyau2wihuXJJKma8,40764
|
|
17
17
|
atlassian/service_desk.py,sha256=Uu2QLAenDuKnvhuohySBE5iNgeDJr3qS-t82VNZF7og,38158
|
|
18
18
|
atlassian/statuspage.py,sha256=0LTBsvKI-PiODx-8jn_oM9fFZ-FlcaQSQu7aa6lRZ40,93561
|
|
19
19
|
atlassian/typehints.py,sha256=FlVBdWUVK5nR-t4UhkzNRPl-PZF0c19unjKvcBF8s-k,522
|
|
@@ -29,7 +29,7 @@ atlassian/bitbucket/cloud/common/__init__.py,sha256=xhpE0cKTpx6a1jjazmjIexNFuq0a
|
|
|
29
29
|
atlassian/bitbucket/cloud/common/builds.py,sha256=S9Ox26WDiFjdHU9XqEVQz7ddC4LV3f4h55L9-ITIAnE,2374
|
|
30
30
|
atlassian/bitbucket/cloud/common/comments.py,sha256=O140p9sstUBBlB0rwHpspYVXfoxRD6heeP3oyOShRSA,1578
|
|
31
31
|
atlassian/bitbucket/cloud/common/users.py,sha256=Z1lX4vgriAh9cJlHVMra4CcgSe9Sj1x-DpMa7623oIU,3720
|
|
32
|
-
atlassian/bitbucket/cloud/repositories/__init__.py,sha256=
|
|
32
|
+
atlassian/bitbucket/cloud/repositories/__init__.py,sha256=6PZFAA0OvyvimTZe42ve1iOal7Cy0Rm3PDLqJlV5jcg,18572
|
|
33
33
|
atlassian/bitbucket/cloud/repositories/branchRestrictions.py,sha256=Gr0_DYIQHtd2lyVEBqUiUXg6Y_xumRn10UgKo6iF8ck,6535
|
|
34
34
|
atlassian/bitbucket/cloud/repositories/commits.py,sha256=K3g-0-PwXIXM8niKAJRdIj6UP3nAnaDeKmqog7X5Cqc,8490
|
|
35
35
|
atlassian/bitbucket/cloud/repositories/defaultReviewers.py,sha256=MLjjZP8wkIX8wYh87IpXrYXUVgZcld8AbJU1AC1u-VE,3592
|
|
@@ -46,14 +46,14 @@ atlassian/bitbucket/cloud/repositories/repositoryVariables.py,sha256=Hhz4tNXMX6W
|
|
|
46
46
|
atlassian/bitbucket/cloud/workspaces/__init__.py,sha256=Ygz_-zp79fMKIScVE1G527spWMXS9EL9D20LnW7kfC8,6108
|
|
47
47
|
atlassian/bitbucket/cloud/workspaces/members.py,sha256=fFP4ubBurFkMTDvZrQKSz5KN3cSVZnT1OBff2g8qYlE,1775
|
|
48
48
|
atlassian/bitbucket/cloud/workspaces/permissions.py,sha256=sD71xM3eaR4KbU6K86IeFiVaXnvnKCl6i-23Q_JaA14,3947
|
|
49
|
-
atlassian/bitbucket/cloud/workspaces/projects.py,sha256=
|
|
49
|
+
atlassian/bitbucket/cloud/workspaces/projects.py,sha256=5Jl2Z07COjdtS61p2HNa78fBnuf99R6pDi9uoqK01vA,7548
|
|
50
50
|
atlassian/bitbucket/server/__init__.py,sha256=lkWbY71gk0lhBN4dfBOHk1CQS1ByhQcPU6pFVyICwqI,2178
|
|
51
51
|
atlassian/bitbucket/server/base.py,sha256=43GYeayyCzqwFlJC3P1zYRJ4T948I1JCL5b62f1sIDo,1839
|
|
52
|
-
atlassian/bitbucket/server/globalPermissions.py,sha256=
|
|
52
|
+
atlassian/bitbucket/server/globalPermissions.py,sha256=1I0lUDtnNPAB-BUCy1rAV7TCtqY2rkEdTR2vHEj4SF8,6004
|
|
53
53
|
atlassian/bitbucket/server/common/__init__.py,sha256=woZpR3WXAA3A99hZ1UZI_gLPHaATxEyCWW7GRTCI4e4,38
|
|
54
|
-
atlassian/bitbucket/server/common/permissions.py,sha256=
|
|
55
|
-
atlassian/bitbucket/server/projects/__init__.py,sha256=
|
|
56
|
-
atlassian/bitbucket/server/projects/repos/__init__.py,sha256=
|
|
54
|
+
atlassian/bitbucket/server/common/permissions.py,sha256=lZvfJjAUXdezMipsUvu6fJ8ic-DfOYU6-xQAwPQsc34,7337
|
|
55
|
+
atlassian/bitbucket/server/projects/__init__.py,sha256=H5IdCTFmApbvt3D8v8CO-hjfvg8r-YQ9FaVBv-4QaDA,7675
|
|
56
|
+
atlassian/bitbucket/server/projects/repos/__init__.py,sha256=VycioPeKGU9L_Utyh8dImcWyl9J6VsyWkugYJICLwVo,10786
|
|
57
57
|
atlassian/compass/__init__.py,sha256=m9WX9Tsda-CyEmfM_fIxHDvl_EzsBr6MGKllIWJBV0k,4512
|
|
58
58
|
atlassian/confluence/__init__.py,sha256=ekJNF6sF3NGZX_OKfjTWA-2E9uNgFiZ-QBhFQuKcd1Q,2752
|
|
59
59
|
atlassian/confluence/base.py,sha256=8ekb5dXMKsIFwRcV3PgBn7UKAMcbgLSoeMOvgSsLl1s,9884
|
|
@@ -61,20 +61,20 @@ atlassian/confluence/cloud/__init__.py,sha256=sxHNN7IVZwZbiBmcdb02HU14xYC1MHiTZi
|
|
|
61
61
|
atlassian/confluence/cloud/admin_management.py,sha256=4XhcvuNf6xSN6n8rliKmfIDeGuzWdBlYn_HN9uxMJ2o,5013
|
|
62
62
|
atlassian/confluence/cloud/base.py,sha256=fBGeqPT5OFkEiLUbGdC7frHVHKqrd0bpWDbRKPa2Tts,641
|
|
63
63
|
atlassian/confluence/cloud/classification_levels.py,sha256=Wq48I3LyvZhnFnrMnqhguLSccvsN6ulE7ceT00mGGZQ,3733
|
|
64
|
-
atlassian/confluence/cloud/cloud.py,sha256=
|
|
64
|
+
atlassian/confluence/cloud/cloud.py,sha256=pD7GMoZaOd68Z0m7usMB5iHKQbg9UqufTwLTj8aLiTQ,86418
|
|
65
65
|
atlassian/confluence/cloud/content_properties.py,sha256=K1t0masgvXg8vMf3bjgmF5lu8T0hsE89ADfK2ygMtKg,3174
|
|
66
66
|
atlassian/confluence/cloud/databases.py,sha256=BgmcQqNbGOnwcgrjqvJFVVk_pQWKMngycMu1jJ0_nDU,2298
|
|
67
67
|
atlassian/confluence/cloud/folders.py,sha256=R3QQ_Kzm2wgJ1PZIVT2Zi2allmja8-XvjloFqaPij9Y,1946
|
|
68
68
|
atlassian/confluence/cloud/graphql.py,sha256=y-j3H5ts2tjIC8NnRDN5LbDl3hjAgpVYQKFMdRCb8xs,3224
|
|
69
69
|
atlassian/confluence/cloud/tasks.py,sha256=uKNvqx1hL-KGZksJi7bweJu5OducgsfD7I_IyewmJpU,4171
|
|
70
70
|
atlassian/confluence/cloud/whiteboards.py,sha256=S3CHRz7CdxcuROOTTrOX5dURHpYg1LAyw1BXpW5WTwM,4078
|
|
71
|
-
atlassian/confluence/server/__init__.py,sha256=
|
|
71
|
+
atlassian/confluence/server/__init__.py,sha256=3wm39YLYgRzuaoDz_fbqXNLrvrfltm1Ex4Q_AY4pkiM,183282
|
|
72
72
|
atlassian/confluence/server/base.py,sha256=UMUnkzriIwJkiqzl2jhdZKBfYE4-a2PswKIXCH8dckc,644
|
|
73
73
|
atlassian/confluence/server/confluence_server.py,sha256=hNnuCHurlX7_brnCaA5tlvCWwkgZw6VCPRWR_7FCs60,729
|
|
74
74
|
atlassian/jira/__init__.py,sha256=yrCGr9z8KEvD2Qg_hWsyOz2xLtk0Scr_EPNBx98Xb1s,558
|
|
75
75
|
atlassian/jira/core_methods.py,sha256=s9_p351kxP8qL5Rlt-bz6WUuAMfIevGO2K1MnaGtItU,447800
|
|
76
76
|
atlassian/jira/jira_cloud.py,sha256=E2LlSNPSFir-qfDYpvqES6fJ2yP4Hf99-sVHK_6YidM,10056
|
|
77
|
-
atlassian/jira/jira_server.py,sha256=
|
|
77
|
+
atlassian/jira/jira_server.py,sha256=X1wAzgi4cOYcgGPesINUMC_yIiwsdJY0VKnH5NZsVss,261375
|
|
78
78
|
atlassian/jira/service_management_methods.py,sha256=cx_T93b3wab6XU280XX3j0JjHQpPI9PXvHZD_mrOt9s,52954
|
|
79
79
|
atlassian/jira/software_methods.py,sha256=Jcv8ZTFu8BZqUx7lUvfU-Hx2-JmVk0HZFEZZBAzWhl0,74766
|
|
80
80
|
atlassian/models/__init__.py,sha256=S1hkaCTPlKMwc_PedSMuDsljB7inRGL6BqkHlGV-QTw,121
|
|
@@ -109,8 +109,8 @@ atlassian/yogi/yogi_confluence_cloud.py,sha256=ZXOyikQta8Z4-RgSWbwIaoED6iw-3sUMC
|
|
|
109
109
|
atlassian/yogi/yogi_confluence_dc.py,sha256=zQ8YntykqiYZBR8-NzhghifE3UMh6wbiz28WFk7GU-s,3861
|
|
110
110
|
atlassian/yogi/yogi_jira_cloud.py,sha256=cD90nhN46RIHOD_kSHWCizB4wYYrjvF0DdHLgptW5No,224
|
|
111
111
|
atlassian/yogi/yogi_jira_dc.py,sha256=sOXiNU78trHqJ0KOEn7pwXY9er7UWbgBuAElDl6aXEU,2956
|
|
112
|
-
atlassian_python_api-5.0.
|
|
113
|
-
atlassian_python_api-5.0.
|
|
114
|
-
atlassian_python_api-5.0.
|
|
115
|
-
atlassian_python_api-5.0.
|
|
116
|
-
atlassian_python_api-5.0.
|
|
112
|
+
atlassian_python_api-5.0.5.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
|
|
113
|
+
atlassian_python_api-5.0.5.dist-info/METADATA,sha256=QfOXxSq5m10rsiNAYyY9c2iQ6Xnovv7u3NFb6QCIQkU,13872
|
|
114
|
+
atlassian_python_api-5.0.5.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
115
|
+
atlassian_python_api-5.0.5.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
|
|
116
|
+
atlassian_python_api-5.0.5.dist-info/RECORD,,
|
|
File without changes
|
{atlassian_python_api-5.0.4.dist-info → atlassian_python_api-5.0.5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|