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

ListRequestsAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %
Metric Value
dl 0
loc 8
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 7 2
1
import requests
2
3
from lib.base import OpscenterAction
4
5
6
class ListRequestsAction(OpscenterAction):
7
    def run(self, request_type, list_all=True, cluster_id=None):
8
        if not cluster_id:
9
            cluster_id = self.cluster_id
10
11
        url = self._get_full_url([cluster_id, 'request', request_type])
12
13
        return requests.get(url, params={'list_all': int(list_all)}).json()
14