api

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 25 Imported by: 10

Documentation

Index

Constants

View Source
const (
	ActionTypeEmail            string = "EmailAction"
	ActionTypeHumioRepo        string = "HumioRepoAction"
	ActionTypeOpsGenie         string = "OpsGenieAction"
	ActionTypePagerDuty        string = "PagerDutyAction"
	ActionTypeSlack            string = "SlackAction"
	ActionTypeSlackPostMessage string = "SlackPostMessageAction"
	ActionTypeVictorOps        string = "VictorOpsAction"
	ActionTypeWebhook          string = "WebhookAction"
)
View Source
const (
	QueryOwnershipTypeUser         string = "User"
	QueryOwnershipTypeOrganization string = "Organization"
)
View Source
const JSONContentType string = "application/json"

JSONContentType is "application/json"

View Source
const LogScaleVersionWithParserAPIv2 = "1.129.0"
View Source
const ZIPContentType string = "application/zip"

Variables

View Source
var ErrUserNotFound = errors.New("user not found")

Functions

func ActionNotFound added in v0.29.0

func ActionNotFound(name string) error

func AggregateAlertNotFound added in v0.36.0

func AggregateAlertNotFound(name string) error

func AlertNotFound added in v0.29.0

func AlertNotFound(name string) error

func CloneHeader added in v0.26.0

func CloneHeader(in http.Header) http.Header

CloneHeader creates a deep copy of an http.Header.

func CloneRequest added in v0.26.0

func CloneRequest(req *http.Request) *http.Request

CloneRequest creates a shallow copy of the request along with a deep copy of the Headers.

func FilterAlertNotFound added in v0.34.0

func FilterAlertNotFound(name string) error

func NewHttpTransport added in v0.28.7

func NewHttpTransport(config Config) *http.Transport

func ParserNotFound added in v0.29.0

func ParserNotFound(name string) error

func ScheduledSearchNotFound added in v0.35.0

func ScheduledSearchNotFound(name string) error

Types

type Action added in v0.29.0

type Action struct {
	Type string `graphql:"__typename" yaml:"type" json:"type"`
	ID   string `graphql:"id"         yaml:"-"    json:"id"`
	Name string `graphql:"name"       yaml:"name" json:"name"`

	EmailAction            EmailAction            `graphql:"... on EmailAction"            yaml:"emailAction,omitempty" json:"emailAction,omitempty"`
	HumioRepoAction        HumioRepoAction        `graphql:"... on HumioRepoAction"        yaml:"humioRepoAction,omitempty" json:"humioRepoAction,omitempty"`
	OpsGenieAction         OpsGenieAction         `graphql:"... on OpsGenieAction"         yaml:"opsGenieAction,omitempty" json:"opsGenieAction,omitempty"`
	PagerDutyAction        PagerDutyAction        `graphql:"... on PagerDutyAction"        yaml:"pagerDutyAction,omitempty" json:"pagerDutyAction,omitempty"`
	SlackAction            SlackAction            `graphql:"... on SlackAction"            yaml:"slackAction,omitempty" json:"slackAction,omitempty"`
	SlackPostMessageAction SlackPostMessageAction `graphql:"... on SlackPostMessageAction" yaml:"slackPostMessageAction,omitempty" json:"slackPostMessageAction,omitempty"`
	VictorOpsAction        VictorOpsAction        `graphql:"... on VictorOpsAction"        yaml:"victorOpsAction,omitempty" json:"victorOpsAction,omitempty"`
	WebhookAction          WebhookAction          `graphql:"... on WebhookAction"          yaml:"webhookAction,omitempty" json:"webhookAction,omitempty"`
}

type Actions added in v0.29.0

type Actions struct {
	// contains filtered or unexported fields
}

func (*Actions) Add added in v0.29.0

func (n *Actions) Add(viewName string, newAction *Action) (*Action, error)

func (*Actions) Delete added in v0.29.0

func (n *Actions) Delete(viewName, actionName string) error

func (*Actions) Get added in v0.29.0

func (n *Actions) Get(viewName, actionName string) (*Action, error)

func (*Actions) GetByID added in v0.29.0

func (n *Actions) GetByID(viewName, actionID string) (*Action, error)

func (*Actions) List added in v0.29.0

func (n *Actions) List(viewName string) ([]Action, error)

func (*Actions) Update added in v0.29.0

func (n *Actions) Update(viewName string, newAction *Action) (*Action, error)

type AggregateAlert added in v0.36.0

type AggregateAlert struct {
	ID                    string   `graphql:"id"                    yaml:"-"                       json:"id"`
	Name                  string   `graphql:"name"                  yaml:"name"                    json:"name"`
	Description           string   `graphql:"description"           yaml:"description,omitempty"   json:"description,omitempty"`
	QueryString           string   `graphql:"queryString"           yaml:"queryString"             json:"queryString"`
	SearchIntervalSeconds int      `graphql:"searchIntervalSeconds" yaml:"searchIntervalSeconds"   json:"searchIntervalSeconds"`
	ActionNames           []string `graphql:"actionNames"           yaml:"actionNames"             json:"actionNames"`
	Labels                []string `graphql:"labels"                yaml:"labels"                  json:"labels"`
	Enabled               bool     `graphql:"enabled"               yaml:"enabled"                 json:"enabled"`
	ThrottleField         string   `graphql:"throttleField"         yaml:"throttleField,omitempty" json:"throttleField,omitempty"`
	ThrottleTimeSeconds   int      `graphql:"throttleTimeSeconds"   yaml:"throttleTimeSeconds"     json:"throttleTimeSeconds"`
	QueryOwnershipType    string   `graphql:"queryOwnership"        yaml:"queryOwnershipType"      json:"queryOwnershipType"`
	TriggerMode           string   `graphql:"triggerMode"           yaml:"triggerMode"             json:"triggerMode"`
	QueryTimestampType    string   `graphql:"queryTimestampType"    yaml:"queryTimestampType"      json:"queryTimestampType"`
	RunAsUserID           string   `graphql:"runAsUserId"           yaml:"runAsUserId,omitempty"   json:"runAsUserId,omitempty"`
}

