refactor(grafana): replace dashboard info with import compatible layout

This commit is contained in:
Tom Neuber 2024-07-27 18:53:38 +02:00
parent 4aad919153
commit 577f821b9d
Signed by: tom
GPG key ID: F17EFE4272D89FF6
8 changed files with 173 additions and 110 deletions

View file

@ -19,41 +19,45 @@ type DashboardCreateResponse struct {
Slug string `json:"slug"`
}
type DashboardMeta struct {
IsStarred bool `json:"isStarred"`
Type string `json:"type"`
CanSave bool `json:"canSave"`
CanEdit bool `json:"canEdit"`
CanAdmin bool `json:"canAdmin"`
CanStar bool `json:"canStar"`
CanDelete bool `json:"canDelete"`
Slug string `json:"slug"`
URL string `json:"url"`
Expires time.Time `json:"expires"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
UpdatedBy string `json:"updatedBy"`
CreatedBy string `json:"createdBy"`
Version uint `json:"version"`
HasACL bool `json:"hasAcl"`
IsFolder bool `json:"isFolder"`
FolderID uint `json:"folderId"`
FolderUID string `json:"folderUid"`
FolderTitle string `json:"folderTitle"`
FolderURL string `json:"folderUrl"`
Provisioned bool `json:"provisioned"`
ProvisionedExternalID string `json:"provisionedExternalId"`
AnnotationsPermissions struct {
Dashboard struct {
CanAdd bool `json:"canAdd"`
CanEdit bool `json:"canEdit"`
CanDelete bool `json:"canDelete"`
} `json:"dashboard"`
Organization struct {
CanAdd bool `json:"canAdd"`
CanEdit bool `json:"canEdit"`
CanDelete bool `json:"canDelete"`
} `json:"organization"`
} `json:"annotationsPermissions"`
Dashboard any `json:"dashboard"`
type Dashboard struct {
Meta DashboardMeta `json:"meta"`
Dashboard any `json:"dashboard"`
}
type DashboardMeta struct {
IsStarred bool `json:"isStarred"`
Type string `json:"type"`
CanSave bool `json:"canSave"`
CanEdit bool `json:"canEdit"`
CanAdmin bool `json:"canAdmin"`
CanStar bool `json:"canStar"`
CanDelete bool `json:"canDelete"`
Slug string `json:"slug"`
URL string `json:"url"`
Expires time.Time `json:"expires"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
UpdatedBy string `json:"updatedBy"`
CreatedBy string `json:"createdBy"`
Version uint `json:"version"`
HasACL bool `json:"hasAcl"`
IsFolder bool `json:"isFolder"`
FolderID uint `json:"folderId"`
FolderUID string `json:"folderUid"`
FolderTitle string `json:"folderTitle"`
FolderURL string `json:"folderUrl"`
Provisioned bool `json:"provisioned"`
ProvisionedExternalID string `json:"provisionedExternalId"`
AnnotationsPermissions AnnotationsPermissions `json:"annotationsPermissions"`
}
type AnnotationsPermissions struct {
Dashboard AnnotationPermissions `json:"dashboard"`
Organization AnnotationPermissions `json:"organization"`
}
type AnnotationPermissions struct {
CanAdd bool `json:"canAdd"`
CanEdit bool `json:"canEdit"`
CanDelete bool `json:"canDelete"`
}

View file

@ -15,6 +15,4 @@ type DashboardVersion struct {
Data any `json:"data"`
}
type DashboardVersionListResponse struct {
DashboardVersions []DashboardVersion
}
type DashboardVersionListResponse []DashboardVersion

View file

@ -17,6 +17,4 @@ type SearchResult struct {
FolderURL string `json:"folderUrl"`
}
type SearchResultListResponse struct {
SearchResults []SearchResult
}
type SearchResultListResponse []SearchResult