| Total Complexity | 2 |
| Total Lines | 10 |
| Duplicated Lines | 0 % |
| 1 | import json |
||
| 8 | class StopNodeAction(OpscenterAction): |
||
| 9 | def run(self, node_ip, cluster_id=None, drain_node=True): |
||
| 10 | if not cluster_id: |
||
| 11 | cluster_id = self.cluster_id |
||
| 12 | |||
| 13 | payload = {'drain_first': drain_node} |
||
| 14 | |||
| 15 | url = self._get_full_url([cluster_id, 'ops', 'stop', node_ip]) |
||
| 16 | |||
| 17 | return requests.post(url, data=json.dumps(payload)).json() |
||
| 18 |