diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5caf88865..c95f0e7c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,5 +33,5 @@ jobs: uses: codecov/codecov-action@v4 with: files: ./coverage.xml - fail_ci_if_error: true + fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} diff --git a/atlassian/jira.py b/atlassian/jira.py index 78f893654..071df1af0 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -5322,3 +5322,34 @@ def health_check(self): # check as support tools response = self.get("rest/supportHealthCheck/1.0/check/") return response + + def duplicated_account_checks_detail(self): + """ + Health check: Duplicate user accounts detail + https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html + :return: + """ + response = self.get("rest/api/2/user/duplicated/list") + return response + + def duplicated_account_checks_flush(self): + """ + Health check: Duplicate user accounts by flush + The responses returned by the count and list methods are stored in the duplicate users cache for 10 minutes. + The cache is flushed automatically every time a directory + is added, deleted, enabled, disabled, reordered, or synchronized. + https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html + :return: + """ + params = {"flush": "true"} + response = self.get("rest/api/2/user/duplicated/list", params=params) + return response + + def duplicated_account_checks_count(self): + """ + Health check: Duplicate user accounts count + https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html + :return: + """ + response = self.get("rest/api/2/user/duplicated/count") + return response diff --git a/docs/jira.rst b/docs/jira.rst index 17aee4095..08ad483ad 100644 --- a/docs/jira.rst +++ b/docs/jira.rst @@ -588,6 +588,22 @@ Cluster methods (only for DC edition) # Request current index from node (the request is processed asynchronously). jira.request_current_index_from_node(node_id) +Health checks methods (only for on-prem edition) +------------------------------------------------ +.. code-block:: python + + # Get health status of Jira. + jira.health_check() + + # Health check: Duplicate user accounts detail + jira.duplicated_account_checks_detail() + + # Health check: Duplicate user accounts by flush + jira.duplicated_account_checks_flush() + + # Health check: Duplicate user accounts count + jira.duplicated_account_checks_count() + TEMPO ---------------------- .. code-block:: python diff --git a/requirements-dev.txt b/requirements-dev.txt index ca98e39b1..bfa746dc6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,5 +14,4 @@ python-magic # On October 4, 2022 importlib-metadata released importlib-metadata 5.0.0 and in version 5.0.0 # They have Deprecated EntryPoints and that's why you are facing this error. importlib-metadata<=4.13.0 -# Add this package to search string in json -jmespath + diff --git a/requirements.txt b/requirements.txt index d6b0c6199..778a91fe0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ six oauthlib requests_oauthlib requests-kerberos==0.14.0 +# Add this package to search string in json jmespath beautifulsoup4 lxml