1
- # grafana_api [ ![ Github Actions Test] ( https://github.com/m0nhawk/grafana_api/workflows/Test/badge.svg )] ( https://github.com/m0nhawk/grafana_api/actions?query=workflow%3ATest ) [ ![ GitHub license] ( https://img.shields.io/github/license/m0nhawk/grafana_api.svg?style=flat-square )] ( https://github.com/m0nhawk/grafana_api/blob/master/LICENSE ) [ ![ Codecov] ( https://img.shields.io/codecov/c/gh/m0nhawk/grafana_api.svg?style=flat-square )] ( https://codecov.io/gh/m0nhawk/grafana_api/ )
1
+ # grafana-client [ ![ Github Actions Test] ( https://github.com/m0nhawk/grafana_api/workflows/Test/badge.svg )] ( https://github.com/m0nhawk/grafana_api/actions?query=workflow%3ATest ) [ ![ GitHub license] ( https://img.shields.io/github/license/m0nhawk/grafana_api.svg?style=flat-square )] ( https://github.com/m0nhawk/grafana_api/blob/master/LICENSE ) [ ![ Codecov] ( https://img.shields.io/codecov/c/gh/m0nhawk/grafana_api.svg?style=flat-square )] ( https://codecov.io/gh/m0nhawk/grafana_api/ )
2
2
3
- [ ![ PyPI] ( https://img.shields.io/pypi/v/grafana_api .svg?style=flat-square )] ( https://pypi.org/project/grafana-api/ ) [ ![ Conda] ( https://img.shields.io/conda/v/m0nhawk/grafana_api.svg?style=flat-square )] ( https://anaconda.org/m0nhawk/grafana_api )
3
+ [ ![ PyPI] ( https://img.shields.io/pypi/v/grafana-client .svg?style=flat-square )] ( https://pypi.org/project/grafana-api/ ) [ ![ Conda] ( https://img.shields.io/conda/v/m0nhawk/grafana_api.svg?style=flat-square )] ( https://anaconda.org/m0nhawk/grafana_api )
4
4
5
5
## What is this library for?
6
6
@@ -15,39 +15,39 @@ You need Python 3 and only the `requests` library installed.
15
15
Install the pip package:
16
16
17
17
```
18
- pip install -U grafana_api
18
+ pip install -U grafana-client
19
19
```
20
20
21
21
And then connect to your Grafana API endpoint:
22
22
23
23
``` python
24
- from grafana_api .grafana_face import GrafanaFace
24
+ from grafana_client .grafana_face import GrafanaFace
25
25
26
- grafana_api = GrafanaFace(auth = ' abcde....' , host = ' api.my-grafana-host.com' )
26
+ grafana = GrafanaFace(auth = ' abcde....' , host = ' api.my-grafana-host.com' )
27
27
28
28
# Create user
29
- user
= grafana_api .admin.create_user({
" name" :
" User" ,
" email" :
" [email protected] " ,
" login" :
" user" ,
" password" :
" userpassword" ,
" OrgId" :
1 })
29
+ user
= grafana .admin.create_user({
" name" :
" User" ,
" email" :
" [email protected] " ,
" login" :
" user" ,
" password" :
" userpassword" ,
" OrgId" :
1 })
30
30
31
31
# Change user password
32
- user = grafana_api .admin.change_user_password(2 , " newpassword" )
32
+ user = grafana .admin.change_user_password(2 , " newpassword" )
33
33
34
34
# Search dashboards based on tag
35
- grafana_api .search.search_dashboards(tag = ' applications' )
35
+ grafana .search.search_dashboards(tag = ' applications' )
36
36
37
37
# Find a user by email
38
- user
= grafana_api .users.find_user(
' [email protected] ' )
38
+ user
= grafana .users.find_user(
' [email protected] ' )
39
39
40
40
# Add user to team 2
41
- grafana_api .teams.add_team_member(2 , user[" id" ])
41
+ grafana .teams.add_team_member(2 , user[" id" ])
42
42
43
43
# Create or update a dashboard
44
- grafana_api .dashboard.update_dashboard(dashboard = {' dashboard' : {... }, ' folderId' : 0 , ' overwrite' : True })
44
+ grafana .dashboard.update_dashboard(dashboard = {' dashboard' : {... }, ' folderId' : 0 , ' overwrite' : True })
45
45
46
46
# Delete a dashboard by UID
47
- grafana_api .dashboard.delete_dashboard(dashboard_uid = ' abcdefgh' )
47
+ grafana .dashboard.delete_dashboard(dashboard_uid = ' abcdefgh' )
48
48
49
49
# Create organization
50
- grafana_api .organization.create_organization({" name" :" new_organization" })
50
+ grafana .organization.create_organization({" name" :" new_organization" })
51
51
```
52
52
53
53
@@ -60,13 +60,13 @@ To use admin API you need to use basic auth [as stated here](https://grafana.com
60
60
``` python
61
61
# Use basic authentication:
62
62
63
- grafana_api = GrafanaFace(
63
+ grafana = GrafanaFace(
64
64
auth = (" username" ," password" ),
65
65
host = ' api.my-grafana-host.com'
66
66
)
67
67
68
68
# Use token
69
- grafana_api = GrafanaFace(
69
+ grafana = GrafanaFace(
70
70
auth = ' abcdetoken...' ,
71
71
host = ' api.my-grafana-host.com'
72
72
)
@@ -100,13 +100,13 @@ Work on API implementation still in progress.
100
100
101
101
## Issue tracker
102
102
103
- Please report any bugs and enhancement ideas using the ` grafana_api ` issue tracker:
103
+ Please report any bugs and enhancement ideas using the ` grafana-client ` issue tracker:
104
104
105
105
https://github.com/m0nhawk/grafana_api/issues
106
106
107
107
Feel free to also ask questions on the tracker.
108
108
109
109
## License
110
110
111
- ` grafana_api ` is licensed under the terms of the MIT License (see the file
111
+ ` grafana-client ` is licensed under the terms of the MIT License (see the file
112
112
[ LICENSE] ( LICENSE ) ).
0 commit comments