Skip to content

Commit e0eec64

Browse files
author
Gonchik Tsymzhitov
committed
Jira: Add health check method with server info
1 parent 652f667 commit e0eec64

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

atlassian/jira.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77

88

99
class Jira(AtlassianRestAPI):
10+
11+
def get_server_info(self, do_health_check=False):
12+
"""
13+
Returns general information about the current Jira server.
14+
with health checks or not.
15+
"""
16+
if do_health_check:
17+
check = True
18+
else:
19+
check = False
20+
return self.get('rest/api/2/serverInfo', params={"doHealthCheck": check})
21+
1022
def reindex_status(self):
1123
return self.get('rest/api/2/reindex')
1224

examples/jira/jira-health-check.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# coding=utf-8
2+
from atlassian import Jira
3+
from pprint import pprint
4+
5+
""" How to get server info with health check"""
6+
7+
jira = Jira(
8+
url="https://jira.example.com/",
9+
username='admin',
10+
password='*******')
11+
12+
pprint(jira.get_server_info(True))

0 commit comments

Comments
 (0)