Completed
Push — master ( 48b27b...9784f9 )
by Tomaz
22s
created

GetNodesInfoAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %
Metric Value
dl 0
loc 14
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 3
1
import requests
2
3
from lib.base import OpscenterAction
4
5
6
class GetNodesInfoAction(OpscenterAction):
7
8
    def run(self, node_ip, node_property=None, cluster_id=None):
9
        if not cluster_id:
10
            cluster_id = self.cluster_id
11
12
        url_parts = [cluster_id, 'nodes', node_ip]
13
14
        if node_property:
15
            url_parts.extend(node_property)
16
17
        url = self._get_full_url(url_parts)
18
19
        return requests.get(url).json()
20