Skip to content

Commit

Permalink
Revert "Filter alerts (#147)"
Browse files Browse the repository at this point in the history
This reverts commit 468a5df.
  • Loading branch information
SaaldjorMike authored Mar 5, 2024
1 parent 468a5df commit 968da66
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 678 deletions.
14 changes: 3 additions & 11 deletions api/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import "fmt"
type EntityType string

const (
EntityTypeParser EntityType = "parser"
EntityTypeAction EntityType = "action"
EntityTypeAlert EntityType = "alert"
EntityTypeFilterAlert EntityType = "filter-alert"
EntityTypeParser EntityType = "parser"
EntityTypeAction EntityType = "action"
EntityTypeAlert EntityType = "alert"
)

func (e EntityType) String() string {
Expand Down Expand Up @@ -52,10 +51,3 @@ func AlertNotFound(name string) error {
key: name,
}
}

func FilterAlertNotFound(name string) error {
return EntityNotFound{
entityType: EntityTypeFilterAlert,
key: name,
}
}
228 changes: 0 additions & 228 deletions api/filter-alerts.go

This file was deleted.

26 changes: 24 additions & 2 deletions api/internal/humiographql/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ type Alert struct {
Actions []graphql.String `graphql:"actions"`
Labels []graphql.String `graphql:"labels"`
LastError graphql.String `graphql:"lastError"`
QueryOwnership QueryOwnership `graphql:"queryOwnership"`
RunAsUser struct {
QueryOwnership struct {
ID graphql.String `graphql:"id"`
QueryOwnershipTypeName QueryOwnershipTypeName `graphql:"__typename"`
} `graphql:"queryOwnership"`
RunAsUser struct {
ID graphql.String `graphql:"id"`
} `graphql:"runAsUser"`
}

type QueryOwnership struct {
}

type CreateAlert struct {
ViewName graphql.String `json:"viewName"`
Name graphql.String `json:"name"`
Expand Down Expand Up @@ -52,3 +58,19 @@ type UpdateAlert struct {
Labels []graphql.String `json:"labels"`
QueryOwnershipType QueryOwnershipType `json:"queryOwnershipType,omitempty"`
}

type Long int64

type QueryOwnershipTypeName string

const (
QueryOwnershipTypeNameOrganization QueryOwnershipTypeName = "OrganizationOwnership"
QueryOwnershipTypeNameUser QueryOwnershipTypeName = "UserOwnership"
)

type QueryOwnershipType string

const (
QueryOwnershipTypeUser QueryOwnershipType = "User"
QueryOwnershipTypeOrganization QueryOwnershipType = "Organization"
)
49 changes: 0 additions & 49 deletions api/internal/humiographql/filter-alerts.go

This file was deleted.

22 changes: 0 additions & 22 deletions api/internal/humiographql/queryownership.go

This file was deleted.

5 changes: 0 additions & 5 deletions api/internal/humiographql/scalars.go

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/humioctl/alerts_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ The install command allows you to install alerts from a URL or from a local file
// if we only got <view> you must supply --file or --url.
if l := len(args); l == 1 {
if filePath != "" {
content, err = getBytesFromFile(filePath)
content, err = getAlertFromFile(filePath)
} else if url != "" {
content, err = getBytesFromURL(url)
content, err = getURLAlert(url)
} else {
cmd.Printf("You must specify a path using --file or --url\n")
os.Exit(1)
Expand Down
Loading

0 comments on commit 968da66

Please sign in to comment.