type AggregateAlerts added in v0.36.0

type AggregateAlerts struct {
	// contains filtered or unexported fields
}

func (*AggregateAlerts) Create added in v0.36.0

func (a *AggregateAlerts) Create(viewName string, newAggregateAlert *AggregateAlert) (*AggregateAlert, error)

func (*AggregateAlerts) Delete added in v0.36.0

func (a *AggregateAlerts) Delete(viewName, aggregateAlertID string) error

func (*AggregateAlerts) Get added in v0.36.0

func (a *AggregateAlerts) Get(viewName string, aggregateAlertID string) (*AggregateAlert, error)

func (*AggregateAlerts) List added in v0.36.0

func (a *AggregateAlerts) List(viewName string) ([]*AggregateAlert, error)

func (*AggregateAlerts) Update added in v0.36.0

func (a *AggregateAlerts) Update(viewName string, updatedAggregateAlert *AggregateAlert) (*AggregateAlert, error)

type Alert added in v0.25.0

type Alert struct {
	ID                 string   `graphql:"id"                 yaml:"-"                            json:"id"`
	Name               string   `graphql:"name"               yaml:"name"                         json:"name"`
	QueryString        string   `graphql:"queryString"        yaml:"queryString"                  json:"queryString"`
	QueryStart         string   `graphql:"queryStart"         yaml:"queryStart"                   json:"queryStart"`
	ThrottleField      string   `graphql:"throttleField"      yaml:"throttleField"                json:"throttleField"`
	TimeOfLastTrigger  int      `graphql:"timeOfLastTrigger"  yaml:"timeOfLastTrigger"            json:"timeOfLastTrigger"`
	IsStarred          bool     `graphql:"isStarred"          yaml:"isStarred"                    json:"isStarred"`
	Description        string   `graphql:"description"        yaml:"description,omitempty"        json:"description"`
	ThrottleTimeMillis int      `graphql:"throttleTimeMillis" yaml:"throttleTimeMillis"           json:"throttleTimeMillis"`
	Enabled            bool     `graphql:"enabled"            yaml:"enabled"                      json:"enabled"`
	Actions            []string `graphql:"actions"            yaml:"actions"                      json:"actions"`
	Labels             []string `graphql:"labels"             yaml:"labels,omitempty"             json:"labels,omitempty"`
	LastError          string   `graphql:"lastError"          yaml:"lastError"                    json:"lastError"`
	RunAsUserID        string   `graphql:"runAsUserId"        yaml:"runAsUserId,omitempty"        json:"runAsUserId,omitempty"`
	QueryOwnershipType string   `graphql:"queryOwnershipType" yaml:"queryOwnershipType,omitempty" json:"queryOwnershipType,omitempty"`
}

type Alerts added in v0.25.0

type Alerts struct {
	// contains filtered or unexported fields
}

func (*Alerts) Add added in v0.25.0

func (a *Alerts) Add(viewName string, newAlert *Alert) (*Alert, error)

func (*Alerts) Delete added in v0.25.0

func (a *Alerts) Delete(viewName, alertName string) error

func (*Alerts) Get added in v0.25.0

func (a *Alerts) Get(viewName, alertName string) (*Alert, error)

func (*Alerts) List added in v0.25.0

func (a *Alerts) List(viewName string) ([]Alert, error)

func (*Alerts) Update added in v0.25.0

func (a *Alerts) Update(viewName string, newAlert *Alert) (*Alert, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) *Client

func NewClientWithTransport added in v0.28.7

func NewClientWithTransport(config Config, httpTransport *http.Transport) *Client

func (*Client) Actions added in v0.29.0

func (c *Client) Actions() *Actions

func (*Client) Address

func (c *Client) Address() *url.URL

func (*Client) AggregateAlerts added in v0.36.0

func (c *Client) AggregateAlerts() *AggregateAlerts

func (*Client) Alerts added in v0.25.0

func (c *Client) Alerts() *Alerts

func (*Client) CACertificate added in v0.26.0

func (c *Client) CACertificate() string

func (*Client) ClusterNodes added in v0.25.0

func (c *Client) ClusterNodes() *ClusterNodes

func (*Client) Clusters added in v0.25.0

func (c *Client) Clusters() *Clusters

func (*Client) Config added in v0.28.1

func (c *Client) Config() Config

func (*Client) FeatureFlags added in v0.29.0

func (c *Client) FeatureFlags() *FeatureFlags

func (*Client) Files added in v0.28.2

func (c *Client) Files() *Files

func (*Client) FilterAlerts added in v0.34.0

func (c *Client) FilterAlerts() *FilterAlerts

func (*Client) Groups added in v0.28.1

func (c *Client) Groups() *Groups

func (*Client) HTTPRequest added in v0.25.0

func (c *Client) HTTPRequest(httpMethod string, path string, body io.Reader) (*http.Response, error)

func (*Client) HTTPRequestContext added in v0.25.0

func (c *Client) HTTPRequestContext(ctx context.Context, httpMethod string, path string, body io.Reader, contentType string) (*http.Response, error)

func (*Client) Health added in v0.25.0

func (c *Client) Health() (Health, error)

func (*Client) HealthString added in v0.25.0

func (c *Client) HealthString() (string, error)

func (*Client) IngestTokens

func (c *Client) IngestTokens() *IngestTokens

func (*Client) Insecure added in v0.26.0

func (c *Client) Insecure() bool

func (*Client) Licenses added in v0.12.0

func (c *Client) Licenses() *Licenses

