Skip to content

Fix API use for Explore default dashboards #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/list_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
sys.exit(1)

for db in data['dashboards']:
print "Name: %s, # Charts: %d" % (db['name'], len(db['items']))
print "Name: %s, # Charts: %d" % (db['name'], len(db['items'] if 'items' in db else []))
8 changes: 4 additions & 4 deletions sdcclient/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ def set_explore_grouping_hierarchy(self, new_hierarchy):
return [True, None]

def get_views_list(self):
res = requests.get(self.url + '/data/drilldownDashboardDescriptors.json', headers=self.hdrs,
res = requests.get(self.url + '/api/defaultDashboards', headers=self.hdrs,
verify=self.ssl_verify)
if not self._checkResponse(res):
return [False, self.lasterr]
Expand All @@ -1270,7 +1270,7 @@ def get_view(self, name):
if gvres[0] is False:
return gvres

vlist = gvres[1]['drilldownDashboardDescriptors']
vlist = gvres[1]['defaultDashboards']

id = None

Expand All @@ -1282,7 +1282,7 @@ def get_view(self, name):
if not id:
return [False, 'view ' + name + ' not found']

res = requests.get(self.url + '/data/drilldownDashboards/' + id + '.json', headers=self.hdrs,
res = requests.get(self.url + '/api/defaultDashboards/' + id, headers=self.hdrs,
verify=self.ssl_verify)
if not self._checkResponse(res):
return [False, self.lasterr]
Expand Down Expand Up @@ -1701,7 +1701,7 @@ def create_dashboard_from_view(self, newdashname, viewname, filter, shared=False
if gvres[0] is False:
return gvres

view = gvres[1]['drilldownDashboard']
view = gvres[1]['defaultDashboard']

view['timeMode'] = {'mode' : 1}
view['time'] = {'last' : 2 * 60 * 60 * 1000000, 'sampling' : 2 * 60 * 60 * 1000000}
Expand Down