From c4b3144bfc79467f244b50ebd58b21c7663fe745 Mon Sep 17 00:00:00 2001 From: Ilya Sapunov Date: Tue, 15 Nov 2022 21:24:48 +0400 Subject: [PATCH 1/4] Added request_current_index_from_node method and docs for the cluster methods --- atlassian/jira.py | 9 +++++++++ docs/jira.rst | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/atlassian/jira.py b/atlassian/jira.py index 535068b1a..e3fdce123 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -311,6 +311,15 @@ def get_cluster_alive_nodes(self): """ return [_ for _ in self.get_cluster_all_nodes() if _["alive"]] + def request_current_index_from_node(self, node_id): + """ + Request current index from node (the request is processed asynchronously) + :return: + """ + base_url = self.resource_url("cluster/index-snapshot") + url = f"{base_url}/{node_id}" + return self.put(url) + """ Troubleshooting. (Available for DC) It gives the posibility to download support zips. Reference: https://confluence.atlassian.com/support/create-a-support-zip-using-the-rest-api-in-data-center-applications-952054641.html diff --git a/docs/jira.rst b/docs/jira.rst index 2c0a893bf..12180cc56 100644 --- a/docs/jira.rst +++ b/docs/jira.rst @@ -364,6 +364,13 @@ Issue security schemes # Use only_levels=True for get the only levels entries jira.get_issue_security_scheme(scheme_id, only_levels=False) +Cluster methods +---------------------- +.. code-block:: python + + # Request current index from node (the request is processed asynchronously). + jira.request_current_index_from_node(node_id) + TEMPO ---------------------- .. code-block:: python From 70efeeba1d0f227e7b4e99a76268adcfe857513f Mon Sep 17 00:00:00 2001 From: Ilya Sapunov Date: Tue, 15 Nov 2022 21:30:10 +0400 Subject: [PATCH 2/4] Added description to docs for method get_cluster_all_nodes --- docs/jira.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/jira.rst b/docs/jira.rst index 12180cc56..03e48099d 100644 --- a/docs/jira.rst +++ b/docs/jira.rst @@ -364,10 +364,13 @@ Issue security schemes # Use only_levels=True for get the only levels entries jira.get_issue_security_scheme(scheme_id, only_levels=False) -Cluster methods +Cluster methods (only for DC edition) ---------------------- .. code-block:: python + # Get all cluster nodes. + jira.get_cluster_all_nodes() + # Request current index from node (the request is processed asynchronously). jira.request_current_index_from_node(node_id) From 5a5c058e3ab0da9b6f111c193c8860b3745df40f Mon Sep 17 00:00:00 2001 From: Ilya Sapunov Date: Thu, 12 Jan 2023 15:38:34 +0300 Subject: [PATCH 3/4] Added get_dashboard method. Ability to get dashboard by ID. --- atlassian/jira.py | 10 ++++++++++ docs/jira.rst | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/atlassian/jira.py b/atlassian/jira.py index bcacb94a6..5dd5480e7 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -649,6 +649,16 @@ def get_dashboards(self, filter="", start=0, limit=10): url = self.resource_url("dashboard") return self.get(url, params=params) + def get_dashboard(self, dashboard_id): + """ + Returns a single dashboard + + :param dashboard_id: Dashboard ID Int + :return: + """ + url = self.resource_url(f'dashboard/{dashboard_id}') + return self.get(url) + """ Filters. Resource for searches Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/filter diff --git a/docs/jira.rst b/docs/jira.rst index f438783f3..0435cd851 100644 --- a/docs/jira.rst +++ b/docs/jira.rst @@ -293,6 +293,15 @@ Manage Boards # Add/Move Issues to sprint jira.add_issues_to_sprint(sprint_id, issues_list) + +Manage dashboards +----------------- + +.. code-block:: python + + # Get dashboard by ID + jira.get_dashboard(dashboard_id) + Attachments actions ------------------- From 15999c1808c42444dbc1379ed3d23592b0ed8f0b Mon Sep 17 00:00:00 2001 From: Ilya Sapunov Date: Thu, 12 Jan 2023 16:05:12 +0300 Subject: [PATCH 4/4] Fix resource_url for get_dashboard method --- atlassian/jira.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atlassian/jira.py b/atlassian/jira.py index 5dd5480e7..dccc985ae 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -656,7 +656,7 @@ def get_dashboard(self, dashboard_id): :param dashboard_id: Dashboard ID Int :return: """ - url = self.resource_url(f'dashboard/{dashboard_id}') + url = self.resource_url("dashboard/{dashboard_id}".format(dashboard_id=dashboard_id)) return self.get(url) """