func (*Client) Mutate

func (c *Client) Mutate(mutation interface{}, variables map[string]interface{}) error

func (*Client) Organizations added in v0.28.1

func (c *Client) Organizations() *Organizations

func (*Client) Packages added in v0.27.0

func (c *Client) Packages() *Packages

Packages constructs a Packages API client.

func (*Client) Parsers

func (c *Client) Parsers() *Parsers

func (*Client) Query

func (c *Client) Query(query interface{}, variables map[string]interface{}) error

func (*Client) QueryJobs added in v0.25.0

func (c *Client) QueryJobs() *QueryJobs

func (*Client) Repositories added in v0.13.0

func (c *Client) Repositories() *Repositories

func (*Client) Roles added in v0.31.0

func (c *Client) Roles() *Roles

func (*Client) ScheduledSearches added in v0.35.0

func (c *Client) ScheduledSearches() *ScheduledSearches

func (*Client) Status added in v0.4.0

func (c *Client) Status() (*StatusResponse, error)

func (*Client) Token

func (c *Client) Token() string

func (*Client) Users

func (c *Client) Users() *Users

func (*Client) Viewer added in v0.4.0

func (c *Client) Viewer() *Viewer

func (*Client) Views added in v0.5.0

func (c *Client) Views() *Views

type Cluster added in v0.25.0

type Cluster struct {
	Nodes                               []ClusterNode
	ClusterInfoAgeSeconds               float64
	UnderReplicatedSegmentSize          float64
	OverReplicatedSegmentSize           float64
	MissingSegmentSize                  float64
	ProperlyReplicatedSegmentSize       float64
	TargetUnderReplicatedSegmentSize    float64
	TargetOverReplicatedSegmentSize     float64
	TargetMissingSegmentSize            float64
	TargetProperlyReplicatedSegmentSize float64
	IngestPartitions                    []IngestPartition
}

type ClusterNode added in v0.25.0

type ClusterNode struct {
	Id                      int
	Name                    string
	Uri                     string
	Uuid                    string
	ClusterInfoAgeSeconds   float64
	InboundSegmentSize      float64
	OutboundSegmentSize     float64
	CanBeSafelyUnregistered bool
	CurrentSize             float64
	PrimarySize             float64
	SecondarySize           float64
	TotalSizeOfPrimary      float64
	TotalSizeOfSecondary    float64
	FreeOnPrimary           float64
	FreeOnSecondary         float64
	WipSize                 float64
	TargetSize              float64
	SolitarySegmentSize     float64
	IsAvailable             bool
	LastHeartbeat           string
	// Zone holds the availability zone as configured in the `ZONE` configuration of the Humio server.
	Zone string
}

type ClusterNodes added in v0.25.0

type ClusterNodes struct {
	// contains filtered or unexported fields
}

func (*ClusterNodes) Get added in v0.25.0

func (n *ClusterNodes) Get(nodeID int) (ClusterNode, error)

func (*ClusterNodes) List added in v0.25.0

func (n *ClusterNodes) List() ([]ClusterNode, error)

func (*ClusterNodes) Unregister added in v0.25.0

func (n *ClusterNodes) Unregister(nodeID int, force bool) error

type Clusters added in v0.25.0

type Clusters struct {
	// contains filtered or unexported fields
}

func (*Clusters) Get added in v0.25.0

func (c *Clusters) Get() (Cluster, error)

type Config

type Config struct {
	Address           *url.URL
	UserAgent         string
	Token             string
	CACertificatePEM  string
	Insecure          bool
	ProxyOrganization string
	DialContext       func(ctx context.Context, network, addr string) (net.Conn, error)
}

func DefaultConfig

func DefaultConfig() Config

type DefaultGroupEnum added in v0.27.0

type DefaultGroupEnum string
const (
	DefaultGroupEnumMember     DefaultGroupEnum = "Member"
	DefaultGroupEnumAdmin      DefaultGroupEnum = "Admin"
	DefaultGroupEnumEliminator DefaultGroupEnum = "Eliminator"
)

func (*DefaultGroupEnum) ParseString added in v0.27.0

func (e *DefaultGroupEnum) ParseString(s string) bool

func (DefaultGroupEnum) String added in v0.27.0

func (e DefaultGroupEnum) String() string

type EmailAction added in v0.29.0

