PanelBase

This is the base class to create one panel. In order to obtain a maximal consistancy, some derived classes also are foreseen. The actual panel dataclasses are a subclass of the base class of one of this primary derived classes.

grafanacode: base class for generating panels

class grafanacode.plugins.panel_base.PanelBase(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None)[source]

Bases: object

Base Panel dataclass. This class encapsulates all properties of a single Grafana panel. It creates the final panel JSON by means of its getJson method. This class will not be called directly, but subclassed to specify a specific type of panel.

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:
  • customjson (dict) – custom or child class json code to add

  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 10
logstr: str = ''
class grafanacode.plugins.panel_base.PanelBaseExtCommon1(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None)[source]

Bases: PanelBase

Panel subclass with some additional attributes. This class will not be called directly, but subclassed to specify a specific type of panel.

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:
  • customjson (dict) – custom or child class json code to add

  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 11
class grafanacode.plugins.panel_base.PanelBaseExtOpt1(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, calcs=['lastNotNull'], fields='', orientation='auto', reducelimit=25, reducevalues=False, titlesize=None, valuesize=None)[source]

Bases: PanelBaseExtCommon1

Panel subclass with some additional attributes. This class will not be called directly, but subclassed to specify a specific type of panel.

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param calcs:
    • default: [‘lastNotNull’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param fields:
    • type: str

  • param orientation:
    • default: auto - optional - in: [‘auto’, ‘horizontal’, ‘vertical’]

  • param reducelimit:
    • default: 25 - type: int

  • param reducevalues:
    • type: bool

  • param titlesize:
    • default: None - optional - type: int

  • param valuesize:
    • default: None - optional - type: int

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:
  • customjson (dict) – custom or child class json code to add

  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 12
class grafanacode.plugins.panel_base.PanelBaseExtOpt2(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, datalinks=_Nothing.NOTHING, fillopacity=0, gradientmode='none', hidefromgraph=False, hidefromlegend=False, hidefromtooltip=False, hidefromviz=False, legend=_Nothing.NOTHING, linewidth=1, tooltipmode='single', tooltipsort='none')[source]

Bases: PanelBaseExtCommon1

Panel subclass with some additional attributes. This class will not be called directly, but subclassed to specify a specific type of panel.

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param datalinks:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param fillopacity:
    • type: int

  • param gradientmode:
    • default: none - optional - in: [‘none’, ‘opacity’, ‘hue’, ‘scheme’]

  • param hidefromgraph:
    • type: bool

  • param hidefromlegend:
    • type: bool

  • param hidefromtooltip:
    • type: bool

  • param hidefromviz:
    • type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param linewidth:
    • default: 1 - type: int

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:
  • customjson (dict) – custom or child class json code to add

  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 12
class grafanacode.plugins.panel_base.PropColor(color='SL_BLUE', ashex=False)[source]

Bases: object

Dataclass encapsulating the panel colors attribute

  • param color:
    • default: SL_BLUE - optional - type: str

  • param ashex:
    • type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropGridPos(h=0, w=0, x=0, y=0)[source]

Bases: object

Dataclass encapsulating the panel gridposition attribute

  • param h:
    • type: int

  • param w:
    • type: int

  • param x:
    • type: int

  • param y:
    • type: int

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropLegend(showlegend=False, displaymode='table', placement='bottom', calcs=['lastNotNull', 'min', 'max', 'mean'], values=_Nothing.NOTHING, width=None)[source]

Bases: object

Dataclass encapsulating the panel legend attribute

  • param showlegend:
    • type: bool

  • param displaymode:
    • default: table - optional - in: (‘hidden’, ‘list’, ‘table’)

  • param placement:
    • default: bottom - optional - in: (‘bottom’, ‘right’)

  • param calcs:
    • default: [‘lastNotNull’, ‘min’, ‘max’, ‘mean’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param values:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list

  • param width:
    • default: None - optional - type: int

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20

Bases: object

Dataclass encapsulating the panel links list attribute consisting of PropLinksItem

  • param links:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_base.PropLinksItem

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropLinksItem(title=None, url=None, newtab=None)[source]

Bases: object

Dataclass encapsulating one panel linkitem

  • param title:
    • default: None - type: str

  • param url:
    • default: None - type: str

  • param newtab:
    • default: None - type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_base.PropMappings(items=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating the panel mappings list attribute consisting of PropMappingsItem

  • param items:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_base.PropMappingsItem

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropMappingsItem(mvalue=None, mfrom=None, mto=None, mregex=None, mspecial=None, mtext=None, mcolor=None)[source]

Bases: object

Dataclass encapsulating one panel mappingsitem

  • param mvalue:
    • default: None - optional - type: int

  • param mfrom:
    • default: None - optional - type: int

  • param mto:
    • default: None - optional - type: int

  • param mregex:
    • default: None - optional - type: str

  • param mspecial:
    • default: None - optional - in: [‘null’, ‘nan’, ‘null+nan’, ‘empty’, ‘true’, ‘false’]

  • param mtext:
    • default: None - optional - type: str

  • param mcolor:
    • default: None - optional - type: str

  • param mindex:
    • read only

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_base.PropOverrides(items=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating the panel overrides list attribute consisting of PropOverridesItem

  • param items:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_base.PropOverridesItem

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropOverridesItem(oname=None, oregex=None, otype=None, oquery=None, prop=None)[source]

Bases: object

Dataclass encapsulating one panel overrideitem

  • param oname:
    • default: None - optional - type: str

  • param oregex:
    • default: None - optional - type: str

  • param otype:
    • default: None - optional - type: str

  • param oquery:
    • default: None - optional - type: str

  • param prop:
    • default: None - type: list

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_base.PropRepeat(variable=None, direction=None, maxperrow=None)[source]

Bases: object

Dataclass encapsulating the panel repeat attribute

  • param variable:
    • default: None - type: str

  • param direction:
    • default: None - in: (‘h’, ‘v’)

  • param maxperrow:
    • default: None - validator: _AndValidator(_validators=(<optional validator for <instance_of validator for type <class ‘int’>> or None>, <function PropRepeat._check_maxperrow at 0x7fa54d36a790>))

loglevel: int = 20
class grafanacode.plugins.panel_base.PropThresholds(items=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating the panel thresholds list attribute consisting of PropThresholdsItem

  • param items:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_base.PropThresholdsItem

getJ(fcolor)[source]

The fcolor attribute maps to the key <0> of the thresholds attribute.

Parameters:

fcolor (string) – forecolor of the panel

Returns:

dict – items attribute

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_base.PropThresholdsItem(color=PropColor(color='super-light-blue', ashex=False), value=None)[source]

Bases: object

Dataclass encapsulating one panel threshold item

  • param color:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param value:
    • default: None - optional - type: int

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_base.PropTooltip(msresolution=True, shared=True, sort=0, valuetype='cumulative')[source]

Bases: object

Dataclass encapsulating the panel tooltip attribute

  • param msresolution:
    • default: True - type: bool

  • param shared:
    • default: True - type: bool

  • param sort:
    • type: int

  • param valuetype:
    • default: cumulative - type: str

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Parameters:
  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 20
grafanacode.plugins.panel_base.extractCommons1(dset, pset)[source]

Extract commons1 subpanel attributes from a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanel(dset, paneljson)[source]

Extract one panel exported from Grafana to a piece of Python code to be used by this module

Parameters:

dset (dict) – dict with settinga and json to extract (is input and output)

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanelBase(dset, pset)[source]

Extract common properties of one panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanelBaseMappings(dset, pset, item)[source]

Extract one panel mappings part exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

  • item (dict) – json of the mappings to extract

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanelBaseOverrides(dset, pset, item)[source]

Extract one panel overrides part exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

  • item (dict) – json of the mappings to extract

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanelBaseTresholds(dset, pset, item)[source]

Extract one panel thresholds part exported from Grafana to a piece of Python code to be used by this module. This also includes the foregroundcolor (fcolor).

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

  • item (dict) – json of the mappings to extract

Returns:

boolean – True

grafanacode.plugins.panel_base.extractPanelElse(dset, pset)[source]

Extract unknown panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

Returns:

boolean – True

PanelBarchart

grafanacode: class for generating barchart panels

class grafanacode.plugins.panel_barchart.PanelBarChart(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, datalinks=_Nothing.NOTHING, fillopacity=0, gradientmode='none', hidefromgraph=False, hidefromlegend=False, hidefromtooltip=False, hidefromviz=False, legend=_Nothing.NOTHING, linewidth=1, tooltipmode='single', tooltipsort='none', axisgridshow=True, axislabel='', axisplacement='auto', axissoftmax=None, axissoftmin=None, axiswidth=None, barwidth=0.97, barradius=0, colorbyfield=None, groupwidth=0.7, scaletype='linear', scalelog=2, showvalue='auto', stackingmode='none', stackinggroup='A', xfield=None, xlabellength=None, xlabelrotation=0, xlabelspacing=0)[source]

Bases: PanelBaseExtOpt2

Dataclass encapsulating a barchart panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param datalinks:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param fillopacity:
    • type: int

  • param gradientmode:
    • default: none - optional - in: [‘none’, ‘opacity’, ‘hue’, ‘scheme’]

  • param hidefromgraph:
    • type: bool

  • param hidefromlegend:
    • type: bool

  • param hidefromtooltip:
    • type: bool

  • param hidefromviz:
    • type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param linewidth:
    • default: 1 - type: int

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

  • param axisgridshow:
    • default: True - type: bool

  • param axislabel:
    • type: str

  • param axisplacement:
    • default: auto - optional - in: (‘auto’, ‘left’, ‘right’, ‘hidden’)

  • param axissoftmax:
    • default: None - optional - type: int

  • param axissoftmin:
    • default: None - optional - type: int

  • param axiswidth:
    • default: None - optional - type: int

  • param barwidth:
    • default: 0.97 - type: float

  • param barradius:
    • type: float

  • param colorbyfield:
    • default: None - optional - type: str

  • param groupwidth:
    • default: 0.7 - type: float

  • param scaletype:
    • default: linear - optional - in: (‘linear’, ‘log’)

  • param scalelog:
    • default: 2 - optional - in: (2, 10)

  • param showvalue:
    • default: auto - in: (‘auto’, ‘always’, ‘never’)

  • param stackingmode:
    • default: none - in: (‘none’, ‘normal’, ‘percent’)

  • param stackinggroup:
    • default: A - type: str

  • param xfield:
    • default: None - optional - type: str

  • param xlabellength:
    • default: None - optional - type: int

  • param xlabelrotation:
    • in: (-90, -45, 0, 45, 90)

  • param xlabelspacing:
    • in: (-300, -200, -100, 0, 100, 200, 300)

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_barchart.extractPanel_barchart(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelBargauge

grafanacode: class for generating bargauge panels

class grafanacode.plugins.panel_bargauge.PanelBarGauge(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, calcs=['lastNotNull'], fields='', orientation='auto', reducelimit=25, reducevalues=False, titlesize=None, valuesize=None, displaymode='lcd', showunfilled=True, minvizwidth=0, minvizheight=10)[source]

Bases: PanelBaseExtOpt1

Dataclass encapsulating a bargauge panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param calcs:
    • default: [‘lastNotNull’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param fields:
    • type: str

  • param orientation:
    • default: auto - optional - in: [‘auto’, ‘horizontal’, ‘vertical’]

  • param reducelimit:
    • default: 25 - type: int

  • param reducevalues:
    • type: bool

  • param titlesize:
    • default: None - optional - type: int

  • param valuesize:
    • default: None - optional - type: int

  • param displaymode:
    • default: lcd - in: [‘basic’, ‘lcd’, ‘gradient’]

  • param showunfilled:
    • default: True - type: bool

  • param minvizwidth:
    • type: int

  • param minvizheight:
    • default: 10 - type: int

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_bargauge.extractPanel_bargauge(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelBoomtable

grafanacode: class for generating yesoreyeram-boomtable panels

class grafanacode.plugins.panel_boomtable.PanelBoomTable(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, activepatternindex=0, defaultpattern=_Nothing.NOTHING, defaultrowtitle='Metric', patterns=_Nothing.NOTHING, rowcolwrapper='_', sortingcolindex=-1, sortingdirection='asc', nonmatchingcellstext='', firstcolumnlink='', fontsize='', alignmentfirstcolumn='left', alignmentvalues='left', alignmentheader='left', hideheaders=False, hidefirstcolumn=False, debugmode=False, nonmatchingcellscolorbg='', nonmatchingcellscolortext='')[source]

Bases: PanelBase

Dataclass encapsulating a boomtable panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param activepatternindex:
    • type: int

  • param defaultpattern:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_boomtable.PropBoomtablePatternsItem’>, takes_self=False) - type: grafanacode.plugins.panel_boomtable.PropBoomtablePatternsItem

  • param defaultrowtitle:
    • default: Metric - type: str

  • param patterns:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_boomtable.PropBoomtablePatternsItem

  • param rowcolwrapper:
    • default: _ - type: str

  • param sortingcolindex:
    • default: -1 - type: int

  • param sortingdirection:
    • default: asc - in: (‘asc’, ‘desc’)

  • param nonmatchingcellstext:
    • type: str

  • param firstcolumnlink:
    • type: str

  • param fontsize:
    • type: str

  • param alignmentfirstcolumn:
    • default: left - optional - in: (‘left’, ‘center’, ‘right’)

  • param alignmentvalues:
    • default: left - optional - in: (‘left’, ‘center’, ‘right’)

  • param alignmentheader:
    • default: left - optional - in: (‘left’, ‘center’, ‘right’)

  • param hideheaders:
    • type: bool

  • param hidefirstcolumn:
    • type: bool

  • param debugmode:
    • type: bool

  • param nonmatchingcellscolorbg:
    • type: str

  • param nonmatchingcellscolortext:
    • type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
class grafanacode.plugins.panel_boomtable.PropBoomtablePatternsItem(bgcolors='green|orange|red', bgcolorsoverrides='0->green|2->red|1->yellow', clickablecellslink='', colname='Value', decimals=2, defaultbgcolor='transparent', defaulttextcolor='', delimiter='.', displaytemplate='_value_', enablebgcolor=False, enablebgcoloroverrides=False, enableclickablecells=False, enabletextcolor=False, enabletextcoloroverrides=False, enabletimebasedthresholds=False, enabletransform=False, enabletransformoverrides=False, filtervalueabove='', filtervaluebelow='', format='none', name='Default Pattern', nullcolor='darkred', nulltextcolor='black', nullvalue='No data', pattern='*', rowcolwrapper='_', rowname='_series_', textcolors='red|orange|green', textcolorsoverrides='0->red|2->green|1->yellow', thresholds='70,90', timebasedthresholds=_Nothing.NOTHING, tooltiptemplate='Series : _series_ <br/>Row Name : _row_name_ <br/>Col Name : _col_name_ <br/>Value : _value_', transformvalues='_value_|_value_|_value_', transformvaluesoverrides='0->down|1->up', valuename='avg')[source]

Bases: object

Dataclass encapsulating a PatternsItem item

  • param bgcolors:
    • default: green|orange|red - type: str

  • param bgcolorsoverrides:
    • default: 0->green|2->red|1->yellow - type: str

  • param clickablecellslink:
    • type: str

  • param colname:
    • default: Value - type: str

  • param decimals:
    • default: 2 - type: int

  • param defaultbgcolor:
    • default: transparent - type: str

  • param defaulttextcolor:
    • type: str

  • param delimiter:
    • default: . - type: str

  • param displaytemplate:
    • default: _value_ - type: str

  • param enablebgcolor:
    • type: bool

  • param enablebgcoloroverrides:
    • type: bool

  • param enableclickablecells:
    • type: bool

  • param enabletextcolor:
    • type: bool

  • param enabletextcoloroverrides:
    • type: bool

  • param enabletimebasedthresholds:
    • type: bool

  • param enabletransform:
    • type: bool

  • param enabletransformoverrides:
    • type: bool

  • param filtervalueabove:
    • type: str

  • param filtervaluebelow:
    • type: str

  • param format:
    • default: none - type: str

  • param name:
    • default: Default Pattern - type: str

  • param nullcolor:
    • default: darkred - type: str

  • param nulltextcolor:
    • default: black - type: str

  • param nullvalue:
    • default: No data - type: str

  • param pattern:
    • default: * - type: str

  • param rowcolwrapper:
    • default: _ - type: str

  • param rowname:
    • default: _series_ - type: str

  • param textcolors:
    • default: red|orange|green - type: str

  • param textcolorsoverrides:
    • default: 0->red|2->green|1->yellow - type: str

  • param thresholds:
    • default: 70,90 - type: str

  • param timebasedthresholds:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_boomtable.PropBoomtableTimeBasedThresholdsItem

  • param tooltiptemplate:
    • default: Series : _series_ <br/>Row Name : _row_name_ <br/>Col Name : _col_name_ <br/>Value : _value_ - type: str

  • param transformvalues:
    • default: _value_|_value_|_value_ - type: str

  • param transformvaluesoverrides:
    • default: 0->down|1->up - type: str

  • param valuename:
    • default: avg - type: str

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_boomtable.PropBoomtableTimeBasedThresholdsItem(enableddays='Sun,Mon,Tue,Wed,Thu,Fri,Sat', hourfrom='0000', name='tb01', threshold='70,90', hourto='0530')[source]

Bases: object

Dataclass encapsulating a TimeBasedThresholds item

  • param enableddays:
    • default: Sun,Mon,Tue,Wed,Thu,Fri,Sat - type: str

  • param hourfrom:
    • default: 0000 - type: str

  • param name:
    • default: tb01 - type: str

  • param threshold:
    • default: 70,90 - type: str

  • param hourto:
    • default: 0530 - type: str

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 21
grafanacode.plugins.panel_boomtable.extractPanel_yesoreyeram_boomtable_panel(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settinga and json to extract (is input and output)

  • pset (dict) – dict with panel settinga and json to extract (is input and output)

Returns:

boolean – True

PanelCarpetplot

grafanacode: class for generating petrslavotinek-carpetplot panels

class grafanacode.plugins.panel_carpetplot.PanelCarpetplot(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, dataformat='timeseries', aggregate='AVG', colorscheme='interpolateSpectral', colorspace='RGB', colormode='SPECTRUM', customcolors=_Nothing.NOTHING, decimals=None, fragment='HOUR', invertcolor=False, nullcolor='transparent', legend=True, min=None, max=None, tooltip=True, units=None, xaxis=_Nothing.NOTHING, yaxis=_Nothing.NOTHING)[source]

Bases: PanelBase

Dataclass encapsulating a carpetplot panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param dataformat:
    • default: timeseries - in: (‘timeseries’, ‘tsbuckets’)

  • param aggregate:
    • default: AVG - type: str

  • param colorscheme:
    • default: interpolateSpectral - type: str

  • param colorspace:
    • default: RGB - in: [‘RGB’, ‘LAB’, ‘HSL’, ‘HCL’, ‘CUBEHELIX’]

  • param colormode:
    • default: SPECTRUM - in: [‘SPECTRUM’, ‘CUSTOM’]

  • param customcolors:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_carpetplot.PropCarpetplotColors’>, takes_self=False) - type: grafanacode.plugins.panel_carpetplot.PropCarpetplotColors

  • param decimals:
    • default: None - optional - type: int

  • param fragment:
    • default: HOUR - type: str

  • param invertcolor:
    • type: bool

  • param nullcolor:
    • default: transparent - type: str

  • param legend:
    • default: True - type: bool

  • param min:
    • default: None - optional - type: int

  • param max:
    • default: None - optional - type: int

  • param tooltip:
    • default: True - type: bool

  • param units:
    • default: None - optional - type: str

  • param xaxis:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_carpetplot.PropCarpetplotXAxis’>, takes_self=False) - type: grafanacode.plugins.panel_carpetplot.PropCarpetplotXAxis

  • param yaxis:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_carpetplot.PropCarpetplotYAxis’>, takes_self=False) - type: grafanacode.plugins.panel_carpetplot.PropCarpetplotYAxis

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
class grafanacode.plugins.panel_carpetplot.PropCarpetplotColors(items=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating a Colors list attribute consisting of PropCarpetplotColorsItem

  • param items:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_carpetplot.PropCarpetplotColorsItem

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_carpetplot.PropCarpetplotColorsItem(breakpoint=0, color=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating a Colors item

  • param breakpoint:
    • type: int

  • param color:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropColor’>, takes_self=False) - type: str

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 21
class grafanacode.plugins.panel_carpetplot.PropCarpetplotXAxis(labelformat='%a %m/%d', minbucketwidthtoshowweekends=4, show=True, showcrosshair=True, showweekends=True)[source]

Bases: object

Dataclass encapsulating a Xaxis attribute

  • param labelformat:
    • default: %a %m/%d - optional - type: str

  • param minbucketwidthtoshowweekends:
    • default: 4 - optional - type: int

  • param show:
    • default: True - optional - type: bool

  • param showcrosshair:
    • default: True - optional - type: bool

  • param showweekends:
    • default: True - optional - type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_carpetplot.PropCarpetplotYAxis(show=True, showcrosshair=True)[source]

Bases: object

Dataclass encapsulating a Yaxis attribute

  • param show:
    • default: True - type: bool

  • param showcrosshair:
    • default: True - type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
grafanacode.plugins.panel_carpetplot.extractPanel_petrslavotinek_carpetplot_panel(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelDashboardlist

grafanacode: class for generating dashboardlist panels

class grafanacode.plugins.panel_dashboardlist.PanelDashboardList(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, folderid=0, showheadings=False, showsearch=False, showrecent=False, showstarred=False, maxitems=10, searchquery='', searchtags=_Nothing.NOTHING, overrides=_Nothing.NOTHING)[source]

Bases: PanelBase

Dataclass encapsulating a dashboardlist panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param folderid:
    • type: int

  • param showheadings:
    • type: bool

  • param showsearch:
    • type: bool

  • param showrecent:
    • type: bool

  • param showstarred:
    • type: bool

  • param maxitems:
    • default: 10 - type: int

  • param searchquery:
    • type: str

  • param searchtags:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_dashboardlist.extractPanel_dashlist(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelDynamicImage

grafanacode: class for generating dalvany_impage panels

class grafanacode.plugins.panel_dynamicimage.PanelDynamicImage(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, width=75, height=75, iconfield='', baseurl='', suffix='')[source]

Bases: PanelBase

Dataclass encapsulating a dalvany image panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param width:
    • default: 75 - optional - type: int

  • param height:
    • default: 75 - optional - type: int

  • param iconfield:
    • optional - type: str

  • param baseurl:
    • optional - type: str

  • param suffix:
    • optional - type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_dynamicimage.extractPanel_dalvany_image_panel(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelStatusmap

grafanacode: class for generating flant-statusmap panels

class grafanacode.plugins.panel_flant_statusmap.PanelStatusmap(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, alert=None, cards={'cardHSpacing': 2, 'cardMinWidth': 5, 'cardRound': None, 'cardVSpacing': 2}, color=_Nothing.NOTHING, isnew=True, legend=_Nothing.NOTHING, nullpointmode='null', tooltip=_Nothing.NOTHING, xaxis=_Nothing.NOTHING, yaxis=_Nothing.NOTHING)[source]

Bases: PanelBase

Dataclass encapsulating a flant statusmap panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param alert:
    • default: None

  • param cards:
    • default: {‘cardRound’: None, ‘cardMinWidth’: 5, ‘cardHSpacing’: 2, ‘cardVSpacing’: 2} - type: dict

  • param color:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_flant_statusmap.PropStatusmapColor’>, takes_self=False) - type: grafanacode.plugins.panel_flant_statusmap.PropStatusmapColor

  • param isnew:
    • default: True - type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_flant_statusmap.PropStatusmapLegend’>, takes_self=False) - type: grafanacode.plugins.panel_flant_statusmap.PropStatusmapLegend

  • param nullpointmode:
    • default: null

  • param tooltip:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropTooltip’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropTooltip

  • param xaxis:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_flant_statusmap.PropStatusmapXAxis’>, takes_self=False) - type: grafanacode.plugins.panel_flant_statusmap.PropStatusmapXAxis

  • param yaxis:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
class grafanacode.plugins.panel_flant_statusmap.PropStatusmapColor(cardcolor='#b4ff00', colorscale='sqrt', colorscheme='GnYlRd', exponent=0.5, mode='spectrum', thresholds=[], min=None, max=None)[source]

Bases: object

Dataclass encapsulating the panel color attribute

  • param cardcolor:
    • default: #b4ff00 - optional - type: str

  • param colorscale:
    • default: sqrt - optional - type: str

  • param colorscheme:
    • default: GnYlRd - optional - type: str

  • param exponent:
    • default: 0.5 - optional - type: int

  • param mode:
    • default: spectrum - optional - type: str

  • param thresholds:
    • optional - type: list

  • param min:
    • default: None - optional - type: int

  • param max:
    • default: None - optional - type: int

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_flant_statusmap.PropStatusmapLegend(alignastable=False, avg=False, current=False, hideempty=False, hidezero=False, min=None, max=None, rightside=False, show=True, sidewidth=None, sort=None, sortdesc=False, total=False, values=None)[source]

Bases: object

Dataclass encapsulating the panel legend attribute

  • param alignastable:
    • type: bool

  • param avg:
    • type: bool

  • param current:
    • type: bool

  • param hideempty:
    • type: bool

  • param hidezero:
    • type: bool

  • param min:
    • default: None - optional - type: int

  • param max:
    • default: None - optional - type: int

  • param rightside:
    • type: bool

  • param show:
    • default: True - type: bool

  • param sidewidth:
    • default: None

  • param sort:
    • default: None

  • param sortdesc:

  • param total:
    • type: bool

  • param values:
    • default: None

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_flant_statusmap.PropStatusmapXAxis(mode='time', name=None, values=_Nothing.NOTHING, show=True)[source]

Bases: object

Dataclass encapsulating the panel Xaxis attribute

  • param mode:
    • default: time - optional - in: [‘time’, ‘series’]

  • param name:
    • default: None - optional - type: str

  • param values:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - optional - type: list

  • param show:
    • default: True - optional - type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
grafanacode.plugins.panel_flant_statusmap.extractPanel_flant_statusmap_panel(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelGauge

grafanacode: class for generating gauge panels

class grafanacode.plugins.panel_gauge.PanelGauge(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, calcs=['lastNotNull'], fields='', orientation='auto', reducelimit=25, reducevalues=False, titlesize=None, valuesize=None, thresholdlabels=True, thresholdmarkers=True)[source]

Bases: PanelBaseExtOpt1

Dataclass encapsulating a gauge panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param calcs:
    • default: [‘lastNotNull’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param fields:
    • type: str

  • param orientation:
    • default: auto - optional - in: [‘auto’, ‘horizontal’, ‘vertical’]

  • param reducelimit:
    • default: 25 - type: int

  • param reducevalues:
    • type: bool

  • param titlesize:
    • default: None - optional - type: int

  • param valuesize:
    • default: None - optional - type: int

  • param thresholdlabels:
    • default: True - type: bool

  • param thresholdmarkers:
    • default: True - type: bool

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_gauge.extractPanel_gauge(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelGeomap

grafanacode: class for generating geomap panels

class grafanacode.plugins.panel_geomap.PanelGeomap(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, basemapname='Basemap', basemaptype='default', colorscheme='thresholds', fcolor='super-light-blue', hidefromtooltip=True, hidefromviz=True, hidefromlegend=True, hidefromgraph=True, layers=_Nothing.NOTHING, mappings=_Nothing.NOTHING, mousewheelzoom=False, overrides=_Nothing.NOTHING, showattribution=False, showdebug=False, showscale=False, showzoom=True, thresholdmode='absolute', thresholds=_Nothing.NOTHING, tooltipmode='details', viewid='fit', viewlat=46, viewlon=14, viewzoom='fit')[source]

Bases: PanelBase

Dataclass encapsulating a geomap panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param basemapname:
    • default: Basemap - optional - type: str

  • param basemaptype:
    • default: default - optional - type: str

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param fcolor:
    • default: super-light-blue - optional - type: str

  • param hidefromtooltip:
    • default: True - optional - type: bool

  • param hidefromviz:
    • default: True - optional - type: bool

  • param hidefromlegend:
    • default: True - optional - type: bool

  • param hidefromgraph:
    • default: True - optional - type: bool

  • param layers:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_geomap.PropGeomapLayers’>, takes_self=False) - optional - type: grafanacode.plugins.panel_geomap.PropGeomapLayers

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param mousewheelzoom:
    • optional - type: bool

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param showattribution:
    • optional - type: bool

  • param showdebug:
    • optional - type: bool

  • param showscale:
    • optional - type: bool

  • param showzoom:
    • default: True - optional - type: bool

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param tooltipmode:
    • default: details - optional - type: str

  • param viewid:
    • default: fit - optional - type: str

  • param viewlat:
    • default: 46 - optional - type: int

  • param viewlon:
    • default: 14 - optional - type: int

  • param viewzoom:
    • default: fit - optional - type: int

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
class grafanacode.plugins.panel_geomap.PropGeomapLayers(items=_Nothing.NOTHING)[source]

Bases: object

Dataclass encapsulating a layers attribute

  • param items:
    • default: Factory(factory=<class ‘list’>, takes_self=False) - type: list - of: grafanacode.plugins.panel_geomap.PropGeomapLayersItem

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_geomap.PropGeomapLayersItem(showlegend=True, colorfield='metric', colorfixed='dark-green', opacity=0.4, rotationfixed=0, rotationmax=360, rotationmin=-360, rotationmode='mod', sizefield='metric', sizefixed=5, sizemax=15, sizemin=5, symbolfixed='img/icons/marker/circle.svg', symbolmode='fixed', fontsize=12, textoffsetx=0, textoffsety=0, textalign='center', textbaseline='middle', locationlatitude='lat', locationlongitude='lon', locationmode='coords', name='Layer 1', tooltip=True, layertype='markers')[source]

Bases: object

Dataclass encapsulating a layers attribute

  • param showlegend:
    • default: True - type: bool

  • param colorfield:
    • default: metric - type: str

  • param colorfixed:
    • default: dark-green - optional - type: str

  • param opacity:
    • default: 0.4 - type: float

  • param rotationfixed:
    • type: int

  • param rotationmax:
    • default: 360 - type: str

  • param rotationmin:
    • default: -360 - type: str

  • param rotationmode:
    • default: mod - type: str

  • param sizefield:
    • default: metric - type: str

  • param sizefixed:
    • default: 5 - type: str

  • param sizemax:
    • default: 15 - type: str

  • param sizemin:
    • default: 5 - type: str

  • param symbolfixed:
    • default: img/icons/marker/circle.svg - type: str

  • param symbolmode:
    • default: fixed - type: str

  • param fontsize:
    • default: 12 - type: str

  • param textoffsetx:
    • type: str

  • param textoffsety:
    • type: str

  • param textalign:
    • default: center - type: str

  • param textbaseline:
    • default: middle - type: str

  • param locationlatitude:
    • default: lat - type: str

  • param locationlongitude:
    • default: lon - type: str

  • param locationmode:
    • default: coords - type: str

  • param name:
    • default: Layer 1 - type: str

  • param tooltip:
    • default: True - type: str

  • param layertype:
    • default: markers - type: str

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 21
grafanacode.plugins.panel_geomap.extractPanel_geomap(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelHeatmap

grafanacode: class for generating heatmap panels

class grafanacode.plugins.panel_heatmap.PanelHeatmap(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, legend={'show': False}, tooltip=_Nothing.NOTHING, cardpadding=None, cardround=None, color=_Nothing.NOTHING, dataformat='timeseries', heatmap=_Nothing.NOTHING, hidezerobuckets=False, highlightcards=True, options=None, xaxisshow=<instance_of validator for type <class 'bool'>>, xbucketnumber=None, xbucketsize=None, yaxis=_Nothing.NOTHING, ybucketbound=None, ybucketnumber=None, ybucketsize=None, reverseybuckets=False)[source]

Bases: PanelBase

Dataclass encapsulating a heatmap panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param legend:
    • default: {‘show’: False} - type: dict

  • param tooltip:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropTooltip’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropTooltip

  • param cardpadding:
    • default: None - optional - type: str

  • param cardround:
    • default: None - optional - type: str

  • param color:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_heatmap.PropHeatmapColor’>, takes_self=False) - type: grafanacode.plugins.panel_heatmap.PropHeatmapColor

  • param dataformat:
    • default: timeseries - in: (‘timeseries’, ‘tsbuckets’)

  • param heatmap:
    • default: Factory(factory=<class ‘dict’>, takes_self=False) - type: dict

  • param hidezerobuckets:
    • type: bool

  • param highlightcards:
    • default: True - type: bool

  • param options:
    • default: None

  • param xaxisshow:
    • default: <instance_of validator for type <class ‘bool’>> - type: bool

  • param xbucketnumber:
    • default: None

  • param xbucketsize:
    • default: None

  • param yaxis:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_heatmap.PropHeatmapYAxis’>, takes_self=False) - type: grafanacode.plugins.panel_heatmap.PropHeatmapYAxis

  • param ybucketbound:
    • default: None

  • param ybucketnumber:
    • default: None

  • param ybucketsize:
    • default: None

  • param reverseybuckets:
    • type: bool

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
class grafanacode.plugins.panel_heatmap.PropHeatmapColor(cardcolor='#b4ff00', colorscale='sqrt', colorscheme='interpolateOranges', exponent=0.5, mode='spectrum', min=None, max=None)[source]

Bases: object

Dataclass encapsulating the panel color attribute

  • param cardcolor:
    • default: #b4ff00 - optional - type: str

  • param colorscale:
    • default: sqrt - type: str

  • param colorscheme:
    • default: interpolateOranges - type: str

  • param exponent:
    • default: 0.5 - type: float

  • param mode:
    • default: spectrum - type: str

  • param min:
    • default: None - optional - type: int

  • param max:
    • default: None - optional - type: int

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
class grafanacode.plugins.panel_heatmap.PropHeatmapYAxis(decimals=None, format=None, label=None, logbase=1, min=None, max=None, show=True)[source]

Bases: object

Dataclass encapsulating the panel Yaxis attribute

  • param decimals:
    • default: None - optional - type: int

  • param format:
    • default: None - optional - type: str

  • param label:
    • default: None - optional - type: str

  • param logbase:
    • default: 1 - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param max:
    • default: None - optional - type: int

  • param show:
    • default: True - optional - type: bool

getJson(dashboard=None, panel=None)[source]

Create the json to pack this item.

Returns:

dict – panel json code

loglevel: int = 20
grafanacode.plugins.panel_heatmap.extractPanel_heatmap(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelHistogram

grafanacode: class for generating histogram panels

class grafanacode.plugins.panel_histogram.PanelHistogram(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, datalinks=_Nothing.NOTHING, fillopacity=0, gradientmode='none', hidefromgraph=False, hidefromlegend=False, hidefromtooltip=False, hidefromviz=False, legend=_Nothing.NOTHING, linewidth=1, tooltipmode='single', tooltipsort='none', bucketoffset=0, bucketsize=None, combine=False)[source]

Bases: PanelBaseExtOpt2

Dataclass encapsulating a histogram panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param datalinks:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param fillopacity:
    • type: int

  • param gradientmode:
    • default: none - optional - in: [‘none’, ‘opacity’, ‘hue’, ‘scheme’]

  • param hidefromgraph:
    • type: bool

  • param hidefromlegend:
    • type: bool

  • param hidefromtooltip:
    • type: bool

  • param hidefromviz:
    • type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param linewidth:
    • default: 1 - type: int

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

  • param bucketoffset:
    • type: int

  • param bucketsize:
    • default: None - optional - type: int

  • param combine:
    • type: bool

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_histogram.extractPanel_histogram(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelLogs

grafanacode: class for generating logs panels

class grafanacode.plugins.panel_logs.PanelLogs(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, showlabels=False, showcommonlabels=False, showtime=False, wraplogmessages=False, sortorder='Descending', dedupstrategy='none', enablelogdetails=False, overrides=_Nothing.NOTHING, prettifylogmessage=False)[source]

Bases: PanelBase

Dataclass encapsulating a logs panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param showlabels:
    • type: bool

  • param showcommonlabels:
    • type: bool

  • param showtime:
    • type: bool

  • param wraplogmessages:
    • type: bool

  • param sortorder:
    • default: Descending - type: str

  • param dedupstrategy:
    • default: none - type: str

  • param enablelogdetails:
    • type: bool

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param prettifylogmessage:
    • type: bool

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_logs.extractPanel_logs(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelNews

grafanacode: class for generating news panels

class grafanacode.plugins.panel_news.PanelNews(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, showimage=False, feedurl='https://grafana.com/blog/news.xml')[source]

Bases: PanelBase

Dataclass encapsulating a news panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param showimage:
    • type: bool

  • param feedurl:
getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_news.extractPanel_news(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelPiechart

grafanacode: class for generating piechart panels

class grafanacode.plugins.panel_piechart.PanelPieChart(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, units=None, datalinks=_Nothing.NOTHING, gradientmode='none', hidefromlegend=False, hidefromtooltip=False, hidefromviz=False, legend=_Nothing.NOTHING, tooltipmode='single', tooltipsort='none', labels=[], pietype='pie', strokewidth=1)[source]

Bases: PanelBaseExtOpt2

Dataclass encapsulating a pychart panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param units:
    • default: None - optional - type: str

  • param datalinks:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param gradientmode:
    • default: none - optional - in: [‘none’, ‘opacity’, ‘hue’, ‘scheme’]

  • param hidefromlegend:
    • type: bool

  • param hidefromtooltip:
    • type: bool

  • param hidefromviz:
    • type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

  • param hidefromgraph:
    • read only - default: None

  • param linewidth:
    • read only - default: None

  • param fillopacity:
    • read only - default: None

  • param thresholdmode:
    • read only - default: None

  • param thresholds:
    • read only - default: None

  • param labels:
    • type: list - of: in: (‘name’, ‘value’, ‘percent’)

  • param pietype:
    • default: pie - optional - in: (‘pi’, ‘donut’)

  • param strokewidth:
    • default: 1 - type: int

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_piechart.extractPanel_piechart(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelPlotly

grafanacode: class for generating ae3e-plotly panels

class grafanacode.plugins.panel_plotly.PanelPlotly(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, configuration=_Nothing.NOTHING, data=_Nothing.NOTHING, layout=_Nothing.NOTHING, script="\nconsole.log(data)\nvar trace = {\n  x: data.series[0].fields[0].values.buffer,\n  y: data.series[0].fields[1].values.buffer\n};\nreturn {data:[trace],layout:{title:'My Chart'}};", clickscript='')[source]

Bases: PanelBase

Dataclass encapsulating a ae3e plotly panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param configuration:
    • default: Factory(factory=<class ‘dict’>, takes_self=False) - type: dict

  • param data:
    • default: Factory(factory=<class ‘str’>, takes_self=False) - type: str

  • param layout:
    • default: Factory(factory=<class ‘dict’>, takes_self=False) - type: dict

  • param script:
    • default: console.log(data) var trace = { x: data.series[0].fields[0].values.buffer, y: data.series[0].fields[1].values.buffer }; return {data:[trace],layout:{title:’My Chart’}}; - type: str

  • param clickscript:
    • type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_plotly.extractPanel_ae3e_plotly_panel(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelPlotlyWindrose

grafanacode: class for generating ae3e-plotly windrose panels

This class is derived from PanelPlotly.

Mind the EXTRACTCHILDCLASS = True at the end of the file, This is needed for a derived class to prevent the base class method to be hidden while extracting panels.

class grafanacode.plugins.panel_plotly_windrose.PanelPlotlyWindrose(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, configuration=_Nothing.NOTHING, data=_Nothing.NOTHING, layout=_Nothing.NOTHING, script="\nconsole.log(data)\nvar trace = {\n  x: data.series[0].fields[0].values.buffer,\n  y: data.series[0].fields[1].values.buffer\n};\nreturn {data:[trace],layout:{title:'My Chart'}};", clickscript='', scriptpre='', scriptpost='')[source]

Bases: PanelPlotly

Dataclass encapsulating a windrose panel based on the ae3e plotly panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param configuration:
    • default: Factory(factory=<class ‘dict’>, takes_self=False) - type: dict

  • param data:
    • default: Factory(factory=<class ‘str’>, takes_self=False) - type: str

  • param layout:
    • default: Factory(factory=<class ‘dict’>, takes_self=False) - type: dict

  • param script:
    • default: console.log(data) var trace = { x: data.series[0].fields[0].values.buffer, y: data.series[0].fields[1].values.buffer }; return {data:[trace],layout:{title:’My Chart’}}; - type: str

  • param clickscript:
    • type: str

  • param scriptpre:
    • type: str

  • param scriptpost:
    • type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 16

PanelRow

grafanacode: class for generating row panels

class grafanacode.plugins.panel_row.PanelRow(collapsed=False, datasource=None, gridpos=_Nothing.NOTHING, id=None, targets=None, title='', extraprops=None)[source]

Bases: object

Dataclass encapsulating a row panel

  • param collapsed:
    • type: bool

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param id:
    • default: None - optional - type: int

  • param targets:
    • default: None - optional - type: list

  • param title:
    • type: str

  • param extraprops:
    • default: None - optional - type: dict

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_row.extractPanel_row(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelStat

grafanacode: class for generating stat panels

class grafanacode.plugins.panel_stat.PanelStat(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, calcs=['lastNotNull'], fields='', orientation='auto', reducelimit=25, reducevalues=False, titlesize=None, valuesize=None, colormode='value', graphmode='none', justify='center', textmode='value')[source]

Bases: PanelBaseExtOpt1

Dataclass encapsulating a stat panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param calcs:
    • default: [‘lastNotNull’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param fields:
    • type: str

  • param orientation:
    • default: auto - optional - in: [‘auto’, ‘horizontal’, ‘vertical’]

  • param reducelimit:
    • default: 25 - type: int

  • param reducevalues:
    • type: bool

  • param titlesize:
    • default: None - optional - type: int

  • param valuesize:
    • default: None - optional - type: int

  • param colormode:
    • default: value - optional - in: [‘none’, ‘value’, ‘background’]

  • param graphmode:
    • default: none - optional - in: [‘none’, ‘area’]

  • param justify:
    • default: center - optional - in: [‘auto’, ‘center’]

  • param textmode:
    • default: value - type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_stat.extractPanel_stat(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelStatetimeline

grafanacode: class for generating state-timeline panels

class grafanacode.plugins.panel_statetimeline.PanelStateTimeline(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, alignvalue='left', colwidth=0.9, fillopacity=0, legend=_Nothing.NOTHING, linewidth=1, mergevalues=True, showvalue='auto', spannulls=False, tooltipmode='single', tooltipsort='none', rowheight=0.97)[source]

Bases: PanelBaseExtCommon1

Dataclass encapsulating a statetimeline panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param alignvalue:
    • default: left - in: (‘left’, ‘center’, ‘right’)

  • param colwidth:
    • default: 0.9 - type: float

  • param fillopacity:
    • type: int

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param linewidth:
    • default: 1 - type: int

  • param mergevalues:
    • default: True - type: bool

  • param showvalue:
    • default: auto - in: (‘auto’, ‘always’, ‘never’)

  • param spannulls:
    • type: bool

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

  • param rowheight:
    • default: 0.97 - type: float

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_statetimeline.extractPanel_state_timeline(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelTable

grafanacode: class for generating table panels

class grafanacode.plugins.panel_table.PanelTable(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, align='auto', displaymode='auto', enablepagination=False, filterable=False, footercalcs=['lastNotNull'], footerfields='', inspect=False, showheader=True, showfooter=False)[source]

Bases: PanelBaseExtCommon1

Dataclass encapsulating a table panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param align:
    • default: auto - in: (‘auto’, ‘left’, ‘center’, ‘right’)

  • param displaymode:
    • default: auto - in: (‘auto’, ‘color-text’, ‘color-background’, ‘color-background-solid’, ‘gradient-gauge’, ‘lcd-gauge’, ‘basic’, ‘json-view’)

  • param enablepagination:
    • type: bool

  • param filterable:
    • type: bool

  • param footercalcs:
    • default: [‘lastNotNull’] - type: list - of: in: (‘lastNotNull’, ‘min’, ‘mean’, ‘max’, ‘last’, ‘firstNotNull’, ‘first’, ‘sum’, ‘count’, ‘range’, ‘delta’, ‘step’, ‘diff’, ‘logmin’, ‘allIsZero’, ‘allIsNull’, ‘changeCount’, ‘distinctCount’, ‘diffperc’, ‘allValues’)

  • param footerfields:
    • type: str

  • param inspect:
    • type: bool

  • param showheader:
    • default: True - type: bool

  • param showfooter:
    • type: bool

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_table.extractPanel_table(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelText

grafanacode: class for generating text panels

class grafanacode.plugins.panel_text.PanelText(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, mode='markdown', content='.\n\n')[source]

Bases: PanelBase

Dataclass encapsulating a text panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param mode:
    • default: markdown - in: [‘markdown’, ‘html’]

  • param content:
    • default: . - type: str

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:
  • customjson (dict) – custom or child class json code to add

  • dashboard (Dashboard) – Dashboard object we are in

  • panel (Panel_base) – Panel object we are in

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_text.extractPanel_text(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True

PanelTimeseries

grafanacode: class for generating timeseries panels

class grafanacode.plugins.panel_timeseries.PanelTimeSeries(datasource=None, gridpos=_Nothing.NOTHING, hidetimeoverride=None, id=None, interval=None, links=_Nothing.NOTHING, maxdatapoints=None, repeat=None, targets=None, timefrom=None, timeregions=None, timezone=None, timeshift=None, title='', transformations=None, transparent=False, extraprops=None, colorscheme='thresholds', decimals=None, displayname=None, fcolor=PropColor(color='super-light-blue', ashex=False), mappings=_Nothing.NOTHING, max=None, min=None, novalue=None, overrides=_Nothing.NOTHING, thresholdmode='absolute', thresholds=_Nothing.NOTHING, units=None, datalinks=_Nothing.NOTHING, fillopacity=0, gradientmode='none', hidefromgraph=False, hidefromlegend=False, hidefromtooltip=False, hidefromviz=False, legend=_Nothing.NOTHING, linewidth=1, tooltipmode='single', tooltipsort='none', axisgridshow=True, axislabel='', axisplacement='auto', axissoftmax=None, axissoftmin=None, axiswidth=None, baralignment=0, drawstyle='line', linedash1=10, linedash2=10, lineinterpolation='linear', linestyle='solid', pointsize=5, scaletype='linear', scalelog=2, showpoints='never', spannulls=True, stackingmode='none', stackinggroup='A', thresholdsstyle='off')[source]

Bases: PanelBaseExtOpt2

Dataclass encapsulating a timeseries panel

  • param datasource:
    • default: None - optional - type: dict

  • param gridpos:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropGridPos’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropGridPos

  • param hidetimeoverride:
    • default: None - optional - type: bool

  • param id:
    • default: None - optional - type: int

  • param interval:
    • default: None - optional - type: int

  • param links:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param maxdatapoints:
    • default: None - optional - type: int

  • param repeat:
    • default: None - optional - type: grafanacode.plugins.panel_base.PropRepeat

  • param targets:
    • default: None - optional - type: list

  • param timefrom:
    • default: None - optional - type: str

  • param timeregions:
    • default: None - optional - type: list

  • param timezone:
    • default: None - optional - type: str

  • param timeshift:
    • default: None - optional - type: str

  • param title:
    • validator: _AndValidator(_validators=(<instance_of validator for type <class ‘str’>>, <function PanelBase._check_title at 0x7fa54d323af0>))

  • param transformations:
    • default: None - optional - type: list

  • param transparent:
    • type: bool

  • param extraprops:
    • default: None - optional - type: dict

  • param colorscheme:
    • default: thresholds - in: (‘value’, ‘fixed’, ‘thresholds’, ‘palette-classic’, ‘continuous-GrYlRd’, ‘continuous-RdYlGr’, ‘continuous-BlYlRd’)

  • param decimals:
    • default: None - optional - type: int

  • param displayname:
    • default: None - optional - type: str

  • param fcolor:
    • default: PropColor(color=’super-light-blue’, ashex=False) - optional - type: str

  • param mappings:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropMappings’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropMappings

  • param max:
    • default: None - optional - type: int

  • param min:
    • default: None - optional - type: int

  • param novalue:
    • default: None - optional - type: str

  • param overrides:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropOverrides’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropOverrides

  • param thresholdmode:
    • default: absolute - in: (‘absolute’, ‘percentage’)

  • param thresholds:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropThresholds’>, takes_self=False) - optional - type: grafanacode.plugins.panel_base.PropThresholds

  • param units:
    • default: None - optional - type: str

  • param datalinks:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLinks’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLinks

  • param fillopacity:
    • type: int

  • param gradientmode:
    • default: none - optional - in: [‘none’, ‘opacity’, ‘hue’, ‘scheme’]

  • param hidefromgraph:
    • type: bool

  • param hidefromlegend:
    • type: bool

  • param hidefromtooltip:
    • type: bool

  • param hidefromviz:
    • type: bool

  • param legend:
    • default: Factory(factory=<class ‘grafanacode.plugins.panel_base.PropLegend’>, takes_self=False) - type: grafanacode.plugins.panel_base.PropLegend

  • param linewidth:
    • default: 1 - type: int

  • param tooltipmode:
    • default: single - optional - in: (‘single’, ‘multi’, ‘none’)

  • param tooltipsort:
    • default: none - optional - in: [‘none’, ‘asc’, ‘desc’]

  • param axisgridshow:
    • default: True - type: bool

  • param axislabel:
    • type: str

  • param axisplacement:
    • default: auto - optional - in: (‘auto’, ‘left’, ‘right’, ‘hidden’)

  • param axissoftmax:
    • default: None - optional - type: int

  • param axissoftmin:
    • default: None - optional - type: int

  • param axiswidth:
    • default: None - optional - type: int

  • param baralignment:
    • optional - in: (-1, 0, 1)

  • param drawstyle:
    • default: line - optional - in: (‘line’, ‘bars’, ‘points’)

  • param linedash1:
    • default: 10 - type: int

  • param linedash2:
    • default: 10 - type: int

  • param lineinterpolation:
    • default: linear - optional - in: (‘linear’, ‘smooth’, ‘stepBefore’, ‘stepAfter’)

  • param linestyle:
    • default: solid - optional - in: (‘solid’, ‘dash’, ‘dot’)

  • param pointsize:
    • default: 5 - type: int

  • param scaletype:
    • default: linear - optional - in: (‘linear’, ‘log’)

  • param scalelog:
    • default: 2 - optional - in: (2, 10)

  • param showpoints:
    • default: never - optional - in: (‘auto’, ‘always’, ‘never’)

  • param spannulls:
    • default: True - type: bool

  • param stackingmode:
    • default: none - in: (‘none’, ‘normal’, ‘percent’)

  • param stackinggroup:
    • default: A - type: str

  • param thresholdsstyle:
    • default: off - in: (‘off’, ‘line’, ‘area’, ‘line+area’)

getJson(customjson={}, dashboard=None, panel=None)[source]

Create the json to pack this panel.

Parameters:

customjson (dict) – custom or child class json code to add

Returns:

dict – panel json code

loglevel: int = 15
grafanacode.plugins.panel_timeseries.extractPanel_timeseries(dset, pset)[source]

Extract a panel exported from Grafana to a piece of Python code to be used by this module

Parameters:
  • dset (dict) – dict with dashboard settings and json to extract (is input and output)

  • pset (dict) – dict with panel settings and json to extract (is input and output)

Returns:

boolean – True