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

GetClusterInfoAction   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 GetClusterInfoAction(OpscenterAction):
7
8
    def run(self, cluster_id=None, cluster_property=None):
9
        if not cluster_id:
10
            cluster_id = self.cluster_id
11
12
        url_parts = [cluster_id, 'cluster']
13
14
        if cluster_property:
15
            url_parts.extend(cluster_property)
16
17
        url = self._get_full_url(url_parts)
18
19
        return requests.get(url).json()
20