Skip to content

Commit 54828b6

Browse files
committed
Improve documentation
1 parent f27644e commit 54828b6

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

README.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,20 @@ Please take these steps to create an API key with your Grafana instance:
9393
please take note of the Bearer token. This is your Grafana API key.
9494

9595

96-
*******
97-
Running
98-
*******
96+
*****
97+
Usage
98+
*****
9999

100100
Before running ``grafana-wtf``, define URL and access token of your Grafana instance::
101101

102102
export GRAFANA_URL=https://daq.example.org/grafana/
103103
export GRAFANA_TOKEN=eyJrIjoiWHg...dGJpZCI6MX0=
104104

105-
Then::
105+
106+
Searching for strings
107+
=====================
108+
109+
Find the string ``weatherbase`` throughout all dashboards and data sources::
106110

107111
grafana-wtf find weatherbase
108112

@@ -112,10 +116,31 @@ Then::
112116
When running it with the ``--drop-cache`` option, it will drop its cache upfront.
113117

114118

119+
Replacing strings
120+
=================
121+
122+
Replace all occurrences of ``ldi_v2`` with ``ldi_v3`` within dashboard with
123+
UID ``_JJ22OZZk``::
124+
125+
grafana-wtf --select-dashboard=_JJ22OZZk replace ldi_v2 ldi_v3
126+
127+
128+
Displaying changes / revision logs
129+
==================================
130+
131+
Watching out for recent editing activity on any dashboards?::
132+
133+
# Display 50 most recent changes across all dashboards.
134+
grafana-wtf log --number=50
135+
136+
115137
********
116138
Examples
117139
********
118-
See `grafana-wtf examples <https://github.com/panodata/grafana-wtf/blob/master/doc/examples.rst>`_.
140+
141+
For discovering more command line parameters and their arguments, please invoke
142+
``grafana-wtf --help`` and have a look at `grafana-wtf examples`_.
143+
119144

120145

121146
***********
@@ -126,3 +151,6 @@ Development
126151
git clone https://github.com/panodata/grafana-wtf
127152
cd grafana-wtf
128153
make test
154+
155+
156+
.. _grafana-wtf examples: https://github.com/panodata/grafana-wtf/blob/master/doc/examples.rst

doc/backlog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ Done
3434
- [x] Introduce concurrent resource fetching using asyncio or grequests,
3535
see https://github.com/kennethreitz/grequests
3636
- [x] Add software tests
37+
- [x] Document "replace" feature in README

tests/test_commands.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ def test_find_tabular_dashboard_success(docker_grafana, capsys):
9999

100100
def test_replace_dashboard_success(docker_grafana, capsys):
101101

102-
grafana_url = "http://localhost:3000"
103-
104102
# Rename references from "ldi_v2" to "ldi_v3".
105103
set_command("replace ldi_v2 ldi_v3")
106104
grafana_wtf.commands.run()

0 commit comments

Comments
 (0)