@@ -19,7 +19,7 @@ def __init__(self, token="", sdc_url='https://app.sysdigcloud.com', ssl_verify=T
19
19
20
20
def get_views_list (self ):
21
21
res = self .http .get (self .url + self ._default_dashboards_api_endpoint , headers = self .hdrs ,
22
- verify = self .ssl_verify )
22
+ verify = self .ssl_verify )
23
23
if not self ._checkResponse (res ):
24
24
return [False , self .lasterr ]
25
25
return [True , res .json ()]
@@ -42,7 +42,7 @@ def get_view(self, name):
42
42
return [False , 'view ' + name + ' not found' ]
43
43
44
44
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 )
46
46
return self ._request_result (res )
47
47
48
48
def get_dashboards (self , light = True ):
@@ -56,11 +56,11 @@ def get_dashboards(self, light=True):
56
56
`examples/list_dashboards.py <https://github.com/draios/python-sdc-client/blob/master/examples/list_dashboards.py>`_
57
57
'''
58
58
params = {
59
- "light" : light
59
+ "light" : "true" if light else "false"
60
60
}
61
61
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 )
64
64
return self ._request_result (res )
65
65
66
66
def update_dashboard (self , dashboard_data ):
@@ -74,7 +74,7 @@ def update_dashboard(self, dashboard_data):
74
74
`examples/dashboard_basic_crud.py <https://github.com/draios/python-sdc-client/blob/master/examples/dashboard_basic_crud.py>`_
75
75
'''
76
76
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 }))
78
78
return self ._request_result (res )
79
79
80
80
def find_dashboard_by (self , name = None ):
@@ -112,8 +112,8 @@ def create_dashboard_with_configuration(self, configuration):
112
112
del configuration_clone ['version' ]
113
113
114
114
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 )
117
117
return self ._request_result (res )
118
118
119
119
def create_dashboard (self , name ):
@@ -145,8 +145,8 @@ def create_dashboard(self, name):
145
145
# Create the new dashboard
146
146
#
147
147
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 )
150
150
return self ._request_result (res )
151
151
152
152
# TODO COVER
@@ -305,7 +305,7 @@ def create_dashboard_from_template(self, dashboard_name, template, scope=None, s
305
305
# Create the new dashboard
306
306
#
307
307
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 )
309
309
310
310
return self ._request_result (res )
311
311
@@ -377,7 +377,7 @@ def get_dashboard(self, dashboard_id):
377
377
`examples/dashboard_basic_crud.py <https://github.com/draios/python-sdc-client/blob/master/examples/dashboard_basic_crud.py>`_
378
378
'''
379
379
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 )
381
381
return self ._request_result (res )
382
382
383
383
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
401
401
# Get the list of dashboards from the server
402
402
#
403
403
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 )
405
405
if not self ._checkResponse (dashboard ):
406
406
return [False , self .lasterr ]
407
407
@@ -432,7 +432,7 @@ def create_dashboard_from_dashboard(self, newdashname, templatename, filter=None
432
432
def favorite_dashboard (self , dashboard_id , favorite ):
433
433
data = {"dashboard" : {"favorite" : favorite }}
434
434
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 )
436
436
return self ._request_result (res )
437
437
438
438
def share_dashboard_with_all_teams (self , dashboard , mode = "r" ):
@@ -548,7 +548,7 @@ def delete_dashboard(self, dashboard):
548
548
return [False , "Invalid dashboard format" ]
549
549
550
550
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 )
552
552
if not self ._checkResponse (res ):
553
553
return [False , self .lasterr ]
554
554
0 commit comments