Documentation ¶
Index ¶
- func AsInt64(value interface{}) int64
- func CompareMap(desired map[string]interface{}, actual map[string]interface{}) (bool, error)
- func CompareMapKeys[T1, T2 comparable](desired map[string]T1, actual map[string]T2) bool
- func CompareOptional[K comparable](desired *K, actual K, defaultValue K) bool
- func CompareSlice(desired []interface{}, actual []interface{}) (bool, error)
- func DefaultBool(b *bool, def bool) bool
- func DefaultString(s *string, def string) string
- func JsonDataWithHeaders(inputJSONData map[string]interface{}, inputSecureJSONData map[string]string, ...) (map[string]interface{}, map[string]string)
- func SecretToStringMap(secret *kubeV1.Secret) map[string]string
- type ApiError
- type ApiResponse
- type GrafanaAPI
- func (g *GrafanaAPI) AddOrgUser(orgID int64, user *models.AddOrgUserCommand) (*models.SuccessResponseBody, error)
- func (g *GrafanaAPI) AdminCreateUser(user *models.AdminCreateUserForm) (*models.AdminCreateUserResponse, error)
- func (g *GrafanaAPI) CreateDataSource(orgId int64, command *models.AddDataSourceCommand) (*models.AddDataSourceOKBody, error)
- func (g *GrafanaAPI) CreateFolder(orgId int64, command *models.CreateFolderCommand) (*models.Folder, error)
- func (g *GrafanaAPI) CreateOrUpdateDashboard(orgId int64, command *models.SaveDashboardCommand) (*models.PostDashboardOKBody, error)
- func (g *GrafanaAPI) CreateOrg(name string) (*models.CreateOrgOKBody, error)
- func (g *GrafanaAPI) CreateUser(user string) (int64, error)
- func (g *GrafanaAPI) DeleteDashboard(orgId int64, uid string) (*models.DeleteDashboardByUIDOKBody, error)
- func (g *GrafanaAPI) DeleteDataSource(orgId int64, id string) (*models.SuccessResponseBody, error)
- func (g *GrafanaAPI) DeleteFolder(orgId int64, uid string) (*models.DeleteFolderOKBody, error)
- func (g *GrafanaAPI) DeleteOrgByID(orgID int64) (*models.SuccessResponseBody, error)
- func (g *GrafanaAPI) GetAllOrgs() ([]*models.OrgDTO, error)
- func (g *GrafanaAPI) GetAllUsers() ([]*models.UserSearchHitDTO, error)
- func (g *GrafanaAPI) GetDashboardByName(orgId int64, name string, folder *string) (*models.DashboardFullWithMeta, error)
- func (g *GrafanaAPI) GetDashboardByUid(orgId int64, uid string) (*models.DashboardFullWithMeta, error)
- func (g *GrafanaAPI) GetDataSourceById(orgId int64, id string) (*models.DataSource, error)
- func (g *GrafanaAPI) GetDataSourceByName(orgId int64, name string) (*models.DataSource, error)
- func (g *GrafanaAPI) GetFolderById(orgId int64, id int64) (*models.Folder, error)
- func (g *GrafanaAPI) GetFolderByName(orgId int64, name string, parentFolder *string) (*models.Folder, error)
- func (g *GrafanaAPI) GetFolderByUid(orgId int64, uid string) (*models.Folder, error)
- func (g *GrafanaAPI) GetOrgById(id int64) (*models.OrgDetailsDTO, error)
- func (g *GrafanaAPI) GetOrgByName(s string) (*models.OrgDetailsDTO, error)
- func (g *GrafanaAPI) GetOrgUsers(orgId int64) ([]*models.OrgUserDTO, error)
- func (g *GrafanaAPI) GetSignedInUser() (*models.UserProfileDTO, error)
- func (g *GrafanaAPI) RemoveOrgUser(userID int64, orgID int64) (*models.SuccessResponseBody, error)
- func (g *GrafanaAPI) SwitchToLowestOrgId() error
- func (g *GrafanaAPI) UpdateDataSource(orgId int64, id string, command *models.UpdateDataSourceCommand) (*models.UpdateDataSourceByIDOKBody, error)
- func (g *GrafanaAPI) UpdateFolder(orgId int64, uid string, command *models.UpdateFolderCommand) (*models.Folder, error)
- func (g *GrafanaAPI) UpdateOrgUser(orgID int64, userID int64, user *models.UpdateOrgUserCommand) (*models.SuccessResponseBody, error)
- func (g *GrafanaAPI) UserSetUsingOrg(orgId int64) (*models.SuccessResponseBody, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareMap ¶
func CompareMapKeys ¶
func CompareMapKeys[T1, T2 comparable](desired map[string]T1, actual map[string]T2) bool
func CompareOptional ¶
func CompareOptional[K comparable](desired *K, actual K, defaultValue K) bool
func CompareSlice ¶ added in v0.0.4
func DefaultString ¶
func JsonDataWithHeaders ¶
Types ¶
type ApiResponse ¶
type GrafanaAPI ¶
type GrafanaAPI struct {
// contains filtered or unexported fields
}
func NewGrafanaAPI ¶
func NewGrafanaAPI(service grafana.GrafanaHTTPAPI) GrafanaAPI
func (*GrafanaAPI) AddOrgUser ¶
func (g *GrafanaAPI) AddOrgUser(orgID int64, user *models.AddOrgUserCommand) (*models.SuccessResponseBody, error)
func (*GrafanaAPI) AdminCreateUser ¶
func (g *GrafanaAPI) AdminCreateUser(user *models.AdminCreateUserForm) (*models.AdminCreateUserResponse, error)
func (*GrafanaAPI) CreateDataSource ¶
func (g *GrafanaAPI) CreateDataSource(orgId int64, command *models.AddDataSourceCommand) (*models.AddDataSourceOKBody, error)
func (*GrafanaAPI) CreateFolder ¶
func (g *GrafanaAPI) CreateFolder(orgId int64, command *models.CreateFolderCommand) (*models.Folder, error)
func (*GrafanaAPI) CreateOrUpdateDashboard ¶
func (g *GrafanaAPI) CreateOrUpdateDashboard(orgId int64, command *models.SaveDashboardCommand) (*models.PostDashboardOKBody, error)
func (*GrafanaAPI) CreateOrg ¶
func (g *GrafanaAPI) CreateOrg(name string) (*models.CreateOrgOKBody, error)
func (*GrafanaAPI) CreateUser ¶
func (g *GrafanaAPI) CreateUser(user string) (int64, error)
func (*GrafanaAPI) DeleteDashboard ¶
func (g *GrafanaAPI) DeleteDashboard(orgId int64, uid string) (*models.DeleteDashboardByUIDOKBody, error)
func (*GrafanaAPI) DeleteDataSource ¶
func (g *GrafanaAPI) DeleteDataSource(orgId int64, id string) (*models.SuccessResponseBody, error)
func (*GrafanaAPI) DeleteFolder ¶
func (g *GrafanaAPI) DeleteFolder(orgId int64, uid string) (*models.DeleteFolderOKBody, error)
func (*GrafanaAPI) DeleteOrgByID ¶
func (g *GrafanaAPI) DeleteOrgByID(orgID int64) (*models.SuccessResponseBody, error)
func (*GrafanaAPI) GetAllOrgs ¶
func (g *GrafanaAPI) GetAllOrgs() ([]*models.OrgDTO, error)
func (*GrafanaAPI) GetAllUsers ¶
func (g *GrafanaAPI) GetAllUsers() ([]*models.UserSearchHitDTO, error)
func (*GrafanaAPI) GetDashboardByName ¶
func (g *GrafanaAPI) GetDashboardByName(orgId int64, name string, folder *string) (*models.DashboardFullWithMeta, error)
func (*GrafanaAPI) GetDashboardByUid ¶
func (g *GrafanaAPI) GetDashboardByUid(orgId int64, uid string) (*models.DashboardFullWithMeta, error)
func (*GrafanaAPI) GetDataSourceById ¶
func (g *GrafanaAPI) GetDataSourceById(orgId int64, id string) (*models.DataSource, error)
func (*GrafanaAPI) GetDataSourceByName ¶
func (g *GrafanaAPI) GetDataSourceByName(orgId int64, name string) (*models.DataSource, error)
func (*GrafanaAPI) GetFolderById ¶
func (*GrafanaAPI) GetFolderByName ¶
func (*GrafanaAPI) GetFolderByUid ¶
func (*GrafanaAPI) GetOrgById ¶
func (g *GrafanaAPI) GetOrgById(id int64) (*models.OrgDetailsDTO, error)
func (*GrafanaAPI) GetOrgByName ¶
func (g *GrafanaAPI) GetOrgByName(s string) (*models.OrgDetailsDTO, error)
func (*GrafanaAPI) GetOrgUsers ¶
func (g *GrafanaAPI) GetOrgUsers(orgId int64) ([]*models.OrgUserDTO, error)
func (*GrafanaAPI) GetSignedInUser ¶
func (g *GrafanaAPI) GetSignedInUser() (*models.UserProfileDTO, error)
func (*GrafanaAPI) RemoveOrgUser ¶
func (g *GrafanaAPI) RemoveOrgUser(userID int64, orgID int64) (*models.SuccessResponseBody, error)
func (*GrafanaAPI) SwitchToLowestOrgId ¶
func (g *GrafanaAPI) SwitchToLowestOrgId() error
SwitchToLowestOrgId switches the current user's active organization to the one with the lowest ID. It first retrieves all organizations and iterates through them to find the one with the lowest ID. Then, it uses the Grafana API to switch the current user's active organization to the one found. This function is useful in scenarios where the user needs to be in a context that is not the organization being managed, for example, when deleting an organization.
Returns:
error: If an error occurred during the process. It could be due to issues in retrieving all organizations or switching the active organization.
func (*GrafanaAPI) UpdateDataSource ¶
func (g *GrafanaAPI) UpdateDataSource(orgId int64, id string, command *models.UpdateDataSourceCommand) (*models.UpdateDataSourceByIDOKBody, error)
func (*GrafanaAPI) UpdateFolder ¶
func (g *GrafanaAPI) UpdateFolder(orgId int64, uid string, command *models.UpdateFolderCommand) (*models.Folder, error)
func (*GrafanaAPI) UpdateOrgUser ¶
func (g *GrafanaAPI) UpdateOrgUser(orgID int64, userID int64, user *models.UpdateOrgUserCommand) (*models.SuccessResponseBody, error)
func (*GrafanaAPI) UserSetUsingOrg ¶
func (g *GrafanaAPI) UserSetUsingOrg(orgId int64) (*models.SuccessResponseBody, error)
Click to show internal directories.
Click to hide internal directories.