Skip to content

Commit 7117a7f

Browse files
author
Davide Schiera
committed
Documentation for new functions.
1 parent 23a8d36 commit 7117a7f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,53 @@ A dictionary describing the just created alert, with the format described at [th
8484
**Example**
8585
[examples/create_alert.py](examples/create_alert.py).
8686

87+
#### `create_dashboard(self, name)`
88+
**Description**
89+
Creates an empty dashboard. You can then add panels by using `add_dashboard_panel`.
90+
**Arguments**
91+
- **name**: the name of the dashboard that will be created.
92+
**Success Return Value**
93+
A dictionary showing the details of the new dashboard.
94+
**Example**
95+
[examples/dashboard.py](examples/dashboard.py).
96+
97+
#### `find_dashboard_by(self, name)`
98+
**Description**
99+
Finds dashboards with the specified name. You can then delete the dashboard (with `delete_dashboard`) or edit panels (with `add_dashboard_panel` and `remove_dashboard_panel`)
100+
**Arguments**
101+
- **name**: the name of the dashboards to find.
102+
**Success Return Value**
103+
A list of dictionaries of dashboards matching the specified name.
104+
**Example**
105+
[examples/dashboard.py](examples/dashboard.py).
106+
107+
#### `add_dashboard_panel(self, dashboard, name, type, metrics, scope=None, layout=None, sort_by=None, paging=None)`
108+
**Description**
109+
Adds a panel to the dashboard. A panel can be a time series, or a top chart (i.e. bar chart), or a number panel.
110+
**Arguments**
111+
- **dashboard**: dashboard to edit
112+
- **name**: name of the new panel
113+
- **type**: type of the new panel. Valid values are: `timeSeries`, `top`, `number`
114+
- **metrics**: list of metrics; Each metric must specified an `id` (e.g. `cpu.used.percent`) and if it's a value an `aggregation` dictionary with `time` and `group` to specify time aggregation and group aggregation respectively
115+
- **scope**: filter to apply to the panel; Example: _kubernetes.namespace.name='production' and container.image='nginx'_.
116+
- **sort_by**: Data sorting; The parameter is optional and it's a dictionary of `metric` and `mode` (it can be `desc` or `asc`)
117+
- **paging**: Data pagination; The parameter is optional and limits the data points returned. The parameter is a dictionary of `from` and `to` with the index of the first and last point respectively
118+
- **layout**: Size and position of the panel
119+
**Success Return Value**
120+
A dictionary showing the details of the edited dashboard.
121+
**Example**
122+
[examples/dashboard.py](examples/dashboard.py).
123+
124+
#### `remove_dashboard_panel(self, dashboard, panel_name)`
125+
**Description**
126+
Removes a panel from the dashboard. The panel to remove is identified by the specified `name`.
127+
**Arguments**
128+
- **name**: name of the panel to find and remove
129+
**Success Return Value**
130+
A dictionary showing the details of the edited dashboard.
131+
**Example**
132+
[examples/dashboard.py](examples/dashboard.py).
133+
87134
#### `create_dashboard_from_dashboard(self, newdashname, templatename, filter)`
88135
**Description**
89136
Create a new dasboard using one of the existing dashboards as a template. You will be able to define the scope of the new dasboard.

0 commit comments

Comments
 (0)