.. _restartmid: ========== Restart ========== 1. Subarray Node provides API for **Restart workflow**. 2. The Sub-array node **accepts the command** if :- A. **Admin mode** reported by each of the system - CSP,SDP subarray are in **ONLINE/ENGINEERING/RESERVED** B. Operational **state** of the Sub-array node is **ON/OFF/INIT/STANDBY/ALARM** 3. The Sub-array Node **rejects the command** if :- A. **Admin mode** reported by each of the system - CSP,SDP Sub-array are in **OFFLINE** or **NOT FITTED**. B. Operational **state** of the sub-array node is **FAULT/UNKNOWN/DISABLE** . 4. The following **state requirements** are applied for the **command execution** :- A. TMC Subarray is in `'observation state'` **ABORTED** or **FAULT** . B. :term:`isSubarrayAvailable` is checked to ensure the subsystems (CSP, SDP and Dish) are :term:`available` 5. The **command execution** involves below **key operations** :- A. Active **scan timers** or **command timeouts** are **cancelled** or paused to prevent follow-on automatic actions B. Dish Leaf node and Dish master **events** are **unsubscribed** for assigned dishes C. Assigned resource record , scan durations ,scheduling block Id etc are cleared. D. As a part of Restart , command which gets invoked on Dish leaf node is Abort ( Since restart is not present in Dish Master).For other nodes Restart it self gets invoked E. The command is then invoked on the relevant TMC CSP, SDP, Dish leaf Nodes after performing few **key checks** as below :- - :term:`available` check is done for the subsystem - Subsystem's **current** observation **state** is inspected; if already **EMPTY, ABORTING,** the abort call for that subsystem is **skipped** with a log note..This check is not done for dish leaf node ,since it does not have observation state. - Command is then sent to relevant TMC CSP, SDP, Dish leaf Nodes - If leaf node **rejects/ faces failure** in sending restart command , command failure is reported as **'RESULT_CODE - FAILED'** on Long Running Command Result attribute of the TMC Subarry node.Command will not be sent to remaining subsystems in this case if multiple subsystems are involved . - If **all** leaf node **accept** command , the TMC Subarray node will wait for command completion. 6. The Sub-array node **monitors the progress** of command via the Sub-array node **ObsState transitions** and the **long running command results**. A. Command is **successful** when the TMC Subarray Node **transitions** to **EMPTY** ObsState. This is reported as **'RESULT_CODE - OK'** on Long Running Command Result attribute of the Subarray node. B. Command **failure** is reported in any of the below cases as **'RESULT_CODE - FAILED'** on Long Running Command Result attribute of the Subarray node. - The CSP Leaf node/SDP Leaf node/Dish Leaf node reports **'RESULT_CODE - FAILED'** on its Long Running Command Result attribute - The command **times out** if TMC SubarrayNode **does not transition** to **EMPTY** within the **timeout period** specified by `CommandTimeOutDefault` property specified in helm chart of the TMC Subarray node .