Skip to content

Commit 1e35812

Browse files
authored
docs: Update download_dashboards example and get_dashboards documentation (#178)
1 parent 2ffed60 commit 1e35812

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

examples/download_dashboards.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def cleanup_dir(path):
5656
#
5757
# Fire the request.
5858
#
59-
ok, res = sdclient.get_dashboards()
59+
ok, res = sdclient.get_dashboards(light=False)
6060

6161
#
6262
# Show the list of dashboards

sdcclient/monitor/_dashboards_v3.py

+23-9
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,29 @@ def get_view(self, name):
4646
return self._request_result(res)
4747

4848
def get_dashboards(self, light=True):
49-
'''**Description**
50-
Return the list of dashboards available under the given user account. This includes the dashboards created by the user and the ones shared with her by other users.
51-
52-
**Success Return Value**
53-
A dictionary containing the list of available sampling intervals.
54-
55-
**Example**
56-
`examples/list_dashboards.py <https://github.com/draios/python-sdc-client/blob/master/examples/list_dashboards.py>`_
57-
'''
49+
"""
50+
Return the list of dashboards available under the given user account.
51+
This includes the dashboards created by the user and the ones shared with her by other users.
52+
Since every user has multiple tokens -- one per team they are assigned to -- and dashboards are scoped per
53+
team, in order to download all the dashboards from a user account, all the tokens must be specified.
54+
55+
Args:
56+
light (bool): If it's true, only a small portion of information will be retrieved, otherwise all
57+
the information from the dashboards will be retrieved.
58+
If the retrieved dashboards are going to be restored in the future, then this
59+
parameter must be false.
60+
61+
Returns:
62+
The list of the dashboards visible for the given token.
63+
64+
See Also:
65+
:py:meth:`~.DashboardsClientV3.create_dashboard_with_configuration`
66+
67+
Examples:
68+
>>> ok, res = client.get_dashboards(light=False)
69+
>>> for dashboard in res["dashboards"]:
70+
>>> print(dashboard["name"])
71+
"""
5872
params = {
5973
"light": "true" if light else "false"
6074
}

0 commit comments

Comments
 (0)