Skip to content

Commit 85f624e

Browse files
committed
Add plugins related methods
1 parent 4add0ae commit 85f624e

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.18.1
1+
3.19.0

atlassian/confluence.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2712,4 +2712,3 @@ def raise_for_status(self, response):
27122712
response.raise_for_status()
27132713
else:
27142714
raise HTTPError(error_msg, response=response)
2715-

atlassian/jira.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,14 @@ def get_plugins_info(self):
27702770
url = "rest/plugins/1.0/"
27712771
return self.get(url, headers=self.no_check_headers, trailing=True)
27722772

2773+
def get_plugin_info(self, plugin_key):
2774+
"""
2775+
Provide plugin info
2776+
:return a json of installed plugins
2777+
"""
2778+
url = "rest/plugins/1.0/{plugin_key}-key".format(plugin_key=plugin_key)
2779+
return self.get(url, headers=self.no_check_headers, trailing=True)
2780+
27732781
def upload_plugin(self, plugin_path):
27742782
"""
27752783
Provide plugin path for upload into Jira e.g. useful for auto deploy
@@ -2799,6 +2807,21 @@ def check_plugin_manager_status(self):
27992807
url = "rest/plugins/latest/safe-mode"
28002808
return self.request(method="GET", path=url, headers=self.safe_mode_headers)
28012809

2810+
def update_plugin_license(self, plugin_key, raw_license):
2811+
"""
2812+
Update license for plugin
2813+
:param plugin_key:
2814+
:param raw_license:
2815+
:return:
2816+
"""
2817+
app_headers = {
2818+
"X-Atlassian-Token": "nocheck",
2819+
"Content-Type": "application/vnd.atl.plugins+json",
2820+
}
2821+
url = "/plugins/1.0/{plugin_key}/license".format(plugin_key=plugin_key)
2822+
data = {"rawLicense": raw_license}
2823+
return self.put(url, data=data, headers=app_headers)
2824+
28022825
def get_all_permissionschemes(self, expand=None):
28032826
"""
28042827
Returns a list of all permission schemes.

0 commit comments

Comments
 (0)