Documentation ¶
Index ¶
- type AlertNotification
- type Client
- func (c *Client) AddOrgUser(orgId int64, user, role string) error
- func (c *Client) AddTeam(name string, email string) error
- func (c *Client) AddTeamMember(id int64, userId int64) error
- func (c *Client) AlertNotification(id int64) (*AlertNotification, error)
- func (c *Client) AlertNotifications() ([]AlertNotification, error)
- func (c *Client) CreateUser(user User) (int64, error)
- func (c *Client) Dashboard(slug string) (*Dashboard, error)deprecated
- func (c *Client) DashboardByUID(uid string) (*Dashboard, error)
- func (c *Client) Dashboards() ([]DashboardSearchResponse, error)
- func (c *Client) DataSource(id int64) (*DataSource, error)
- func (c *Client) DeleteAlertNotification(id int64) error
- func (c *Client) DeleteDashboard(slug string) errordeprecated
- func (c *Client) DeleteDashboardByUID(uid string) error
- func (c *Client) DeleteDataSource(id int64) error
- func (c *Client) DeleteFolder(id string) error
- func (c *Client) DeleteOrg(id int64) error
- func (c *Client) DeletePlaylist(id int) error
- func (c *Client) DeleteTeam(id int64) error
- func (c *Client) DeleteUser(id int64) error
- func (c *Client) Folder(id int64) (*Folder, error)
- func (c *Client) Folders() ([]Folder, error)
- func (c *Client) NewAlertNotification(a *AlertNotification) (int64, error)
- func (c *Client) NewDashboard(dashboard Dashboard) (*DashboardSaveResponse, error)
- func (c *Client) NewDataSource(s *DataSource) (int64, error)
- func (c *Client) NewFolder(title string) (Folder, error)
- func (c *Client) NewOrg(name string) (int64, error)
- func (c *Client) NewPlaylist(playlist Playlist) (int, error)
- func (c *Client) Org(id int64) (Org, error)
- func (c *Client) OrgByName(name string) (Org, error)
- func (c *Client) OrgUsers(orgId int64) ([]OrgUser, error)
- func (c *Client) Orgs() ([]Org, error)
- func (c *Client) Playlist(id int) (*Playlist, error)
- func (c *Client) RemoveMemberFromTeam(id int64, userId int64) error
- func (c *Client) RemoveOrgUser(orgId, userId int64) error
- func (c *Client) SaveDashboard(model map[string]interface{}, overwrite bool) (*DashboardSaveResponse, error)deprecated
- func (c *Client) SearchTeam(query string) (*SearchTeam, error)
- func (c *Client) Team(id int64) (*Team, error)
- func (c *Client) TeamMembers(id int64) ([]*TeamMember, error)
- func (c *Client) TeamPreferences(id int64) (*Preferences, error)
- func (c *Client) UpdateAlertNotification(a *AlertNotification) error
- func (c *Client) UpdateDataSource(s *DataSource) error
- func (c *Client) UpdateFolder(id string, name string) error
- func (c *Client) UpdateOrg(id int64, name string) error
- func (c *Client) UpdateOrgUser(orgId, userId int64, role string) error
- func (c *Client) UpdatePlaylist(playlist Playlist) error
- func (c *Client) UpdateTeam(id int64, name string, email string) error
- func (c *Client) UpdateTeamPreferences(id int64, theme string, homeDashboardId int64, timezone string) error
- func (c *Client) UserByEmail(email string) (User, error)
- func (c *Client) Users() ([]User, error)
- type Dashboard
- type DashboardMeta
- type DashboardSaveResponse
- type DashboardSearchResponse
- type DataSource
- type Folder
- type JSONData
- type Org
- type OrgUser
- type Playlist
- type PlaylistItem
- type Preferences
- type SearchTeam
- type SecureJSONData
- type Team
- type TeamMember
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertNotification ¶
type AlertNotification struct { Id int64 `json:"id,omitempty"` Uid string `json:"uid"` Name string `json:"name"` Type string `json:"type"` IsDefault bool `json:"isDefault"` DisableResolveMessage bool `json:"disableResolveMessage"` SendReminder bool `json:"sendReminder"` Frequency string `json:"frequency"` Settings interface{} `json:"settings"` }
type Client ¶
func New ¶
New creates a new grafana client auth can be in user:pass format, or it can be an api key
func (*Client) AddTeam ¶ added in v0.5.0
AddTeam makes a new team email arg is an optional value. If you don't want to set email, please set "" (empty string).
func (*Client) AddTeamMember ¶ added in v0.5.0
func (*Client) AlertNotification ¶
func (c *Client) AlertNotification(id int64) (*AlertNotification, error)
func (*Client) AlertNotifications ¶ added in v0.2.0
func (c *Client) AlertNotifications() ([]AlertNotification, error)
func (*Client) DashboardByUID ¶ added in v0.3.0
func (*Client) Dashboards ¶ added in v0.5.0
func (c *Client) Dashboards() ([]DashboardSearchResponse, error)
func (*Client) DataSource ¶
func (c *Client) DataSource(id int64) (*DataSource, error)
func (*Client) DeleteAlertNotification ¶
func (*Client) DeleteDashboard
deprecated
func (*Client) DeleteDashboardByUID ¶ added in v0.3.0
func (*Client) DeleteDataSource ¶
func (*Client) DeleteFolder ¶
func (*Client) DeletePlaylist ¶ added in v0.5.0
func (*Client) DeleteTeam ¶ added in v0.5.0
func (*Client) DeleteUser ¶
func (*Client) NewAlertNotification ¶
func (c *Client) NewAlertNotification(a *AlertNotification) (int64, error)
func (*Client) NewDashboard ¶
func (c *Client) NewDashboard(dashboard Dashboard) (*DashboardSaveResponse, error)
func (*Client) NewDataSource ¶
func (c *Client) NewDataSource(s *DataSource) (int64, error)
func (*Client) NewPlaylist ¶ added in v0.5.0
func (*Client) RemoveMemberFromTeam ¶ added in v0.5.0
func (*Client) RemoveOrgUser ¶
func (*Client) SaveDashboard
deprecated
func (c *Client) SaveDashboard(model map[string]interface{}, overwrite bool) (*DashboardSaveResponse, error)
Deprecated: use NewDashboard instead
func (*Client) SearchTeam ¶ added in v0.5.0
func (c *Client) SearchTeam(query string) (*SearchTeam, error)
func (*Client) TeamMembers ¶ added in v0.5.0
func (c *Client) TeamMembers(id int64) ([]*TeamMember, error)
func (*Client) TeamPreferences ¶ added in v0.5.0
func (c *Client) TeamPreferences(id int64) (*Preferences, error)
func (*Client) UpdateAlertNotification ¶
func (c *Client) UpdateAlertNotification(a *AlertNotification) error
func (*Client) UpdateDataSource ¶
func (c *Client) UpdateDataSource(s *DataSource) error
func (*Client) UpdateOrgUser ¶
func (*Client) UpdatePlaylist ¶ added in v0.5.0
func (*Client) UpdateTeam ¶ added in v0.5.0
func (*Client) UpdateTeamPreferences ¶ added in v0.5.0
type Dashboard ¶
type Dashboard struct { Meta DashboardMeta `json:"meta"` Model map[string]interface{} `json:"dashboard"` Folder int64 `json:"folderId"` Overwrite bool `json:"overwrite"` }
type DashboardMeta ¶
type DashboardSaveResponse ¶
type DashboardSearchResponse ¶ added in v0.5.0
type DashboardSearchResponse struct { Id uint `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"` FolderId uint `json:"folderId"` FolderUid string `json:"folderUid"` FolderTitle string `json:"folderTitle"` FolderUrl string `json:"folderUrl"` }
type DataSource ¶
type DataSource struct { Id int64 `json:"id,omitempty"` Name string `json:"name"` Type string `json:"type"` URL string `json:"url"` Access string `json:"access"` Database string `json:"database,omitempty"` User string `json:"user,omitempty"` // Deprecated in favor of secureJsonData.password Password string `json:"password,omitempty"` OrgId int64 `json:"orgId,omitempty"` IsDefault bool `json:"isDefault"` BasicAuth bool `json:"basicAuth"` BasicAuthUser string `json:"basicAuthUser,omitempty"` // Deprecated in favor of secureJsonData.basicAuthPassword BasicAuthPassword string `json:"basicAuthPassword,omitempty"` JSONData JSONData `json:"jsonData,omitempty"` SecureJSONData SecureJSONData `json:"secureJsonData,omitempty"` }
type JSONData ¶
type JSONData struct { // Used by all datasources TlsAuth bool `json:"tlsAuth,omitempty"` TlsAuthWithCACert bool `json:"tlsAuthWithCACert,omitempty"` TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"` // Used by Graphite GraphiteVersion string `json:"graphiteVersion,omitempty"` // Used by Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL TimeInterval string `json:"timeInterval,omitempty"` // Used by Elasticsearch EsVersion int64 `json:"esVersion,omitempty"` TimeField string `json:"timeField,omitempty"` Interval string `json:"inteval,omitempty"` LogMessageField string `json:"logMessageField,omitempty"` LogLevelField string `json:"logLevelField,omitempty"` // Used by Cloudwatch AuthType string `json:"authType,omitempty"` AssumeRoleArn string `json:"assumeRoleArn,omitempty"` DefaultRegion string `json:"defaultRegion,omitempty"` CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"` // Used by OpenTSDB TsdbVersion string `json:"tsdbVersion,omitempty"` TsdbResolution string `json:"tsdbResolution,omitempty"` // Used by MSSQL Encrypt string `json:"encrypt,omitempty"` // Used by PostgreSQL Sslmode string `json:"sslmode,omitempty"` PostgresVersion int64 `json:"postgresVersion,omitempty"` Timescaledb bool `json:"timescaledb,omitempty"` // Used by MySQL, PostgreSQL and MSSQL MaxOpenConns int64 `json:"maxOpenConns,omitempty"` MaxIdleConns int64 `json:"maxIdleConns,omitempty"` ConnMaxLifetime int64 `json:"connMaxLifetime,omitempty"` // Used by Prometheus HttpMethod string `json:"httpMethod,omitempty"` QueryTimeout string `json:"queryTimeout,omitempty"` // Used by Stackdriver AuthenticationType string `json:"authenticationType,omitempty"` ClientEmail string `json:"clientEmail,omitempty"` DefaultProject string `json:"defaultProject,omitempty"` TokenUri string `json:"tokenUri,omitempty"` }
JSONData is a representation of the datasource `jsonData` property
type Playlist ¶ added in v0.5.0
type Playlist struct { Id int `json:"id"` Name string `json:"name"` Interval string `json:"interval"` Items []PlaylistItem `json:"items"` }
type PlaylistItem ¶ added in v0.5.0
type Preferences ¶ added in v0.5.0
type SearchTeam ¶ added in v0.5.0
type SecureJSONData ¶
type SecureJSONData struct { // Used by all datasources TlsCACert string `json:"tlsCACert,omitempty"` TlsClientCert string `json:"tlsClientCert,omitempty"` TlsClientKey string `json:"tlsClientKey,omitempty"` Password string `json:"password,omitempty"` BasicAuthPassword string `json:"basicAuthPassword,omitempty"` // Used by Cloudwatch AccessKey string `json:"accessKey,omitempty"` SecretKey string `json:"secretKey,omitempty"` // Used by Stackdriver PrivateKey string `json:"privateKey,omitempty"` }
SecureJSONData is a representation of the datasource `secureJsonData` property
type Team ¶ added in v0.5.0
type Team struct { Id int64 `json:"id,omitempty"` OrgId int64 `json:"orgId,omitempty"` Name string `json:"name"` Email string `json:"email,omitempty"` AvatarUrl string `json:"avatarUrl,omitempty"` MemberCount int64 `json:"memberCount,omitempty"` Permission int64 `json:"permission,omitempty"` }
Team consists of a get response It's used in Add and Update API
type TeamMember ¶ added in v0.5.0
type TeamMember struct { OrgId int64 `json:"orgId,omitempty"` TeamId int64 `json:"teamId,omitempty"` UserId int64 `json:"userId,omitempty"` Email string `json:"email,omitempty"` Login string `json:"login,omitempty"` AvatarUrl string `json:"avatarUrl,omitempty"` Permission int64 `json:"permission,omitempty"` }
TeamMember
Click to show internal directories.
Click to hide internal directories.