Documentation ¶
Index ¶
- func ParseRFC3339TimeString(ts string) (time.Time, error)
- type Annotation
- type Client
- func (c Client) AnnotationCreate(dashboardID, panelID uint64, from, to time.Time, text string, tag ...string) error
- func (c Client) AnnotationDelete(id uint64) error
- func (c Client) AnnotationList(dashboardID uint64, from, to time.Time) ([]Annotation, error)
- func (c Client) DashboardDelete(uid string) error
- func (c Client) DashboardExport(fpath, uid string) error
- func (c Client) DashboardImport(fpath string, folderid uint64) error
- func (c Client) DashboardList() ([]Dashboard, error)
- func (c Client) DashboardPanelList(uid string) ([]Panel, error)
- func (c Client) DataSourceDelete(name string) error
- func (c Client) DataSourceExport(name, fpath string) error
- func (c Client) DataSourceImport(name, fpath string) error
- func (c Client) DataSourceList() ([]DataSource, error)
- func (c Client) Delete(uri string) (*resty.Response, error)
- func (c Client) FolderCreate(name string) error
- func (c Client) FolderDelete(uid string) error
- func (c Client) FolderList() ([]Folder, error)
- func (c Client) Get(uri string, params map[string]string) (*resty.Response, error)
- func (c Client) Login() error
- func (c Client) Post(uri string, payload map[string]interface{}) (*resty.Response, error)
- func (c Client) SnapshotDelete(key string) error
- func (c Client) SnapshotExport(key, fpath string) error
- func (c Client) SnapshotList() ([]Snapshot, error)
- type Dashboard
- type DataSource
- type Folder
- type Panel
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Annotation ¶
type Annotation struct { ID uint64 `json:"id"` AlertID uint64 `json:"alertId"` AlertName string `json:"alertName"` DashboardID uint64 `json:"dashboardId"` PanelID uint64 `json:"panelId"` UserID uint64 `json:"userId"` NewState string `json:"newState"` PrevState string `json:"prevState"` Created uint64 `json:"created"` Updated uint64 `json:"updated"` Time uint64 `json:"time"` TimeEnd uint64 `json:"timeEnd"` Text string `json:"text"` Tags []string `json:"tags"` Login string `json:"login"` Email string `json:"email"` AvatarURL string `json:"avatarUrl"` Data map[string]interface{} `json:"data"` }
Annotation object
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client HTTP client
func (Client) AnnotationCreate ¶
func (c Client) AnnotationCreate(dashboardID, panelID uint64, from, to time.Time, text string, tag ...string) error
AnnotationCreate create an annotation
func (Client) AnnotationDelete ¶
AnnotationDelete delete an annotation
func (Client) AnnotationList ¶
AnnotationList list annotations for a dashboard Limitation - only 100 (default) annotations can be gotten for specified time period
func (Client) DashboardDelete ¶
DashboardDelete delete a dashboard
func (Client) DashboardExport ¶
DashboardExport export a dashboard
func (Client) DashboardImport ¶
DashboardImport import a dashboard
func (Client) DashboardList ¶
DashboardList list dashboards
func (Client) DashboardPanelList ¶
DashboardPanelList list panels of a dashboard
func (Client) DataSourceDelete ¶
DataSourceDelete delete a data source
func (Client) DataSourceExport ¶
DataSourceExport export a data source
func (Client) DataSourceImport ¶
DataSourceImport import a data source
func (Client) DataSourceList ¶
func (c Client) DataSourceList() ([]DataSource, error)
DataSourceList list data sources
func (Client) FolderCreate ¶
FolderCreate create a folder
func (Client) FolderDelete ¶
FolderDelete delete a folder
func (Client) SnapshotDelete ¶
SnapshotDelete delete a snapshot
func (Client) SnapshotExport ¶
SnapshotExport export an existing snapshot as a file which can be imported as a dashboard by calling DashboardImport
func (Client) SnapshotList ¶
SnapshotList list snapshots
type Dashboard ¶
type Dashboard struct { ID uint64 `json:"id"` UID string `json:"uid"` Title string `json:"title"` URL string `json:"url"` Type string `json:"type"` Tags []string `json:"tags"` IsStarred bool `json:"isStarred"` URI string `json:"uri"` Slug string `json:"slug"` FolderID uint64 `json:"folderId"` FolderUID string `json:"folderUid"` FolderTitle string `json:"folderTitle"` FolderURL string `json:"folderUrl"` }
Dashboard object definition
type DataSource ¶
type DataSource struct { ID uint64 `json:"id"` OrgID uint64 `json:"orgId"` Name string `json:"name"` Type string `json:"type"` TypeLogoURL string `json:"typeLogoUrl"` Access string `json:"access"` URL string `json:"url"` Password string `json:"password"` User string `json:"User"` Database string `json:"database"` BasicAuth bool `json:"basicAuth"` IsDefault bool `json:"isDefault"` JSONData map[string]interface{} `json:"jsonData"` ReadOnly bool `json:"readOnly"` }
DataSource object
type Folder ¶
type Folder struct { ID uint64 `json:"id"` UID string `json:"uid"` Title string `json:"title"` URI string `json:"uri"` URL string `json:"url"` Slug string `json:"slug"` Type string `json:"type"` Tags []string `json:"tags"` IsStarred bool `json:"isStarred"` }
Folder object
type Snapshot ¶
type Snapshot struct { ID int64 `json:"id"` Name string `json:"name"` Key string `json:"key"` OrgID int64 `json:"orgId"` UserID int64 `json:"userId"` External bool `json:"external"` ExternalURL string `json:"externalUrl"` Expires time.Time `json:"expires"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
Snapshot object