Method: Grafana::Panel#resolve_variable_datasource

Defined in:
lib/grafana/panel.rb

#resolve_variable_datasource(variables) ⇒ Object

This method should always be called before the datasource method of a panel is invoked, to ensure that the variable names in the datasource field are resolved.

Parameters:

  • variables (Hash)

    variables hash, which should be use to resolve variable datasource


39
40
41
# File 'lib/grafana/panel.rb', line 39

def resolve_variable_datasource(variables)
  @datasource_uid_or_name = AbstractDatasource.new(nil).replace_variables(@datasource_uid_or_name, variables, 'raw') if @datasource_uid_or_name.is_a?(String)
end