grafanacli 
What the heck is that?
GrafanaCLI is a Python library used to manage Grafana API
Requirements
Python :: 2 Python :: 3
Installation
Install the pip package:
pip install grafanacli
Usage
from grafanacli import GrafanaAdmin
ga = GrafanaAdmin('http://127.0.0.1:3000')
# Disable SSL verification
ga.verify = False
"""SSL verification must be disabled before use GrafanaAuth"""
# Authentication using username and password
ga.GrafanaAuth(Username='admin', Password='admin')
# Authentication using API-Key
ga.GrafanaAuth(AuthType='APIKey', Key='xxxxxxxxxxxxx')
# List your current organization
ga.CurrentOrganization()
# List all organizations
ga.OrganizationList()
# Search Organization
ga.OrganizationSearch('MyOrganization')
# Create Organization
ga.OrganizationCreate('MyNewOrganization')
# Update Organization
ga.OrganizationUpdate('1', 'NewOrganizationName')
Where "1" is the organization Id that will be updated.
# Delete Organization
ga.OrganizationDelete('1')
Where "1" is the organization Id that will be deleted.
# Switch Organization
ga.OrganizationSwitch('2')
Where "2" is the organization Id what I want to switch
# Search dashboard whitout filter
ga.DashboardSearch()
# Search dashboard by title
ga.DashboardSearch(DashboardName='My Dashboard')
# Search dashboard by tag
ga.DashboardSearch(Tag='My Tag')
# Search starred dashboards
ga.DashboardSearch(Starred=True)
# Search dashboard aplying more than one conditition
ga.DashboardSearch(Starred=True, Tag='My Tag')
ga.DashboardSearch(Name='My Dashboard', Tag='My Tag')
ga.DashboardSearch(Name='My Dashboard', Tag='My Tag', Starred=True)
# Download Dashboard
ga.DashboardDownload('DashboardUid', '/tmp/mydash.json')
# Upload Dashboard
ga.DashboardUpload('/tmp/mydash.json', Overwrite=True)
ga.DashboardUpload('/tmp/mydash.json')
ga.DashboardUpload('/tmp/mydash.json, FolderId=3'
# Create, List, Get, Update and Delete Folders
ga.FolderCreate('My Folder')
ga.FolderList()
ga.FolderGet('folderUID')
ga.FolderUpdate('folderUID', 'My Folder New Name', version=x) # Current Folder's version ID (int)
ga.FolderUpdate('folderUID', 'My Folder New Name', overwrite=True) # It will skip version confirmation
ga.FolderDelete('folderUID')
# Star and Unstar a dashboard
ga.DashboardStar(dashboadID)
ga.DashboardUnstar(dashboadID)
# Get and Update Dashboard's permission
ga.DashboardGetPermissions(dashboadID)
ga.DashboardUpdatePermissions(dashboadID, new_json_permission)
License
GrafanaCLI is licensed under the terms of the MIT License (see the LICENSE file).
Release files for grafanacli 1.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| grafanacli-1.0.10-py3-none-any.whl | Python 3 | none | any | Details |
| grafanacli-1.0.10-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 10.2 kB
Release files / grafanacli-1.0.10-py3-none-any.whl
| Download URL | grafanacli-1.0.10-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87ed5658bbb845925f82b42d4578df44c8dbceddce58fc00b2d7d24db33d6992
|
|
BLAKE2b-256 checksum How to use checksums |
c60a581091a3fdb8823bc0e04bc07f858cb2869c26a224f283f6bc7782343199
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.6.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/2.7.18
|
Release files / grafanacli-1.0.10-py2-none-any.whl
| Download URL | grafanacli-1.0.10-py2-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
d762f851e0adfa0b2449d2e9071693b2e4c451680d1590a867f999a2412c4f95
|
|
BLAKE2b-256 checksum How to use checksums |
402004e7e501109be1fb60eb410d70a45d3852445b2c74d8defe4ec092623bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.6.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/2.7.18
|