Skip to content

Commit

Permalink
Add plugins related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gonchik committed Feb 7, 2022
1 parent 4add0ae commit 85f624e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion atlassian/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.18.1
3.19.0
1 change: 0 additions & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2712,4 +2712,3 @@ def raise_for_status(self, response):
response.raise_for_status()
else:
raise HTTPError(error_msg, response=response)

23 changes: 23 additions & 0 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -2770,6 +2770,14 @@ def get_plugins_info(self):
url = "rest/plugins/1.0/"
return self.get(url, headers=self.no_check_headers, trailing=True)

def get_plugin_info(self, plugin_key):
"""
Provide plugin info
:return a json of installed plugins
"""
url = "rest/plugins/1.0/{plugin_key}-key".format(plugin_key=plugin_key)
return self.get(url, headers=self.no_check_headers, trailing=True)

def upload_plugin(self, plugin_path):
"""
Provide plugin path for upload into Jira e.g. useful for auto deploy
Expand Down Expand Up @@ -2799,6 +2807,21 @@ def check_plugin_manager_status(self):
url = "rest/plugins/latest/safe-mode"
return self.request(method="GET", path=url, headers=self.safe_mode_headers)

def update_plugin_license(self, plugin_key, raw_license):
"""
Update license for plugin
:param plugin_key:
:param raw_license:
:return:
"""
app_headers = {
"X-Atlassian-Token": "nocheck",
"Content-Type": "application/vnd.atl.plugins+json",
}
url = "/plugins/1.0/{plugin_key}/license".format(plugin_key=plugin_key)
data = {"rawLicense": raw_license}
return self.put(url, data=data, headers=app_headers)

def get_all_permissionschemes(self, expand=None):
"""
Returns a list of all permission schemes.
Expand Down

0 comments on commit 85f624e

Please sign in to comment.