Completed
Pull Request — master (#543)
by
unknown
02:30
created

DrainNodeAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 2
1
import requests
2
3
from lib.base import OpscenterAction
4
5
6
class DrainNodeAction(OpscenterAction):
7
    def run(self, node_ip, cluster_id=None):
8
        if not cluster_id:
9
            cluster_id = self.cluster_id
10
11
        url = self._get_full_url([cluster_id, 'ops', 'drain', node_ip])
12
13
        return requests.get(url).json()
14