@@ -19,7 +19,7 @@ def __init__(self, token="", sdc_url='https://app.sysdigcloud.com', ssl_verify=T
1919
2020    def  get_views_list (self ):
2121        res  =  self .http .get (self .url  +  self ._default_dashboards_api_endpoint , headers = self .hdrs ,
22-                            verify = self .ssl_verify )
22+                              verify = self .ssl_verify )
2323        if  not  self ._checkResponse (res ):
2424            return  [False , self .lasterr ]
2525        return  [True , res .json ()]
@@ -42,7 +42,7 @@ def get_view(self, name):
4242            return  [False , 'view '  +  name  +  ' not found' ]
4343
4444        res  =  self .http .get (self .url  +  self ._default_dashboards_api_endpoint  +  '/'  +  id , headers = self .hdrs ,
45-                            verify = self .ssl_verify )
45+                              verify = self .ssl_verify )
4646        return  self ._request_result (res )
4747
4848    def  get_dashboards (self , light = True ):
@@ -56,11 +56,11 @@ def get_dashboards(self, light=True):
5656            `examples/list_dashboards.py <https://github.com/draios/python-sdc-client/blob/master/examples/list_dashboards.py>`_ 
5757        ''' 
5858        params  =  {
59-             "light" : light 
59+             "light" : "true"   if   light   else   "false" 
6060        }
6161        res  =  self .http .get (self .url  +  self ._dashboards_api_endpoint , params = params ,
62-                            headers = self .hdrs ,
63-                            verify = self .ssl_verify )
62+                              headers = self .hdrs ,
63+                              verify = self .ssl_verify )
6464        return  self ._request_result (res )
6565
6666    def  update_dashboard (self , dashboard_data ):
@@ -74,7 +74,7 @@ def update_dashboard(self, dashboard_data):
7474            `examples/dashboard_basic_crud.py <https://github.com/draios/python-sdc-client/blob/master/examples/dashboard_basic_crud.py>`_ 
7575        ''' 
7676        res  =  self .http .put (self .url  +  self ._dashboards_api_endpoint  +  "/"  +  str (dashboard_data ['id' ]),
77-                            headers = self .hdrs , verify = self .ssl_verify , data = json .dumps ({'dashboard' : dashboard_data }))
77+                              headers = self .hdrs , verify = self .ssl_verify , data = json .dumps ({'dashboard' : dashboard_data }))
7878        return  self ._request_result (res )
7979
8080    def  find_dashboard_by (self , name = None ):
@@ -112,8 +112,8 @@ def create_dashboard_with_configuration(self, configuration):
112112            del  configuration_clone ['version' ]
113113
114114        res  =  self .http .post (self .url  +  self ._dashboards_api_endpoint , headers = self .hdrs ,
115-                             data = json .dumps ({'dashboard' : configuration_clone }),
116-                             verify = self .ssl_verify )
115+                               data = json .dumps ({'dashboard' : configuration_clone }),
116+                               verify = self .ssl_verify )
117117        return  self ._request_result (res )
118118
119119    def  create_dashboard (self , name ):
@@ -145,8 +145,8 @@ def create_dashboard(self, name):
145145        # Create the new dashboard 
146146        # 
147147        res  =  self .http .post (self .url  +  self ._dashboards_api_endpoint , headers = self .hdrs ,
148-                             data = json .dumps ({'dashboard' : dashboard_configuration }),
149-                             verify = self .ssl_verify )
148+                               data = json .dumps ({'dashboard' : dashboard_configuration }),
149+                               verify = self .ssl_verify )
150150        return  self ._request_result (res )
151151
152152    # TODO COVER 
@@ -305,7 +305,7 @@ def create_dashboard_from_template(self, dashboard_name, template, scope=None, s
305305        # Create the new dashboard 
306306        # 
307307        res  =  self .http .post (self .url  +  self ._dashboards_api_endpoint , headers = self .hdrs ,
308-                             data = json .dumps ({'dashboard' : template }), verify = self .ssl_verify )
308+                               data = json .dumps ({'dashboard' : template }), verify = self .ssl_verify )
309309
310310        return  self ._request_result (res )
311311
@@ -377,7 +377,7 @@ def get_dashboard(self, dashboard_id):
377377            `examples/dashboard_basic_crud.py <https://github.com/draios/python-sdc-client/blob/master/examples/dashboard_basic_crud.py>`_ 
378378        ''' 
379379        res  =  self .http .get (self .url  +  self ._dashboards_api_endpoint  +  "/"  +  str (dashboard_id ), headers = self .hdrs ,
380-                            verify = self .ssl_verify )
380+                              verify = self .ssl_verify )
381381        return  self ._request_result (res )
382382
383383    def  create_dashboard_from_dashboard (self , newdashname , templatename , filter = None , shared = False , public = False ):
@@ -401,7 +401,7 @@ def create_dashboard_from_dashboard(self, newdashname, templatename, filter=None
401401        # Get the list of dashboards from the server 
402402        # 
403403        dashboard  =  self .http .get (self .url  +  self ._dashboards_api_endpoint , params = {"light" : "true" }, headers = self .hdrs ,
404-                                  verify = self .ssl_verify )
404+                                    verify = self .ssl_verify )
405405        if  not  self ._checkResponse (dashboard ):
406406            return  [False , self .lasterr ]
407407
@@ -432,7 +432,7 @@ def create_dashboard_from_dashboard(self, newdashname, templatename, filter=None
432432    def  favorite_dashboard (self , dashboard_id , favorite ):
433433        data  =  {"dashboard" : {"favorite" : favorite }}
434434        res  =  self .http .patch (self .url  +  self ._dashboards_api_endpoint  +  "/"  +  str (dashboard_id ), json = data ,
435-                              headers = self .hdrs , verify = self .ssl_verify )
435+                                headers = self .hdrs , verify = self .ssl_verify )
436436        return  self ._request_result (res )
437437
438438    def  share_dashboard_with_all_teams (self , dashboard , mode = "r" ):
@@ -548,7 +548,7 @@ def delete_dashboard(self, dashboard):
548548            return  [False , "Invalid dashboard format" ]
549549
550550        res  =  self .http .delete (self .url  +  self ._dashboards_api_endpoint  +  '/'  +  str (dashboard ['id' ]), headers = self .hdrs ,
551-                               verify = self .ssl_verify )
551+                                 verify = self .ssl_verify )
552552        if  not  self ._checkResponse (res ):
553553            return  [False , self .lasterr ]
554554
0 commit comments