Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Filter alerts" #148

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading