Documentation ¶
Index ¶
- Constants
- Variables
- type Annotations
- type Client
- func (c *Client) CreateLibraryPanel(panel *Panel, folderUID string) (*PanelLibraryResponse, error)
- func (c *Client) DeleteLibraryPanel(uid string) (int64, error)
- func (c *Client) GetLibraryPanelByUID(uid string) (*PanelLibraryResponse, error)
- func (c *Client) SaveDashboard(d *Dashboard) error
- func (c *Client) SaveLibraryPanel(panel *Panel, folderUID string) (*PanelLibraryResponse, error)
- func (c *Client) UpdateLibraryPanel(panel *Panel, id int, version int, folderUID string) (*PanelLibraryResponse, error)
- type Current
- type Dashboard
- type DashboardOptions
- type Datasource
- type DatasourceType
- type FieldConfig
- type GetLibraryPanelsResponse
- type GridPos
- type LibraryPanel
- type Panel
- type PanelColor
- type PanelCustom
- func (c PanelCustom) SetAxisCenteredZero(val bool) PanelCustom
- func (c PanelCustom) SetAxisColorMode(val string) PanelCustom
- func (c PanelCustom) SetAxisPlacement(val string) PanelCustom
- func (c PanelCustom) SetBarAlignment(val int) PanelCustom
- func (c PanelCustom) SetDrawStyle(val string) PanelCustom
- func (c PanelCustom) SetFillOpacity(val int) PanelCustom
- func (c PanelCustom) SetGradientMode(val string) PanelCustom
- func (c PanelCustom) SetLineInterpolation(val string) PanelCustom
- func (c PanelCustom) SetLineWidth(val int) PanelCustom
- func (c PanelCustom) SetPointSize(val int) PanelCustom
- func (c PanelCustom) SetScaleDistribution(val ScaleDistributionType) PanelCustom
- func (c PanelCustom) SetShowPoints(val string) PanelCustom
- func (c PanelCustom) SetSpanNulls(val bool) PanelCustom
- func (c PanelCustom) SetStacking(val StackingMode) PanelCustom
- type PanelDefaults
- type PanelLegend
- type PanelLibraryResponse
- type PanelOptions
- type PanelTooltip
- type PanelType
- type Panels
- type SaveDashboardRequest
- type SaveDashboardResponse
- type SaveLibraryPanelRequest
- type ScaleDistributionType
- type StackingMode
- type Target
- type TargetFormat
- type Templating
- type Time
- type Timepicker
- type UnitType
- type Variable
Constants ¶
View Source
const ( ScaleDistributionTypeLinear ScaleDistributionType = "linear" StackingModeNone StackingMode = "none" )
View Source
const ( TargetFormatTimeSeries = "time_series" TargetFormatHeatmap = "heatmap" )
View Source
const (
DatasourceTypePrometheus = "prometheus"
)
View Source
const (
DrawStyle = "drawStyle"
)
View Source
const SchemaVersion = 37
Variables ¶
View Source
var ( DefaultGrid = &GridPos{ H: 8, W: 12, } DefaultColorMod = "palette-classic" DefaultDrawStyle = "line" )
Functions ¶
This section is empty.
Types ¶
type Annotations ¶
type Annotations struct {
List []interface{} `json:"list,omitempty" yaml:"list"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateLibraryPanel ¶
func (c *Client) CreateLibraryPanel(panel *Panel, folderUID string) (*PanelLibraryResponse, error)
func (*Client) GetLibraryPanelByUID ¶
func (c *Client) GetLibraryPanelByUID(uid string) (*PanelLibraryResponse, error)
func (*Client) SaveDashboard ¶
func (*Client) SaveLibraryPanel ¶
func (c *Client) SaveLibraryPanel(panel *Panel, folderUID string) (*PanelLibraryResponse, error)
func (*Client) UpdateLibraryPanel ¶
type Dashboard ¶
type Dashboard struct { ID int64 `json:"id,omitempty" yaml:"id"` UID string `json:"uid,omitempty" yaml:"uid"` Title string `json:"title,omitempty" yaml:"title"` Tags []string `json:"tags,omitempty" yaml:"tags"` Style string `json:"style,omitempty" yaml:"style"` Timezone string `json:"timezone,omitempty" yaml:"timezone"` Editable bool `json:"editable,omitempty" yaml:"editable"` GraphTooltip int `json:"graphTooltip,omitempty" yaml:"graphTooltip"` Panels []*Panel `json:"panels,omitempty" yaml:"panels"` Time *Time `json:"time,omitempty" yaml:"time"` Timepicker *Timepicker `json:"timepicker,omitempty" yaml:"timepicker"` Templating *Templating `json:"templating,omitempty" yaml:"templating"` Annotations *Annotations `json:"annotations,omitempty" yaml:"annotations"` Refresh string `json:"refresh,omitempty" yaml:"refresh"` SchemaVersion int `json:"schemaVersion,omitempty" yaml:"schemaVersion"` Version int `json:"version,omitempty" yaml:"version"` Links []interface{} `json:"links,omitempty" yaml:"links"` }
func NewDashboard ¶
type DashboardOptions ¶
type Datasource ¶
func NewDatasource ¶
func NewDatasource(dsType string, uid string) *Datasource
func (Datasource) NewTarget ¶
func (d Datasource) NewTarget(expr, legend string) *Target
type DatasourceType ¶
type DatasourceType string
type FieldConfig ¶
type FieldConfig struct { Defaults PanelDefaults `json:"defaults,omitempty" yaml:"defaults"` Overrides []any `json:"overrides,omitempty" yaml:"overrides"` }
type LibraryPanel ¶
type Panel ¶
type Panel struct { ID int `json:"id,omitempty" yaml:"id"` UID string `json:"uid,omitempty" yaml:"uid"` Type PanelType `json:"type,omitempty" yaml:"type"` Title string `json:"title,omitempty" yaml:"title"` Description string `json:"description,omitempty" yaml:"description"` GridPos *GridPos `json:"gridPos,omitempty" yaml:"gridPos"` Repeat string `json:"repeat,omitempty" yaml:"repeat"` RepeatDirection string `json:"repeatDirection,omitempty" yaml:"repeatDirection"` MaxPerRow int `json:"maxPerRow,omitempty" yaml:"maxPerRow"` Mode string `json:"mode,omitempty" yaml:"mode"` Content string `json:"content,omitempty" yaml:"content"` Targets []*Target `json:"targets,omitempty" yaml:"targets"` Options map[string]any `json:"options,omitempty" yaml:"options"` FieldConfig FieldConfig `json:"fieldConfig,omitempty" yaml:"fieldConfig"` Datasource Datasource `json:"datasource,omitempty" yaml:"datasource"` }
func NewRowPanel ¶
type PanelColor ¶
type PanelColor struct {
Mode string `json:"mode" yaml:"mode"`
}
type PanelCustom ¶
func (PanelCustom) SetAxisCenteredZero ¶
func (c PanelCustom) SetAxisCenteredZero(val bool) PanelCustom
func (PanelCustom) SetAxisColorMode ¶
func (c PanelCustom) SetAxisColorMode(val string) PanelCustom
func (PanelCustom) SetAxisPlacement ¶
func (c PanelCustom) SetAxisPlacement(val string) PanelCustom
func (PanelCustom) SetBarAlignment ¶
func (c PanelCustom) SetBarAlignment(val int) PanelCustom
func (PanelCustom) SetDrawStyle ¶
func (c PanelCustom) SetDrawStyle(val string) PanelCustom
func (PanelCustom) SetFillOpacity ¶
func (c PanelCustom) SetFillOpacity(val int) PanelCustom
func (PanelCustom) SetGradientMode ¶
func (c PanelCustom) SetGradientMode(val string) PanelCustom
func (PanelCustom) SetLineInterpolation ¶
func (c PanelCustom) SetLineInterpolation(val string) PanelCustom
func (PanelCustom) SetLineWidth ¶
func (c PanelCustom) SetLineWidth(val int) PanelCustom
func (PanelCustom) SetPointSize ¶
func (c PanelCustom) SetPointSize(val int) PanelCustom
func (PanelCustom) SetScaleDistribution ¶
func (c PanelCustom) SetScaleDistribution(val ScaleDistributionType) PanelCustom
func (PanelCustom) SetShowPoints ¶
func (c PanelCustom) SetShowPoints(val string) PanelCustom
func (PanelCustom) SetSpanNulls ¶
func (c PanelCustom) SetSpanNulls(val bool) PanelCustom
func (PanelCustom) SetStacking ¶
func (c PanelCustom) SetStacking(val StackingMode) PanelCustom
type PanelDefaults ¶
type PanelDefaults struct { Color PanelColor `json:"color,omitempty" yaml:"color"` Custom PanelCustom `json:"custom,omitempty" yaml:"custom"` Unit string `json:"unit,omitempty" yaml:"unit"` }
type PanelLegend ¶
type PanelLibraryResponse ¶
type PanelLibraryResponse struct { Result struct { Id int `json:"id"` OrgId int `json:"orgId"` FolderId int `json:"folderId"` FolderUid string `json:"folderUid"` Uid string `json:"uid"` Name string `json:"name"` Kind int `json:"kind"` Type string `json:"type"` Description string `json:"description"` Model any `json:"model"` Version int `json:"version"` Meta struct { FolderName string `json:"folderName"` FolderUid string `json:"folderUid"` ConnectedDashboards int `json:"connectedDashboards"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` CreatedBy struct { Id int `json:"id"` Name string `json:"name"` AvatarUrl string `json:"avatarUrl"` } `json:"createdBy"` UpdatedBy struct { Id int `json:"id"` Name string `json:"name"` AvatarUrl string `json:"avatarUrl"` } `json:"updatedBy"` } `json:"meta"` } `json:"result"` }
type PanelOptions ¶
type PanelOptions struct { Legend PanelLegend `json:"legend,omitempty" yaml:"legend"` Tooltip PanelTooltip `json:"tooltip,omitempty" yaml:"tooltip"` }
type PanelTooltip ¶
type Panels ¶
type Panels struct { Datasource struct { Type string `json:"type"` Uid string `json:"uid"` } `json:"datasource"` Description string `json:"description"` FieldConfig struct { Defaults struct { Color struct { Mode string `json:"mode"` } `json:"color"` Custom struct { AxisCenteredZero bool `json:"axisCenteredZero"` AxisColorMode string `json:"axisColorMode"` AxisLabel string `json:"axisLabel"` AxisPlacement string `json:"axisPlacement"` BarAlignment int `json:"barAlignment"` DrawStyle string `json:"DrawStyle"` FillOpacity int `json:"fillOpacity"` GradientMode string `json:"gradientMode"` HideFrom struct { Legend bool `json:"legend"` Tooltip bool `json:"tooltip"` Viz bool `json:"viz"` } `json:"hideFrom"` LineInterpolation string `json:"lineInterpolation"` LineWidth int `json:"lineWidth"` PointSize int `json:"pointSize"` ScaleDistribution struct { Type string `json:"type"` } `json:"scaleDistribution"` ShowPoints string `json:"showPoints"` SpanNulls bool `json:"spanNulls"` Stacking struct { Group string `json:"group"` Mode string `json:"mode"` } `json:"stacking"` ThresholdsStyle struct { Mode string `json:"mode"` } `json:"thresholdsStyle"` } `json:"custom"` Mappings []interface{} `json:"mappings"` Thresholds struct { Mode string `json:"mode"` Steps []struct { Color string `json:"color"` Value *int `json:"value"` } `json:"steps"` } `json:"thresholds"` } `json:"defaults"` Overrides []interface{} `json:"overrides"` } `json:"fieldConfig"` GridPos struct { H int `json:"h"` W int `json:"w"` X int `json:"x"` Y int `json:"y"` } `json:"gridPos"` Id int `json:"id"` LibraryPanel struct { Name string `json:"name"` Uid string `json:"uid"` } `json:"libraryPanel"` Options struct { Legend struct { Calcs []interface{} `json:"calcs"` DisplayMode string `json:"displayMode"` Placement string `json:"placement"` ShowLegend bool `json:"showLegend"` } `json:"legend"` Tooltip struct { Mode string `json:"mode"` Sort string `json:"sort"` } `json:"tooltip"` } `json:"options"` Targets []struct { Datasource struct { Type string `json:"type"` Uid string `json:"uid"` } `json:"datasource"` EditorMode string `json:"editorMode"` Expr string `json:"expr"` LegendFormat string `json:"legendFormat"` Range bool `json:"range"` RefId string `json:"refId"` } `json:"targets"` Title string `json:"title"` Type string `json:"type"` }
type SaveDashboardRequest ¶
type SaveDashboardResponse ¶
type SaveLibraryPanelRequest ¶
type ScaleDistributionType ¶
type ScaleDistributionType string
type StackingMode ¶
type StackingMode string
type Target ¶
type Target struct { Datasource Datasource `json:"datasource" yaml:"datasource"` EditorMode string `json:"editorMode" yaml:"editorMode"` Expr string `json:"expr" yaml:"expr"` LegendFormat string `json:"legendFormat" yaml:"legendFormat"` Format TargetFormat `json:"format,omitempty" yaml:"format"` Range bool `json:"range" yaml:"range"` RefId string `json:"refId" yaml:"refId"` }
type TargetFormat ¶
type TargetFormat string
type Templating ¶
type Timepicker ¶
type Timepicker struct { TimeOptions []interface{} `json:"time_options,omitempty" yaml:"time_options"` RefreshIntervals []string `json:"refresh_intervals,omitempty" yaml:"refresh_intervals"` Collapse bool `json:"collapse,omitempty" yaml:"collapse"` Enable bool `json:"enable,omitempty" yaml:"enable"` Notice bool `json:"notice,omitempty" yaml:"notice"` Now bool `json:"now,omitempty" yaml:"now"` Status string `json:"status,omitempty" yaml:"status"` Type string `json:"type,omitempty" yaml:"type"` }
type Variable ¶
type Variable struct { AllFormat string `json:"allFormat,omitempty" yaml:"allFormat"` Current Current `json:"current,omitempty" yaml:"current"` Datasource interface{} `json:"datasource,omitempty" yaml:"datasource"` IncludeAll bool `json:"includeAll,omitempty" yaml:"includeAll"` Name string `json:"name,omitempty" yaml:"name"` Options []DashboardOptions `json:"options,omitempty" yaml:"options"` Query string `json:"query,omitempty" yaml:"query"` Refresh bool `json:"refresh,omitempty" yaml:"refresh"` Type string `json:"type,omitempty" yaml:"type"` Multi bool `json:"multi,omitempty" yaml:"multi"` MultiFormat string `json:"multiFormat,omitempty" yaml:"multiFormat"` Regex string `json:"regex,omitempty" yaml:"regex"` }
Click to show internal directories.
Click to hide internal directories.