File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -2669,3 +2669,47 @@ def clean_jira_metadata_cache(self, global_id):
26692669 url = "rest/jira-metadata/1.0/metadata/cache"
26702670 params = {"globalId" : global_id }
26712671 return self .delete (url , params = params )
2672+
2673+ def get_license_details (self ):
2674+ """
2675+ Returns the license detailed information
2676+ """
2677+ url = "rest/license/1.0/license/details"
2678+ return self .get (url )
2679+
2680+ def get_license_user_count (self ):
2681+ """
2682+ Returns the total used seats in the license
2683+ """
2684+ url = "rest/license/1.0/license/userCount"
2685+ return self .get (url )
2686+
2687+ def get_license_remaining (self ):
2688+ """
2689+ Returns the available license seats remaining
2690+ """
2691+ url = "rest/license/1.0/license/remainingSeats"
2692+ return self .get (url )
2693+
2694+ def get_license_max_users (self ):
2695+ """
2696+ Returns the license max users
2697+ """
2698+ url = "rest/license/1.0/license/maxUsers"
2699+ return self .get (url )
2700+
2701+ def raise_for_status (self , response ):
2702+ """
2703+ Checks the response for an error status and raises an exception with the error message provided by the server
2704+ :param response:
2705+ :return:
2706+ """
2707+ if 400 <= response .status_code < 600 :
2708+ try :
2709+ j = response .json ()
2710+ error_msg = j ["message" ]
2711+ except Exception :
2712+ response .raise_for_status ()
2713+ else :
2714+ raise HTTPError (error_msg , response = response )
2715+
You can’t perform that action at this time.
0 commit comments