type EmailAction struct {
	Recipients      []string `graphql:"emailRecipients: recipients" yaml:"recipients,omitempty" json:"recipients,omitempty"`
	SubjectTemplate string   `graphql:"emailSubjectTemplate: subjectTemplate" yaml:"subjectTemplate,omitempty" json:"subjectTemplate,omitempty"`
	BodyTemplate    string   `graphql:"emailBodyTemplate: bodyTemplate" yaml:"bodyTemplate,omitempty" json:"bodyTemplate,omitempty"`
	UseProxy        bool     `graphql:"emailUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type EntityNotFound added in v0.29.0

type EntityNotFound struct {
	// contains filtered or unexported fields
}

func (EntityNotFound) EntityType added in v0.29.0

func (e EntityNotFound) EntityType() EntityType

func (EntityNotFound) Error added in v0.29.0

func (e EntityNotFound) Error() string

func (EntityNotFound) Key added in v0.29.0

func (e EntityNotFound) Key() string

type EntityType added in v0.29.0

type EntityType string
const (
	EntityTypeParser          EntityType = "parser"
	EntityTypeAction          EntityType = "action"
	EntityTypeAlert           EntityType = "alert"
	EntityTypeFilterAlert     EntityType = "filter-alert"
	EntityTypeScheduledSearch EntityType = "scheduled-search"
	EntityTypeAggregateAlert  EntityType = "aggregate-alert"
)

func (EntityType) String added in v0.29.0

func (e EntityType) String() string

type FeatureFlag added in v0.29.0

type FeatureFlag string

type FeatureFlags added in v0.29.0

type FeatureFlags struct {
	// contains filtered or unexported fields
}

func (*FeatureFlags) DisableForOrganization added in v0.29.0

func (f *FeatureFlags) DisableForOrganization(organizationID string, flag FeatureFlag) error

func (*FeatureFlags) DisableForUser added in v0.29.0

func (f *FeatureFlags) DisableForUser(userID string, flag FeatureFlag) error

func (*FeatureFlags) DisableGlobally added in v0.29.0

func (f *FeatureFlags) DisableGlobally(flag FeatureFlag) error

func (*FeatureFlags) EnableForOrganization added in v0.29.0

func (f *FeatureFlags) EnableForOrganization(organizationID string, flag FeatureFlag) error

func (*FeatureFlags) EnableForUser added in v0.29.0

func (f *FeatureFlags) EnableForUser(userID string, flag FeatureFlag) error

func (*FeatureFlags) EnableGlobally added in v0.29.0

func (f *FeatureFlags) EnableGlobally(flag FeatureFlag) error

func (*FeatureFlags) SupportedFlags added in v0.29.0

func (f *FeatureFlags) SupportedFlags() ([]FeatureFlag, error)

type File added in v0.28.2

type File struct {
	ID          string
	Name        string
	ContentHash string
}

type Files added in v0.28.2

type Files struct {
	// contains filtered or unexported fields
}

func (*Files) Delete added in v0.28.2

func (f *Files) Delete(viewName string, fileName string) error

func (*Files) Download added in v0.28.2

func (f *Files) Download(viewName string, fileName string) (io.Reader, error)

func (*Files) List added in v0.28.2

func (f *Files) List(viewName string) ([]File, error)

func (*Files) Upload added in v0.28.2

func (f *Files) Upload(viewName string, fileName string, reader io.Reader) error

type FilterAlert added in v0.34.0

type FilterAlert struct {
	ID                  string   `graphql:"id"                  yaml:"-"                             json:"id"`
	Name                string   `graphql:"name"                yaml:"name"                          json:"name"`
	Description         string   `graphql:"description"         yaml:"description,omitempty"         json:"description,omitempty"`
	QueryString         string   `graphql:"queryString"         yaml:"queryString"                   json:"queryString"`
	ActionNames         []string `graphql:"actionNames"         yaml:"actionNames"                   json:"actionNames"`
	Labels              []string `graphql:"labels"              yaml:"labels"                        json:"labels"`
	Enabled             bool     `graphql:"enabled"             yaml:"enabled"                       json:"enabled"`
	QueryOwnershipType  string   `graphql:"queryOwnership"      yaml:"queryOwnershipType"            json:"queryOwnershipType"`
	ThrottleTimeSeconds int      `graphql:"throttleTimeSeconds" yaml:"throttleTimeSeconds,omitempty" json:"throttleTimeSeconds,omitempty"`
	ThrottleField       string   `graphql:"throttleField"       yaml:"throttleField,omitempty"       json:"throttleField,omitempty"`
	RunAsUserID         string   `graphql:"runAsUserId"         yaml:"runAsUserId,omitempty"         json:"runAsUserId,omitempty"`
}

type FilterAlerts added in v0.34.0

type FilterAlerts struct {
	// contains filtered or unexported fields
}

func (*FilterAlerts) Create added in v0.34.0

func (fa *FilterAlerts) Create(viewName string, newFilterAlert *FilterAlert) (*FilterAlert, error)

func (*FilterAlerts) Delete added in v0.34.0

func (fa *FilterAlerts) Delete(viewName, filterAlertID string) error

func (*FilterAlerts) Get added in v0.34.0

func (fa *FilterAlerts) Get(viewName string, filterAlertID string) (*FilterAlert, error)

func (*FilterAlerts) List added in v0.34.0

func (fa *FilterAlerts) List(viewName string) ([]FilterAlert, error)

func (*FilterAlerts) Update added in v0.34.0

func (fa *FilterAlerts) Update(viewName string, updatedFilterAlert *FilterAlert) (*FilterAlert, error)

type Group added in v0.28.1

type Group struct {
	ID          string
	DisplayName string
}

type Groups added in v0.28.1

type Groups struct {
	// contains filtered or unexported fields
}

func (*Groups) AddUserToGroup added in v0.28.1

func (g *Groups) AddUserToGroup(groupID string, userID string) error

func (*Groups) List added in v0.28.1

func (g *Groups) List() ([]Group, error)

func (*Groups) RemoveUserFromGroup added in v0.28.1

func (g *Groups) RemoveUserFromGroup(groupID string, userID string) error

type Health added in v0.25.0

type Health struct {
	Status        StatusValue   `json:"status"`
	StatusMessage string        `json:"statusMessage"`
	Uptime        string        `json:"uptime"`
	Version       string        `json:"version"`
	OK            []HealthCheck `json:"oks"`
	Warn          []HealthCheck `json:"warnings"`
	Down          []HealthCheck `json:"down"`
	// contains filtered or unexported fields
}

func (*Health) ChecksMap added in v0.25.0

func (h *Health) ChecksMap() map[string]HealthCheck

func (*Health) Json added in v0.25.0

func (h *Health) Json() []byte

type HealthCheck added in v0.25.0

type HealthCheck struct {
	Name          string                 `json:"name"`
	Status        StatusValue            `json:"status"`
	StatusMessage string                 `json:"statusMessage"`
	Fields        map[string]interface{} `json:"fields"`
}

type HttpHeaderEntryInput added in v0.29.0

type HttpHeaderEntryInput struct {
	Header string `graphql:"header"  yaml:"header" json:"header"`
	Value  string `graphql:"value"   yaml:"value" json:"value"`
}

type HumioRepoAction added in v0.29.0

type HumioRepoAction struct {
	IngestToken string `graphql:"humioRepoIngestToken: ingestToken" yaml:"ingestToken,omitempty" json:"ingestToken,omitempty"`
}

type IngestPartition added in v0.25.0

type IngestPartition struct {
	Id      int
	NodeIds []int
}

type IngestToken

type IngestToken struct {
	Name           string `json:"name"`
	Token          string `json:"token"`
	AssignedParser string `json:"parser"`
}

type IngestTokens

type IngestTokens struct {
	// contains filtered or unexported fields
}

func (*IngestTokens) Add

func (i *IngestTokens) Add(repositoryName string, tokenName string, parser string) (*IngestToken, error)

func (*IngestTokens) Get added in v0.25.0

func (i *IngestTokens) Get(repoName, tokenName string) (*IngestToken, error)

func (*IngestTokens) List

func (i *IngestTokens) List(repo string) ([]IngestToken, error)

func (*IngestTokens) Remove

func (i *IngestTokens) Remove(repositoryName string, tokenName string) error

func (*IngestTokens) Update added in v0.25.0

func (i *IngestTokens) Update(repositoryName string, tokenName string, parser string) (*IngestToken, error)

type InstallationErrors added in v0.28.10

type InstallationErrors struct {
	InstallationErrors []string `json:"installationErrors"`
	ParseErrors        []string `json:"parseErrors"`
	ResponseType       string   `json:"responseType"`
}

type InstalledPackage added in v0.28.0

type InstalledPackage struct {
	ID          string
	InstalledBy *struct {
		Username  string
		Timestamp string
	}
	UpdatedBy *struct {
		Username  string
		Timestamp string
	}
	Source          string
	AvailableUpdate string
}

InstalledPackage contain the details of an installed package

type License added in v0.9.0

type License interface {
	ExpiresAt() string
	IssuedAt() string
}

type Licenses added in v0.12.0

type Licenses struct {
	// contains filtered or unexported fields
}

func (*Licenses) Get added in v0.12.0

func (l *Licenses) Get() (License, error)

func (*Licenses) Install added in v0.12.0

func (l *Licenses) Install(license string) error

type OnPremLicense added in v0.12.0

type OnPremLicense struct {
	ID            string
	ExpiresAtVal  string
	IssuedAtVal   string
	IssuedTo      string
	NumberOfSeats int
}

func (OnPremLicense) ExpiresAt added in v0.12.0

func (l OnPremLicense) ExpiresAt() string

func (OnPremLicense) IssuedAt added in v0.12.0

func (l OnPremLicense) IssuedAt() string

type OpsGenieAction added in v0.29.0

type OpsGenieAction struct {
	ApiUrl   string `graphql:"opsGenieApiUrl: apiUrl" yaml:"apiUrl,omitempty" json:"apiUrl,omitempty"`
	GenieKey string `graphql:"opsGenieGenieKey: genieKey" yaml:"genieKey,omitempty" json:"genieKey,omitempty"`
	UseProxy bool   `graphql:"opsGenieUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type Organization added in v0.28.1

type Organization struct {
	ID          string
	Name        string
	Description *string
}

type Organizations added in v0.28.1

type Organizations struct {
	// contains filtered or unexported fields
}

func (*Organizations) CreateOrganization added in v0.28.1

func (o *Organizations) CreateOrganization(name string) (Organization, error)

type Packages added in v0.27.0

type Packages struct {
	// contains filtered or unexported fields
}

Packages is a API client for working with Humio packages.

func (*Packages) CreateArchive added in v0.27.0

func (p *Packages) CreateArchive(packageDirPath string, targetFileName string) error

CreateArchive creates a archive by bundling the files in packageDirPath in a zip file.

func (*Packages) InstallArchive added in v0.27.0

func (p *Packages) InstallArchive(viewName string, pathToZip string) (*ValidationResponse, error)

InstallArchive installs a local package (zip file).

func (*Packages) InstallFromDirectory added in v0.27.0

func (p *Packages) InstallFromDirectory(packageDirPath string, targetRepoOrView string) (*ValidationResponse, error)

InstallFromDirectory installs a package from a directory containing the package files.

func (*Packages) ListInstalled added in v0.28.0

func (p *Packages) ListInstalled(viewName string) ([]InstalledPackage, error)

ListInstalled returns a list of installed packages

func (*Packages) UninstallPackage added in v0.27.0

func (p *Packages) UninstallPackage(viewName string, packageID string) error

UninstallPackage uninstalls a package by name.

func (*Packages) Validate added in v0.27.0

func (p *Packages) Validate(viewName string, absPath string) (*ValidationResponse, error)

Validate checks a package declaration validity against a Humio server.

type PagerDutyAction added in v0.29.0

type PagerDutyAction struct {
	Severity   string `graphql:"pagerDutySeverity: severity" yaml:"severity,omitempty" json:"severity,omitempty"`
	RoutingKey string `graphql:"pagerDutyRoutingKey: routingKey" yaml:"routingKey,omitempty" json:"routingKey,omitempty"`
	UseProxy   bool   `graphql:"pagerDutyUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type Parser

type Parser struct {
	ID                             string
	Name                           string
	Script                         string           `json:"script"                                   yaml:",flow"`
	TestCases                      []ParserTestCase `json:"testCases"                                yaml:"testCases"`
	FieldsToTag                    []string         `json:"tagFields"                                yaml:"tagFields"`
	FieldsToBeRemovedBeforeParsing []string         `json:"fieldsToBeRemovedBeforeParsing,omitempty" yaml:"fieldsToBeRemovedBeforeParsing"`
}

type ParserListItem

type ParserListItem struct {
	ID        string
	Name      string
	IsBuiltIn bool
}

type ParserTestCase

type ParserTestCase struct {
	Event      ParserTestEvent            `json:"event"      yaml:"event"`
	Assertions []ParserTestCaseAssertions `json:"assertions" yaml:"assertions"`
}

type ParserTestCaseAssertions added in v0.35.0

type ParserTestCaseAssertions struct {
	OutputEventIndex int               `json:"outputEventIndex" yaml:"outputEventIndex"`
	FieldsNotPresent []string          `json:"fieldsNotPresent" yaml:"fieldsNotPresent"`
	FieldsHaveValues map[string]string `json:"fieldsHaveValues" yaml:"fieldsHaveValues"`
}

type ParserTestEvent added in v0.35.0

type ParserTestEvent struct {
	RawString string `json:"rawString" yaml:"rawString"`
}

type Parsers

type Parsers struct {
	// contains filtered or unexported fields
}

func (*Parsers) Add

func (p *Parsers) Add(repositoryName string, newParser *Parser, allowOverwritingExistingParser bool) (*Parser, error)

func (*Parsers) Delete added in v0.35.0

func (p *Parsers) Delete(repositoryName string, parserName string) error

func (*Parsers) Export added in v0.27.0

func (p *Parsers) Export(repositoryName string, parserName string) (string, error)

func (*Parsers) Get

func (p *Parsers) Get(repositoryName string, parserName string) (*Parser, error)

func (*Parsers) List

func (p *Parsers) List(repositoryName string) ([]ParserListItem, error)

type Query added in v0.25.0

type Query struct {
	QueryString                string            `json:"queryString"`
	Start                      string            `json:"start,omitempty"`
	End                        string            `json:"end,omitempty"`
	Live                       bool              `json:"isLive,omitempty"`
	TimezoneOffset             *int              `json:"timeZoneOffsetMinutes,omitempty"`
	Arguments                  map[string]string `json:"arguments,omitempty"`
	ShowQueryEventDistribution bool              `json:"showQueryEventDistribution,omitempty"`
}

type QueryError added in v0.25.0

type QueryError struct {
	// contains filtered or unexported fields
}

func (QueryError) Error added in v0.25.0

func (e QueryError) Error() string

type QueryJobs added in v0.25.0

type QueryJobs struct {
	// contains filtered or unexported fields
}

func (QueryJobs) Create added in v0.25.0

func (q QueryJobs) Create(repository string, query Query) (string, error)

func (*QueryJobs) Delete added in v0.25.0

func (q *QueryJobs) Delete(repository string, id string) error

func (*QueryJobs) Poll added in v0.25.0

func (q *QueryJobs) Poll(repository string, id string) (QueryResult, error)

func (*QueryJobs) PollContext added in v0.25.0

func (q *QueryJobs) PollContext(ctx context.Context, repository string, id string) (QueryResult, error)

type QueryResult added in v0.25.0

type QueryResult struct {
	Cancelled bool                     `json:"cancelled"`
	Done      bool                     `json:"done"`
	Events    []map[string]interface{} `json:"events"`
	Metadata  QueryResultMetadata      `json:"metaData"`
}

type QueryResultMetadata added in v0.25.0

type QueryResultMetadata struct {
	EventCount       uint64                 `json:"eventCount"`
	ExtraData        map[string]interface{} `json:"extraData"`
	FieldOrder       []string               `json:"fieldOrder"`
	IsAggregate      bool                   `json:"isAggregate"`
	PollAfter        int                    `json:"pollAfter"`
	ProcessedBytes   uint64                 `json:"processedBytes"`
	ProcessedEvents  uint64                 `json:"processedEvents"`
	QueryStart       uint64                 `json:"queryStart"`
	QueryEnd         uint64                 `json:"queryEnd"`
	ResultBufferSize uint64                 `json:"resultBufferSize"`
	TimeMillis       uint64                 `json:"timeMillis"`
	TotalWork        uint64                 `json:"totalWork"`
	WorkDone         uint64                 `json:"workDone"`
}

type RepoListItem added in v0.13.0

type RepoListItem struct {
	ID        string
	Name      string
	SpaceUsed int64 `graphql:"compressedByteSize"`
}

type Repositories added in v0.13.0

type Repositories struct {
	// contains filtered or unexported fields
}

func (*Repositories) Create added in v0.24.0

func (r *Repositories) Create(name string) error

func (*Repositories) Delete added in v0.26.0

func (r *Repositories) Delete(name, reason string, allowDataDeletion bool) error

func (*Repositories) DisableS3Archiving added in v0.34.0

func (r *Repositories) DisableS3Archiving(name string) error

func (*Repositories) EnableS3Archiving added in v0.34.0

func (r *Repositories) EnableS3Archiving(name string) error

func (*Repositories) Get added in v0.13.0

func (r *Repositories) Get(name string) (Repository, error)

func (*Repositories) List added in v0.13.0

func (r *Repositories) List() ([]RepoListItem, error)

func (*Repositories) UpdateAutomaticSearch added in v0.35.0

func (r *Repositories) UpdateAutomaticSearch(name string, automaticSearch bool) error

func (*Repositories) UpdateDescription added in v0.26.0

func (r *Repositories) UpdateDescription(name, description string) error

func (*Repositories) UpdateIngestBasedRetention added in v0.26.0

func (r *Repositories) UpdateIngestBasedRetention(name string, ingestInGB float64, allowDataDeletion bool) error

func (*Repositories) UpdateS3ArchivingConfiguration added in v0.34.0

func (r *Repositories) UpdateS3ArchivingConfiguration(name string, bucket string, region string, format string) error

func (*Repositories) UpdateStorageBasedRetention added in v0.26.0

func (r *Repositories) UpdateStorageBasedRetention(name string, storageInGB float64, allowDataDeletion bool) error

func (*Repositories) UpdateTimeBasedRetention added in v0.26.0

func (r *Repositories) UpdateTimeBasedRetention(name string, retentionInDays float64, allowDataDeletion bool) error

func (*Repositories) UpdateUserGroup added in v0.27.0

func (r *Repositories) UpdateUserGroup(name, username string, groups ...DefaultGroupEnum) error

type Repository added in v0.13.0

type Repository struct {
	ID                       string
	Name                     string
	Description              string
	RetentionDays            float64                      `graphql:"timeBasedRetention"`
	IngestRetentionSizeGB    float64                      `graphql:"ingestSizeBasedRetention"`
	StorageRetentionSizeGB   float64                      `graphql:"storageSizeBasedRetention"`
	SpaceUsed                int64                        `graphql:"compressedByteSize"`
	S3ArchivingConfiguration humiographql.S3Configuration `graphql:"s3ArchivingConfiguration"`
	AutomaticSearch          bool                         `graphql:"automaticSearch"`
}

type Role added in v0.5.0

type Role struct {
	ID                string   `graphql:"id"`
	DisplayName       string   `graphql:"displayName"`
	Color             string   `graphql:"color"`
	Description       string   `graphql:"description"`
	ViewPermissions   []string `graphql:"viewPermissions"`
	SystemPermissions []string `graphql:"systemPermissions"`
	OrgPermissions    []string `graphql:"organizationPermissions"`
}

type Roles added in v0.31.0

type Roles struct {
	// contains filtered or unexported fields
}

func (*Roles) Create added in v0.31.0

func (r *Roles) Create(role *Role) error

func (*Roles) Get added in v0.31.0

func (r *Roles) Get(rolename string) (*Role, error)

func (*Roles) GetRoleID added in v0.31.0

func (r *Roles) GetRoleID(rolename string) (string, error)

func (*Roles) List added in v0.31.0

func (r *Roles) List() ([]Role, error)

func (*Roles) RemoveRole added in v0.31.0

func (r *Roles) RemoveRole(rolename string) error

func (*Roles) Update added in v0.31.0

func (r *Roles) Update(rolename string, newRole *Role) error

type ScheduledSearch added in v0.35.0

type ScheduledSearch struct {
	ID                 string   `graphql:"id"                         yaml:"-"                          json:"id"`
	Name               string   `graphql:"name"                       yaml:"name"                       json:"name"`
	Description        string   `graphql:"description"                yaml:"description,omitempty"      json:"description,omitempty"`
	QueryString        string   `graphql:"queryString"                yaml:"queryString"                json:"queryString"`
	QueryStart         string   `graphql:"queryStart"                 yaml:"queryStart"                 json:"queryStart"`
	QueryEnd           string   `graphql:"queryEnd"                   yaml:"queryEnd"                   json:"queryEnd"`
	TimeZone           string   `graphql:"timeZone"                   yaml:"timeZone"                   json:"timeZone"`
	Schedule           string   `graphql:"schedule"                   yaml:"schedule"                   json:"schedule"`
	BackfillLimit      int      `graphql:"backfillLimit"              yaml:"backfillLimit"              json:"backfillLimit"`
	Enabled            bool     `graphql:"enabled"                    yaml:"enabled"                    json:"enabled"`
	ActionNames        []string `graphql:"actionNames"                yaml:"actionNames"                json:"actionNames"`
	RunAsUserID        string   `graphql:"runAsUserId"                yaml:"runAsUserId,omitempty"      json:"runAsUserId,omitempty"`
	Labels             []string `graphql:"labels"                     yaml:"labels"                     json:"labels"`
	QueryOwnershipType string   `graphql:"queryOwnership"             yaml:"queryOwnershipType"         json:"queryOwnershipType"`
}

type ScheduledSearches added in v0.35.0

type ScheduledSearches struct {
	// contains filtered or unexported fields
}

func (*ScheduledSearches) Create added in v0.35.0

func (a *ScheduledSearches) Create(viewName string, newScheduledSearch *ScheduledSearch) (*ScheduledSearch, error)

func (*ScheduledSearches) Delete added in v0.35.0

func (a *ScheduledSearches) Delete(viewName, scheduledSearchID string) error

func (*ScheduledSearches) Get added in v0.35.0

func (a *ScheduledSearches) Get(viewName string, scheduledSearchId string) (*ScheduledSearch, error)

func (*ScheduledSearches) List added in v0.35.0

func (a *ScheduledSearches) List(viewName string) ([]ScheduledSearch, error)

func (*ScheduledSearches) Update added in v0.35.0

func (a *ScheduledSearches) Update(viewName string, updateScheduledSearch *ScheduledSearch) (*ScheduledSearch, error)

type SlackAction added in v0.29.0

type SlackAction struct {
	Url      string                 `graphql:"slackUrl: url" yaml:"url,omitempty" json:"url,omitempty"`
	Fields   []SlackFieldEntryInput `graphql:"slackFields: fields" yaml:"fields,omitempty" json:"fields,omitempty"`
	UseProxy bool                   `graphql:"slackUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type SlackFieldEntryInput added in v0.29.0

type SlackFieldEntryInput struct {
	FieldName string `graphql:"fieldName" yaml:"fieldName" json:"fieldName"`
	Value     string `graphql:"value"     yaml:"value" json:"value"`
}

type SlackPostMessageAction added in v0.29.0

type SlackPostMessageAction struct {
	ApiToken string                 `graphql:"slackPostMessageApiToken: apiToken" yaml:"apiToken,omitempty" json:"apiToken,omitempty"`
	Channels []string               `graphql:"slackPostMessageChannels: channels" yaml:"channels,omitempty" json:"channels,omitempty"`
	Fields   []SlackFieldEntryInput `graphql:"slackPostMessageFields: fields" yaml:"fields,omitempty" json:"fields,omitempty"`
	UseProxy bool                   `graphql:"slackPostMessageUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type StatusResponse added in v0.4.0

type StatusResponse struct {
	Status  string
	Version string
}

func (StatusResponse) AtLeast added in v0.35.0

func (s StatusResponse) AtLeast(ver string) (bool, error)

func (StatusResponse) IsDown added in v0.25.0

func (s StatusResponse) IsDown() bool

type StatusValue added in v0.25.0

type StatusValue string
const (
	StatusOK   StatusValue = "OK"
	StatusWarn StatusValue = "WARN"
	StatusDown StatusValue = "DOWN"
)

type UnversionedPackageSpecifier added in v0.28.0

type UnversionedPackageSpecifier string

UnversionedPackageSpecifier is the ID of a package, e.g foo/bar

type User

type User struct {
	ID          string
	Username    string
	FullName    string
	Email       string
	Company     string
	CountryCode string
	Picture     string
	IsRoot      bool
	CreatedAt   string
}

type UserChangeSet

type UserChangeSet struct {
	IsRoot      *bool
	FullName    *string
	Company     *string
	CountryCode *string
	Picture     *string
	Email       *string
}

type Users

type Users struct {
	// contains filtered or unexported fields
}

func (*Users) Add added in v0.5.0

func (u *Users) Add(username string, changeset UserChangeSet) (User, error)

func (*Users) Get

func (u *Users) Get(username string) (User, error)

func (*Users) List

func (u *Users) List() ([]User, error)

func (*Users) Remove

func (u *Users) Remove(username string) (User, error)

func (*Users) RotateToken added in v0.32.1

func (u *Users) RotateToken(userID string) (string, error)

func (*Users) Update

func (u *Users) Update(username string, changeset UserChangeSet) (User, error)

type ValidationResponse added in v0.27.0

type ValidationResponse struct {
	InstallationErrors []string `json:"installationErrors"`
	ParseErrors        []string `json:"parseErrors"`
}

ValidationResponse contain the results of a package validation.

func (*ValidationResponse) IsValid added in v0.27.0

func (resp *ValidationResponse) IsValid() bool

IsValid returns true if there are no errors in the package

type VersionedPackageSpecifier added in v0.27.0

type VersionedPackageSpecifier string

VersionedPackageSpecifier is the ID and version of a package, e.g foo/bar@2.0.1

type VictorOpsAction added in v0.29.0

type VictorOpsAction struct {
	MessageType string `graphql:"victorOpsMessageType: messageType" yaml:"messageType,omitempty" json:"messageType,omitempty"`
	NotifyUrl   string `graphql:"victorOpsNotifyUrl: notifyUrl" yaml:"notifyUrl,omitempty" json:"notifyUrl,omitempty"`
	UseProxy    bool   `graphql:"victorOpsUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

type View added in v0.5.0

type View struct {
	Name            string
	Description     string
	Connections     []ViewConnection
	AutomaticSearch bool
}

type ViewConnection added in v0.15.0

type ViewConnection struct {
	RepoName string
	Filter   string
}

type ViewConnectionInput added in v0.28.1

type ViewConnectionInput struct {
	RepositoryName graphql.String `json:"repositoryName"`
	Filter         graphql.String `json:"filter"`
}

type ViewListItem added in v0.11.0

type ViewListItem struct {
	Name            string
	Typename        string `graphql:"__typename"`
	AutomaticSearch bool
}

type ViewQueryData added in v0.15.0

type ViewQueryData struct {
	Name            string
	Description     string
	AutomaticSearch bool
	ViewInfo        struct {
		Connections []struct {
			Repository struct{ Name string }
			Filter     string
		}
	} `graphql:"... on View"`
}

type Viewer added in v0.4.0

type Viewer struct {
	// contains filtered or unexported fields
}

func (*Viewer) ApiToken added in v0.25.0

func (c *Viewer) ApiToken() (string, error)

ApiToken fetches the api token for the user who is currently authenticated.

func (*Viewer) Username added in v0.4.0

func (c *Viewer) Username() (string, error)

Username fetches the username associated with the API Token in use.

type Views added in v0.5.0

type Views struct {
	// contains filtered or unexported fields
}

func (*Views) Create added in v0.28.1

func (c *Views) Create(name, description string, connections []ViewConnectionInput) error

func (*Views) Delete added in v0.28.1

func (c *Views) Delete(name, reason string) error

func (*Views) Get added in v0.5.0

func (c *Views) Get(name string) (*View, error)

func (*Views) List added in v0.11.0

func (c *Views) List() ([]ViewListItem, error)

func (*Views) UpdateAutomaticSearch added in v0.35.0

func (c *Views) UpdateAutomaticSearch(name string, automaticSearch bool) error

func (*Views) UpdateConnections added in v0.28.1

func (c *Views) UpdateConnections(name string, connections []ViewConnectionInput) error

func (*Views) UpdateDescription added in v0.28.1

func (c *Views) UpdateDescription(name string, description string) error

type WebhookAction added in v0.29.0

type WebhookAction struct {
	Method       string                 `graphql:"webhookMethod: method" yaml:"method,omitempty" json:"method,omitempty"`
	Url          string                 `graphql:"webhookUrl: url" yaml:"url,omitempty" json:"url,omitempty"`
	Headers      []HttpHeaderEntryInput `graphql:"webhookHeaders: headers" yaml:"headers,omitempty" json:"headers,omitempty"`
	BodyTemplate string                 `graphql:"webhookBodyTemplate: bodyTemplate" yaml:"bodyTemplate,omitempty" json:"bodyTemplate,omitempty"`
	IgnoreSSL    bool                   `graphql:"webhookIgnoreSSL: ignoreSSL" yaml:"ignoreSSL,omitempty" json:"ignoreSSL,omitempty"`
	UseProxy     bool                   `graphql:"webhookUseProxy: useProxy" yaml:"useProxy,omitempty" json:"useProxy,omitempty"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL