mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Adds tags endpoint (#36199)
* Annotations: Adds tags endpoint * Chore: fixes sql statement * Refactor: adds count to the api * Chore: changes after PR comments * Refactor: changes after PR comments
This commit is contained in:
@@ -17,6 +17,7 @@ type Repository interface {
|
||||
Update(item *Item) error
|
||||
Find(query *ItemQuery) ([]*ItemDTO, error)
|
||||
Delete(params *DeleteParams) error
|
||||
FindTags(query *TagsQuery) (FindTagsResult, error)
|
||||
}
|
||||
|
||||
// AnnotationCleaner is responsible for cleaning up old annotations
|
||||
@@ -40,6 +41,28 @@ type ItemQuery struct {
|
||||
Limit int64 `json:"limit"`
|
||||
}
|
||||
|
||||
type TagsQuery struct {
|
||||
OrgID int64 `json:"orgId"`
|
||||
Tag string `json:"tag"`
|
||||
|
||||
Limit int64 `json:"limit"`
|
||||
}
|
||||
|
||||
type Tags struct {
|
||||
Key string
|
||||
Value string
|
||||
Count int64
|
||||
}
|
||||
|
||||
type TagsDTO struct {
|
||||
Tag string `json:"tag"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
type FindTagsResult struct {
|
||||
Tags []*TagsDTO `json:"tags"`
|
||||
}
|
||||
|
||||
type DeleteParams struct {
|
||||
OrgId int64
|
||||
Id int64
|
||||
|
||||
Reference in New Issue
Block a user