Skip to content

Commit 6ca0d0d

Browse files
committed
Jira: add ZDU related methods and adjust existing #570
1 parent ee2e92d commit 6ca0d0d

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

atlassian/jira.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ def get_all_system_avatars(self, avatar_type: str = "user") -> T_resp_json:
424424
"""
425425

426426
def get_cluster_all_nodes(self) -> T_resp_json:
427+
"""
428+
Get all nodes in the cluster
429+
:return:
430+
"""
427431
url = self.resource_url("cluster/nodes")
428432
return self.get(url)
429433

@@ -457,7 +461,8 @@ def get_cluster_alive_nodes(self) -> list:
457461

458462
def request_current_index_from_node(self, node_id: T_id) -> T_resp_json:
459463
"""
460-
Request current index from node (the request is processed asynchronously)
464+
Request current index from node (the request is processed asynchronously).
465+
This method is deprecated as it is Lucene specific and is planned for removal in Jira 11.
461466
:return:
462467
"""
463468
base_url = self.resource_url("cluster/index-snapshot")
@@ -502,7 +507,43 @@ def download_support_zip(self, file_name: str) -> bytes:
502507
Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/cluster/zdu
503508
"""
504509

510+
def approve_cluster_zdu_upgrade(self) -> T_resp_json:
511+
"""
512+
Approves the cluster upgrade.
513+
:return:
514+
"""
515+
url = self.resource_url("cluster/zdu/approve")
516+
return self.post(url)
517+
518+
def cancel_cluster_zdu_upgrade(self) -> T_resp_json:
519+
"""
520+
Cancels the ongoing cluster upgrade.
521+
:return:
522+
"""
523+
url = self.resource_url("cluster/zdu/cancel")
524+
return self.post(url)
525+
526+
def retry_cluster_zdu_upgrade(self) -> T_resp_json:
527+
"""
528+
Retries the cluster upgrade.
529+
:return:
530+
"""
531+
url = self.resource_url("cluster/zdu/retryUpgrade")
532+
return self.post(url)
533+
534+
def start_cluster_zdu_upgrade(self) -> T_resp_json:
535+
"""
536+
Starts the cluster upgrade.
537+
:return:
538+
"""
539+
url = self.resource_url("cluster/zdu/start")
540+
return self.post(url)
541+
505542
def get_cluster_zdu_state(self) -> T_resp_json:
543+
"""
544+
Get the state of the cluster upgrade.
545+
:return:
546+
"""
506547
url = self.resource_url("cluster/zdu/state")
507548
return self.get(url)
508549

docs/jira.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,16 @@ Cluster methods (only for DC edition)
602602
# Request current index from node (the request is processed asynchronously).
603603
jira.request_current_index_from_node(node_id)
604604
605+
# Get cluster nodes where alive = True
606+
jira.get_cluster_alive_nodes()
607+
608+
# Change the node's state to offline if the node is reporting as active, but is not alive
609+
jira.set_node_to_offline(node_id)
610+
611+
# Delete the node from the cluster if state of node is OFFLINE
612+
jira.delete_cluster_node(node_id)
613+
614+
605615
Health checks methods (only for on-prem edition)
606616
------------------------------------------------
607617
.. code-block:: python

0 commit comments

Comments
 (0)