-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathdashboards.py
41 lines (27 loc) · 895 Bytes
/
dashboards.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Interface to Plotly's /v2/dashboards endpoints.
Partially complete at the moment. Only being used by
plotly.plotly.dashboard_ops.
"""
from chart_studio.api.v2.utils import build_url, request
RESOURCE = "dashboards"
def create(body):
"""Create a dashboard."""
url = build_url(RESOURCE)
return request("post", url, json=body)
def list():
"""Returns the list of all users' dashboards."""
url = build_url(RESOURCE)
return request("get", url)
def retrieve(fid):
"""Retrieve a dashboard from Plotly."""
url = build_url(RESOURCE, id=fid)
return request("get", url)
def update(fid, content):
"""Completely update the writable."""
url = build_url(RESOURCE, id=fid)
return request("put", url, json=content)
def schema():
"""Retrieve the dashboard schema."""
url = build_url(RESOURCE, route="schema")
return request("get", url)