atlassian-python-api 3.41.9__py3-none-any.whl → 3.41.11__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/bitbucket/__init__.py +4 -1
- atlassian/bitbucket/cloud/repositories/commits.py +4 -1
- atlassian/confluence.py +28 -2
- atlassian/insight.py +25 -5
- atlassian/jira.py +134 -3
- atlassian/rest_client.py +53 -1
- {atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/METADATA +1 -1
- {atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/RECORD +12 -12
- {atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/LICENSE +0 -0
- {atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/WHEEL +0 -0
- {atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/top_level.txt +0 -0
atlassian/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.41.
|
|
1
|
+
3.41.11
|
atlassian/bitbucket/__init__.py
CHANGED
|
@@ -1781,7 +1781,10 @@ class Bitbucket(BitbucketBase):
|
|
|
1781
1781
|
:param start:
|
|
1782
1782
|
:return:
|
|
1783
1783
|
"""
|
|
1784
|
-
|
|
1784
|
+
if self.cloud:
|
|
1785
|
+
url = "{}/activity".format(self._url_pull_request(project_key, repository_slug, pull_request_id))
|
|
1786
|
+
else:
|
|
1787
|
+
url = "{}/activities".format(self._url_pull_request(project_key, repository_slug, pull_request_id))
|
|
1785
1788
|
params = {}
|
|
1786
1789
|
if start:
|
|
1787
1790
|
params["start"] = start
|
|
@@ -34,7 +34,10 @@ class Commits(BitbucketCloudBase):
|
|
|
34
34
|
params["sort"] = sort
|
|
35
35
|
if q is not None:
|
|
36
36
|
params["q"] = q
|
|
37
|
-
|
|
37
|
+
trailing = True
|
|
38
|
+
if top is not None:
|
|
39
|
+
trailing = False
|
|
40
|
+
for commit in self._get_paged(top, trailing=trailing, params=params):
|
|
38
41
|
yield self.__get_object(commit)
|
|
39
42
|
|
|
40
43
|
def get(self, commit_hash):
|
atlassian/confluence.py
CHANGED
|
@@ -3,7 +3,7 @@ import logging
|
|
|
3
3
|
import os
|
|
4
4
|
import time
|
|
5
5
|
import json
|
|
6
|
-
|
|
6
|
+
import re
|
|
7
7
|
from requests import HTTPError
|
|
8
8
|
import requests
|
|
9
9
|
from deprecated import deprecated
|
|
@@ -397,6 +397,32 @@ class Confluence(AtlassianRestAPI):
|
|
|
397
397
|
except Exception as e:
|
|
398
398
|
log.error("Error occured", e)
|
|
399
399
|
|
|
400
|
+
def scrap_regex_from_page(self, page_id, regex):
|
|
401
|
+
"""
|
|
402
|
+
Method scraps regex patterns from a Confluence page_id.
|
|
403
|
+
|
|
404
|
+
:param page_id: The ID of the Confluence page.
|
|
405
|
+
:param regex: The regex pattern to scrape.
|
|
406
|
+
:return: A list of regex matches.
|
|
407
|
+
"""
|
|
408
|
+
regex_output = []
|
|
409
|
+
page_output = self.get_page_by_id(page_id, expand="body.storage")["body"]["storage"]["value"]
|
|
410
|
+
try:
|
|
411
|
+
if page_output is not None:
|
|
412
|
+
description_matches = [x.group(0) for x in re.finditer(regex, page_output)]
|
|
413
|
+
if description_matches:
|
|
414
|
+
regex_output.extend(description_matches)
|
|
415
|
+
return regex_output
|
|
416
|
+
except HTTPError as e:
|
|
417
|
+
if e.response.status_code == 404:
|
|
418
|
+
# Raise ApiError as the documented reason is ambiguous
|
|
419
|
+
log.error("couldn't find page_id : ", page_id)
|
|
420
|
+
raise ApiNotFoundError(
|
|
421
|
+
"There is no content with the given page id,"
|
|
422
|
+
"or the calling user does not have permission to view the page",
|
|
423
|
+
reason=e,
|
|
424
|
+
)
|
|
425
|
+
|
|
400
426
|
def get_page_labels(self, page_id, prefix=None, start=None, limit=None):
|
|
401
427
|
"""
|
|
402
428
|
Returns the list of labels on a piece of Content.
|
|
@@ -2787,7 +2813,7 @@ class Confluence(AtlassianRestAPI):
|
|
|
2787
2813
|
headers = self.form_token_headers
|
|
2788
2814
|
log.info("Initiate PDF export from Confluence Cloud")
|
|
2789
2815
|
response = self.get(url, headers=headers, not_json_response=True)
|
|
2790
|
-
response_string = response.decode(encoding="utf-8", errors="
|
|
2816
|
+
response_string = response.decode(encoding="utf-8", errors="ignore")
|
|
2791
2817
|
task_id = response_string.split('name="ajs-taskId" content="')[1].split('">')[0]
|
|
2792
2818
|
poll_url = "/services/api/v1/task/{0}/progress".format(task_id)
|
|
2793
2819
|
while running_task:
|
atlassian/insight.py
CHANGED
|
@@ -411,11 +411,11 @@ class Insight(AtlassianRestAPI):
|
|
|
411
411
|
iql,
|
|
412
412
|
object_type_id,
|
|
413
413
|
results_per_page,
|
|
414
|
-
order_by_type_attr_id,
|
|
415
|
-
object_id,
|
|
416
|
-
object_schema_id,
|
|
417
|
-
include_attributes,
|
|
418
|
-
attributes_to_display,
|
|
414
|
+
order_by_type_attr_id=None,
|
|
415
|
+
object_id=None,
|
|
416
|
+
object_schema_id=None,
|
|
417
|
+
include_attributes=None,
|
|
418
|
+
attributes_to_display=None,
|
|
419
419
|
page=1,
|
|
420
420
|
asc=0,
|
|
421
421
|
):
|
|
@@ -656,3 +656,23 @@ class Insight(AtlassianRestAPI):
|
|
|
656
656
|
}
|
|
657
657
|
data = {"fields": {field_id: [{"key": i} for i in insight_keys]}}
|
|
658
658
|
return self.put("{base_url}/{key}".format(base_url=base_url, key=key), data=data)
|
|
659
|
+
|
|
660
|
+
def check_duplicate_attribute_values(self):
|
|
661
|
+
"""
|
|
662
|
+
Check for duplicate attribute values in Insight objects with cardinality maximum 1
|
|
663
|
+
used for Data Center
|
|
664
|
+
link: https://confluence.atlassian.com/jirakb/duplicated-attribute-values-in-insight-objects-with-cardinality-maximum-1-1114816155.html
|
|
665
|
+
:return:
|
|
666
|
+
"""
|
|
667
|
+
url = "rest/insight/1.0/health/consistency/duplicates/attributevalues"
|
|
668
|
+
return self.get(url)
|
|
669
|
+
|
|
670
|
+
def delete_duplicate_attribute_values(self):
|
|
671
|
+
"""
|
|
672
|
+
Delete duplicate attribute values in Insight objects with cardinality maximum 1
|
|
673
|
+
used for Data Center
|
|
674
|
+
link: https://confluence.atlassian.com/jirakb/duplicated-attribute-values-in-insight-objects-with-cardinality-maximum-1-1114816155.html
|
|
675
|
+
:return:
|
|
676
|
+
"""
|
|
677
|
+
url = "rest/insight/1.0/health/consistency/duplicates/attributevalues"
|
|
678
|
+
return self.delete(url)
|
atlassian/jira.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# coding=utf-8
|
|
2
2
|
import logging
|
|
3
3
|
import re
|
|
4
|
+
import os
|
|
4
5
|
from warnings import warn
|
|
5
6
|
from deprecated import deprecated
|
|
6
7
|
from requests import HTTPError
|
|
@@ -163,6 +164,18 @@ class Jira(AtlassianRestAPI):
|
|
|
163
164
|
Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/attachment
|
|
164
165
|
"""
|
|
165
166
|
|
|
167
|
+
def get_attachments_ids_from_issue(self, issue):
|
|
168
|
+
"""
|
|
169
|
+
Get attachments IDs from jira issue
|
|
170
|
+
:param jira issue key: str
|
|
171
|
+
:return: list of integers attachment IDs
|
|
172
|
+
"""
|
|
173
|
+
issue_id = self.get_issue(issue)["fields"]["attachment"]
|
|
174
|
+
list_attachments_id = []
|
|
175
|
+
for attachment in issue_id:
|
|
176
|
+
list_attachments_id.append({"filename": attachment["filename"], "attachment_id": attachment["id"]})
|
|
177
|
+
return list_attachments_id
|
|
178
|
+
|
|
166
179
|
def get_attachment(self, attachment_id):
|
|
167
180
|
"""
|
|
168
181
|
Returns the meta-data for an attachment, including the URI of the actual attached file
|
|
@@ -173,6 +186,44 @@ class Jira(AtlassianRestAPI):
|
|
|
173
186
|
url = "{base_url}/{attachment_id}".format(base_url=base_url, attachment_id=attachment_id)
|
|
174
187
|
return self.get(url)
|
|
175
188
|
|
|
189
|
+
def download_attachments_from_issue(self, issue, path=None, cloud=True):
|
|
190
|
+
"""
|
|
191
|
+
Downloads all attachments from a Jira issue.
|
|
192
|
+
:param issue: The issue-key of the Jira issue
|
|
193
|
+
:param path: Path to directory where attachments will be saved. If None, current working directory will be used.
|
|
194
|
+
:param cloud: Use True for Jira Cloud, false when using Jira Data Center or Server
|
|
195
|
+
:return: A message indicating the result of the download operation.
|
|
196
|
+
"""
|
|
197
|
+
try:
|
|
198
|
+
if path is None:
|
|
199
|
+
path = os.getcwd()
|
|
200
|
+
issue_id = self.issue(issue, fields="id")["id"]
|
|
201
|
+
if cloud:
|
|
202
|
+
url = self.url + f"/secure/issueAttachments/{issue_id}.zip"
|
|
203
|
+
else:
|
|
204
|
+
url = self.url + f"/secure/attachmentzip/{issue_id}.zip"
|
|
205
|
+
response = self._session.get(url)
|
|
206
|
+
attachment_name = f"{issue_id}_attachments.zip"
|
|
207
|
+
file_path = os.path.join(path, attachment_name)
|
|
208
|
+
# if Jira issue doesn't have any attachments _session.get request response will return 22 bytes of PKzip format
|
|
209
|
+
file_size = sum(len(chunk) for chunk in response.iter_content(8196))
|
|
210
|
+
if file_size == 22:
|
|
211
|
+
return "No attachments found on the Jira issue"
|
|
212
|
+
if os.path.isfile(file_path):
|
|
213
|
+
return "File already exists"
|
|
214
|
+
with open(file_path, "wb") as f:
|
|
215
|
+
f.write(response.content)
|
|
216
|
+
return "Attachments downloaded successfully"
|
|
217
|
+
|
|
218
|
+
except FileNotFoundError:
|
|
219
|
+
raise FileNotFoundError("Verify if directory path is correct and/or if directory exists")
|
|
220
|
+
except PermissionError:
|
|
221
|
+
raise PermissionError(
|
|
222
|
+
"Directory found, but there is a problem with saving file to this directory. Check directory permissions"
|
|
223
|
+
)
|
|
224
|
+
except Exception as e:
|
|
225
|
+
raise e
|
|
226
|
+
|
|
176
227
|
def get_attachment_content(self, attachment_id):
|
|
177
228
|
"""
|
|
178
229
|
Returns the content for an attachment
|
|
@@ -497,6 +548,11 @@ class Jira(AtlassianRestAPI):
|
|
|
497
548
|
url = "{base_url}/".format(base_url=base_url)
|
|
498
549
|
return self.post(url, data=component)
|
|
499
550
|
|
|
551
|
+
def update_component(self, component, component_id):
|
|
552
|
+
base_url = self.resource_url("component")
|
|
553
|
+
url = "{base_url}/{component_id}".format(base_url=base_url, component_id=component_id)
|
|
554
|
+
return self.put(url, data=component)
|
|
555
|
+
|
|
500
556
|
def delete_component(self, component_id):
|
|
501
557
|
log.warning('Deleting component "%s"', component_id)
|
|
502
558
|
base_url = self.resource_url("component")
|
|
@@ -1160,15 +1216,20 @@ class Jira(AtlassianRestAPI):
|
|
|
1160
1216
|
|
|
1161
1217
|
return self.get(url)
|
|
1162
1218
|
|
|
1163
|
-
def issue_archive(self, issue_id_or_key):
|
|
1219
|
+
def issue_archive(self, issue_id_or_key, notify_users=None):
|
|
1164
1220
|
"""
|
|
1165
1221
|
Archives an issue.
|
|
1166
1222
|
:param issue_id_or_key: Issue id or issue key
|
|
1223
|
+
:param notify_users: shall users be notified by Jira about archival?
|
|
1224
|
+
The default value of None will apply the default behavior of Jira
|
|
1167
1225
|
:return:
|
|
1168
1226
|
"""
|
|
1227
|
+
params = {}
|
|
1228
|
+
if notify_users is not None:
|
|
1229
|
+
params["notifyUsers"] = notify_users
|
|
1169
1230
|
base_url = self.resource_url("issue")
|
|
1170
1231
|
url = "{base_url}/{issueIdOrKey}/archive".format(base_url=base_url, issueIdOrKey=issue_id_or_key)
|
|
1171
|
-
return self.put(url)
|
|
1232
|
+
return self.put(url, params=params)
|
|
1172
1233
|
|
|
1173
1234
|
def issue_restore(self, issue_id_or_key):
|
|
1174
1235
|
"""
|
|
@@ -1404,7 +1465,7 @@ class Jira(AtlassianRestAPI):
|
|
|
1404
1465
|
|
|
1405
1466
|
def assign_issue(self, issue, account_id=None):
|
|
1406
1467
|
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
|
|
1407
|
-
:param issue: the issue ID or key to assign
|
|
1468
|
+
:param issue : the issue ID or key to assign
|
|
1408
1469
|
:type issue: int or str
|
|
1409
1470
|
:param account_id: the account ID of the user to assign the issue to;
|
|
1410
1471
|
for jira server the value for account_id should be a valid jira username
|
|
@@ -1526,6 +1587,45 @@ class Jira(AtlassianRestAPI):
|
|
|
1526
1587
|
params = {"notifyUsers": "true" if notify_users else "false"}
|
|
1527
1588
|
return self.put(url, data=data, params=params)
|
|
1528
1589
|
|
|
1590
|
+
def scrap_regex_from_issue(self, issue, regex):
|
|
1591
|
+
"""
|
|
1592
|
+
This function scrapes the output of the given regex matches from the issue's description and comments.
|
|
1593
|
+
|
|
1594
|
+
Parameters:
|
|
1595
|
+
issue (str): jira issue ide.
|
|
1596
|
+
regex (str): The regex to match.
|
|
1597
|
+
|
|
1598
|
+
Returns:
|
|
1599
|
+
list: A list of matches.
|
|
1600
|
+
"""
|
|
1601
|
+
regex_output = []
|
|
1602
|
+
issue_output = self.get_issue(issue)
|
|
1603
|
+
description = issue_output["fields"]["description"]
|
|
1604
|
+
comments = issue_output["fields"]["comment"]["comments"]
|
|
1605
|
+
|
|
1606
|
+
try:
|
|
1607
|
+
if description is not None:
|
|
1608
|
+
description_matches = [x.group(0) for x in re.finditer(regex, description)]
|
|
1609
|
+
if description_matches:
|
|
1610
|
+
regex_output.extend(description_matches)
|
|
1611
|
+
|
|
1612
|
+
for comment in comments:
|
|
1613
|
+
comment_html = comment["body"]
|
|
1614
|
+
comment_matches = [x.group(0) for x in re.finditer(regex, comment_html)]
|
|
1615
|
+
if comment_matches:
|
|
1616
|
+
regex_output.extend(comment_matches)
|
|
1617
|
+
|
|
1618
|
+
return regex_output
|
|
1619
|
+
except HTTPError as e:
|
|
1620
|
+
if e.response.status_code == 404:
|
|
1621
|
+
# Raise ApiError as the documented reason is ambiguous
|
|
1622
|
+
log.error("couldn't find issue: ", issue["key"])
|
|
1623
|
+
raise ApiNotFoundError(
|
|
1624
|
+
"There is no content with the given issue ud,"
|
|
1625
|
+
"or the calling user does not have permission to view the issue",
|
|
1626
|
+
reason=e,
|
|
1627
|
+
)
|
|
1628
|
+
|
|
1529
1629
|
def get_issue_remotelinks(self, issue_key, global_id=None, internal_id=None):
|
|
1530
1630
|
"""
|
|
1531
1631
|
Compatibility naming method with get_issue_remote_links()
|
|
@@ -2426,6 +2526,15 @@ class Jira(AtlassianRestAPI):
|
|
|
2426
2526
|
url = "{base_url}/{key}/version".format(base_url=base_url, key=key)
|
|
2427
2527
|
return self.get(url, params=params)
|
|
2428
2528
|
|
|
2529
|
+
def get_version(self, version):
|
|
2530
|
+
"""
|
|
2531
|
+
Returns a specific version with the given id.
|
|
2532
|
+
:param version: The id of the version to return
|
|
2533
|
+
"""
|
|
2534
|
+
base_url = self.resource_url("version")
|
|
2535
|
+
url = "{base_url}/{version}".format(base_url=base_url, version=version)
|
|
2536
|
+
return self.get(url)
|
|
2537
|
+
|
|
2429
2538
|
def add_version(
|
|
2430
2539
|
self,
|
|
2431
2540
|
project_key,
|
|
@@ -2501,6 +2610,28 @@ class Jira(AtlassianRestAPI):
|
|
|
2501
2610
|
url = "{base_url}/{version}".format(base_url=base_url, version=version)
|
|
2502
2611
|
return self.put(url, data=payload)
|
|
2503
2612
|
|
|
2613
|
+
def move_version(self, version, after=None, position=None):
|
|
2614
|
+
"""
|
|
2615
|
+
Reposition a project version
|
|
2616
|
+
:param version: The version id to move
|
|
2617
|
+
:param after: The version id to move version below
|
|
2618
|
+
:param position: A position to move the version to
|
|
2619
|
+
"""
|
|
2620
|
+
base_url = self.resource_url("version")
|
|
2621
|
+
url = "{base_url}/{version}/move".format(base_url=base_url, version=version)
|
|
2622
|
+
if after is None and position is None:
|
|
2623
|
+
raise ValueError("Must provide one of `after` or `position`")
|
|
2624
|
+
if after:
|
|
2625
|
+
after_url = self.get_version(after).get("self")
|
|
2626
|
+
return self.post(url, data={"after": after_url})
|
|
2627
|
+
if position:
|
|
2628
|
+
position = position.lower().capitalize()
|
|
2629
|
+
if position not in ["Earlier", "Later", "First", "Last"]:
|
|
2630
|
+
raise ValueError(
|
|
2631
|
+
"position must be one of Earlier, Later, First, or Last. Got {pos}".format(pos=position)
|
|
2632
|
+
)
|
|
2633
|
+
return self.post(url, data={"position": position})
|
|
2634
|
+
|
|
2504
2635
|
def get_project_roles(self, project_key):
|
|
2505
2636
|
"""
|
|
2506
2637
|
Provide associated project roles
|
atlassian/rest_client.py
CHANGED
|
@@ -3,6 +3,7 @@ import logging
|
|
|
3
3
|
from json import dumps
|
|
4
4
|
|
|
5
5
|
import requests
|
|
6
|
+
from requests.adapters import HTTPAdapter
|
|
6
7
|
|
|
7
8
|
try:
|
|
8
9
|
from oauthlib.oauth1.rfc5849 import SIGNATURE_RSA_SHA512 as SIGNATURE_RSA
|
|
@@ -11,6 +12,7 @@ except ImportError:
|
|
|
11
12
|
from requests import HTTPError
|
|
12
13
|
from requests_oauthlib import OAuth1, OAuth2
|
|
13
14
|
from six.moves.urllib.parse import urlencode
|
|
15
|
+
from urllib3.util import Retry
|
|
14
16
|
|
|
15
17
|
from atlassian.request_utils import get_default_logger
|
|
16
18
|
|
|
@@ -61,7 +63,44 @@ class AtlassianRestAPI(object):
|
|
|
61
63
|
proxies=None,
|
|
62
64
|
token=None,
|
|
63
65
|
cert=None,
|
|
66
|
+
backoff_and_retry=False,
|
|
67
|
+
retry_status_codes=[413, 429, 503],
|
|
68
|
+
max_backoff_seconds=1800,
|
|
69
|
+
max_backoff_retries=1000,
|
|
64
70
|
):
|
|
71
|
+
"""
|
|
72
|
+
init function for the AtlassianRestAPI object.
|
|
73
|
+
|
|
74
|
+
:param url: The url to be used in the request.
|
|
75
|
+
:param username: Username. Defaults to None.
|
|
76
|
+
:param password: Password. Defaults to None.
|
|
77
|
+
:param timeout: Request timeout. Defaults to 75.
|
|
78
|
+
:param api_root: Root for the api requests. Defaults to "rest/api".
|
|
79
|
+
:param api_version: Version of the API to use. Defaults to "latest".
|
|
80
|
+
:param verify_ssl: Turn on / off SSL verification. Defaults to True.
|
|
81
|
+
:param session: Pass an existing Python requests session object. Defaults to None.
|
|
82
|
+
:param oauth: oauth. Defaults to None.
|
|
83
|
+
:param oauth2: oauth2. Defaults to None.
|
|
84
|
+
:param cookies: Cookies to send with the request. Defaults to None.
|
|
85
|
+
:param advanced_mode: Return results in advanced mode. Defaults to None.
|
|
86
|
+
:param kerberos: Kerberos. Defaults to None.
|
|
87
|
+
:param cloud: Specify if using Atlassian Cloud. Defaults to False.
|
|
88
|
+
:param proxies: Specify proxies to use. Defaults to None.
|
|
89
|
+
:param token: Atlassian / Jira auth token. Defaults to None.
|
|
90
|
+
:param cert: Client-side certificate to use. Defaults to None.
|
|
91
|
+
:param backoff_and_retry: Enable exponential backoff and retry.
|
|
92
|
+
This will retry the request if there is a predefined failure. Primarily
|
|
93
|
+
designed for Atlassian Cloud where API limits are commonly hit if doing
|
|
94
|
+
operations on many issues, and the limits require a cooling off period.
|
|
95
|
+
The wait period before the next request increases exponentially with each
|
|
96
|
+
failed retry. Defaults to False.
|
|
97
|
+
:param retry_status_codes: Errors to match, passed as a list of HTTP
|
|
98
|
+
response codes. Defaults to [413, 429, 503].
|
|
99
|
+
:param max_backoff_seconds: Max backoff seconds. When backing off, requests won't
|
|
100
|
+
wait any longer than this. Defaults to 1800.
|
|
101
|
+
:param max_backoff_retries: Maximum number of retries to try before
|
|
102
|
+
continuing. Defaults to 1000.
|
|
103
|
+
"""
|
|
65
104
|
self.url = url
|
|
66
105
|
self.username = username
|
|
67
106
|
self.password = password
|
|
@@ -78,6 +117,19 @@ class AtlassianRestAPI(object):
|
|
|
78
117
|
self._session = requests.Session()
|
|
79
118
|
else:
|
|
80
119
|
self._session = session
|
|
120
|
+
if backoff_and_retry:
|
|
121
|
+
# Note: we only retry on status and not on any of the
|
|
122
|
+
# other supported reasons
|
|
123
|
+
retries = Retry(
|
|
124
|
+
total=None,
|
|
125
|
+
status=max_backoff_retries,
|
|
126
|
+
allowed_methods=None,
|
|
127
|
+
status_forcelist=retry_status_codes,
|
|
128
|
+
backoff_factor=1,
|
|
129
|
+
backoff_jitter=1,
|
|
130
|
+
backoff_max=max_backoff_seconds,
|
|
131
|
+
)
|
|
132
|
+
self._session.mount(self.url, HTTPAdapter(max_retries=retries))
|
|
81
133
|
if username and password:
|
|
82
134
|
self._create_basic_session(username, password)
|
|
83
135
|
elif token is not None:
|
|
@@ -101,7 +153,7 @@ class AtlassianRestAPI(object):
|
|
|
101
153
|
self._session.auth = (username, password)
|
|
102
154
|
|
|
103
155
|
def _create_token_session(self, token):
|
|
104
|
-
self._update_header("Authorization", "Bearer {token}".format(token=token))
|
|
156
|
+
self._update_header("Authorization", "Bearer {token}".format(token=token.strip()))
|
|
105
157
|
|
|
106
158
|
def _create_kerberos_session(self, _):
|
|
107
159
|
from requests_kerberos import OPTIONAL, HTTPKerberosAuth
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: atlassian-python-api
|
|
3
|
-
Version: 3.41.
|
|
3
|
+
Version: 3.41.11
|
|
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
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
atlassian/VERSION,sha256=
|
|
1
|
+
atlassian/VERSION,sha256=BdrlO_lKGhJA7PlOHWAbgh9ybBN24WTilrVORSf2aZA,8
|
|
2
2
|
atlassian/__init__.py,sha256=F13CZFoWIj9pDkj83soA7hwwHtvDC6EqFATey9p36PM,768
|
|
3
3
|
atlassian/bamboo.py,sha256=50wpYYt-6eCCotmyeiceyxJIaTpLw922jb-0Tm-ROac,45250
|
|
4
4
|
atlassian/cloud_admin.py,sha256=vZxMA6IrdCQw1KAX3xKal_0ayTWGdMVhe3i0bPpChGk,969
|
|
5
|
-
atlassian/confluence.py,sha256=
|
|
5
|
+
atlassian/confluence.py,sha256=bHuyCD8dilZyA6AMMkVXn8AI8HweHzMnhudq-Jdl5Os,119544
|
|
6
6
|
atlassian/crowd.py,sha256=wYU_i3oSEQktJlmCvgkYbIs8oX_P5Z_OaiocKce5tWs,8126
|
|
7
7
|
atlassian/errors.py,sha256=GAKr6W4zPn7ZUMRLHG8-UgAdVnxDzKVZ-jyGXAccALE,398
|
|
8
|
-
atlassian/insight.py,sha256=
|
|
9
|
-
atlassian/jira.py,sha256=
|
|
8
|
+
atlassian/insight.py,sha256=oOWYoIway05rNup5GPDRm3S5WYuDhHe7JJ-g3vNccsk,23798
|
|
9
|
+
atlassian/jira.py,sha256=Yqx6b3hw41SyX2gBZuEBGCPwHxfJ-0GBVLGoJjUdd6E,204528
|
|
10
10
|
atlassian/marketplace.py,sha256=-y7j0mOi00gBzq1Izj-sXI8khP90rKJUYXijpKW9vs8,2590
|
|
11
11
|
atlassian/portfolio.py,sha256=ioJMyxJW_Uuitszzd0ExoF1t8tykdit7Z7-WYlI6raA,3807
|
|
12
12
|
atlassian/request_utils.py,sha256=HRqGJyeWS3L3SAlgC2x8tKakvyHb1HafxcrHhTNq9iE,1127
|
|
13
|
-
atlassian/rest_client.py,sha256=
|
|
13
|
+
atlassian/rest_client.py,sha256=w438xL9oWvVeR1PEODTvjENltU5wcvDw9A2zDAnjiGc,18456
|
|
14
14
|
atlassian/service_desk.py,sha256=8pM37-aTD4fG8VyA84s9JBGPsKgT7OHUdf9x-GffutY,32632
|
|
15
15
|
atlassian/statuspage.py,sha256=M6Ryz4cpLrjqEiv-W6Uch4_OLjdxVILQpUojeAnYYdA,94470
|
|
16
16
|
atlassian/utils.py,sha256=oKvkGflmgygUcTU-fKd0LBnovgBpu3e5uHsj0sng_vg,10955
|
|
17
17
|
atlassian/xray.py,sha256=3OvLMNfTxfCXgKXxpjhq3a01RemOEtvJH9OqbCJrHEs,26219
|
|
18
|
-
atlassian/bitbucket/__init__.py,sha256=
|
|
18
|
+
atlassian/bitbucket/__init__.py,sha256=D0q3oH1Vurk2or1H_ElVPTm-w4twa7evYWqtzlJz4XQ,133160
|
|
19
19
|
atlassian/bitbucket/base.py,sha256=KfzR9YsdF_zfvq6KOMFzbxNut36vQ2ZJcBmURYzF4N4,6303
|
|
20
20
|
atlassian/bitbucket/cloud/__init__.py,sha256=MX58kb4PKRK5M_iLyh0pya0FG8c9cYJkCAEVsugiGok,821
|
|
21
21
|
atlassian/bitbucket/cloud/base.py,sha256=K2v04dr3K22Wsx8w-fmPQym3vsSflOERYA_TtSMwr4c,4094
|
|
@@ -25,7 +25,7 @@ atlassian/bitbucket/cloud/common/comments.py,sha256=ktnN9G0Vr49rIAeqTElnEXvpePp6
|
|
|
25
25
|
atlassian/bitbucket/cloud/common/users.py,sha256=BbjkMeNFp7JwuewbKL_5qO1geuZ5iu3u5AThPu1pYJo,2390
|
|
26
26
|
atlassian/bitbucket/cloud/repositories/__init__.py,sha256=gtHzySldWCDNWaGAk-69g8Au0jRZvfj0-DqE84oZr6k,16635
|
|
27
27
|
atlassian/bitbucket/cloud/repositories/branchRestrictions.py,sha256=E1wr1pheH9UnVLMao8-9rwmNZPJeLRoM1AmFQnfe4jQ,6503
|
|
28
|
-
atlassian/bitbucket/cloud/repositories/commits.py,sha256=
|
|
28
|
+
atlassian/bitbucket/cloud/repositories/commits.py,sha256=mIheLsyIsfBParfNFhSoSJGAP8c-vlHgRVqoQfBOy00,6414
|
|
29
29
|
atlassian/bitbucket/cloud/repositories/defaultReviewers.py,sha256=bSa1iPILiKf9IcWcCYCQtYxQHoqeiuYGBHD7JVmXa-4,3560
|
|
30
30
|
atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py,sha256=f7FAS5ljkRZOW-SkNEugQMoIVGCQVpl5gPpNW-vWEkU,9405
|
|
31
31
|
atlassian/bitbucket/cloud/repositories/diffstat.py,sha256=tzi9mDC71Jps-Lj_UdvR3mUb1nFlbN2DZ1bjHfGu26A,2893
|
|
@@ -46,8 +46,8 @@ atlassian/bitbucket/server/common/__init__.py,sha256=0j0CWKFaX1kDqfDQkf3__Y2p24t
|
|
|
46
46
|
atlassian/bitbucket/server/common/permissions.py,sha256=89KLu4PY5BUJZsjTrJ8JbrQ46EHn1qj_P-ZJ-uGv3dA,7318
|
|
47
47
|
atlassian/bitbucket/server/projects/__init__.py,sha256=QXHgvrf3lS14OAbtXNdn9TC8ML2fZUkrC5C8BTR3I_0,7696
|
|
48
48
|
atlassian/bitbucket/server/projects/repos/__init__.py,sha256=GNWhabbnLG7kpgCS85wPzOxtbeCtySchCqFwFZnTdh4,10783
|
|
49
|
-
atlassian_python_api-3.41.
|
|
50
|
-
atlassian_python_api-3.41.
|
|
51
|
-
atlassian_python_api-3.41.
|
|
52
|
-
atlassian_python_api-3.41.
|
|
53
|
-
atlassian_python_api-3.41.
|
|
49
|
+
atlassian_python_api-3.41.11.dist-info/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
|
|
50
|
+
atlassian_python_api-3.41.11.dist-info/METADATA,sha256=RtT7VPnZPUDgp7RFx6YwZISnJ7J8bk6Ak3rjn1ae5tk,8792
|
|
51
|
+
atlassian_python_api-3.41.11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
52
|
+
atlassian_python_api-3.41.11.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
|
|
53
|
+
atlassian_python_api-3.41.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{atlassian_python_api-3.41.9.dist-info → atlassian_python_api-3.41.11.dist-info}/top_level.txt
RENAMED
|
File without changes
|