Skip to content

Commit 39478cc

Browse files
committed
Documentation: Add "Synopsis" section to README
1 parent 815474b commit 39478cc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ pip install --upgrade 'grafana-import[builder]'
3636
The command outlined above describes a full installation of `grafana-import`,
3737
including support for dashboard builders, aka. dashboard-as-code.
3838

39+
## Synopsis
40+
41+
### Command-line use
42+
```shell
43+
grafana-import import -u http://admin:admin@localhost:3000 -i grafana_dashboard.json --overwrite
44+
```
45+
46+
### API use
47+
```python
48+
import json
49+
from pathlib import Path
50+
from grafana_import.grafana import Grafana
51+
52+
dashboard = json.loads(Path("grafana_dashboard.json").read_text())
53+
gio = Grafana(url="http://localhost:3000", credential=("admin", "admin"))
54+
outcome = gio.import_dashboard(dashboard)
55+
```
3956

4057
## Ad Hoc Usage
4158

0 commit comments

Comments
 (0)