| Total Complexity | 3 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| 1 | import requests |
||
| 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 |