api

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

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

This section is empty.

Functions

func ActionNotFound

func ActionNotFound(name string) error

func AggregateAlertNotFound

func AggregateAlertNotFound(name string) error

func AlertNotFound

func AlertNotFound(name string) error

func CloneHeader

func CloneHeader(in http.Header) http.Header

CloneHeader creates a deep copy of an http.Header.

func CloneRequest

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

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

func ClusterNodeNotFound

func ClusterNodeNotFound(name string) error

func FilterAlertNotFound

func FilterAlertNotFound(name string) error

func IngestTokenNotFound

func IngestTokenNotFound(name string) error

func NewHttpTransport

func NewHttpTransport(config Config) *http.Transport

func ParserNotFound

func ParserNotFound(name string) error

func RepositoryNotFound

func RepositoryNotFound(name string) error

func ScheduledSearchNotFound

func ScheduledSearchNotFound(name string) error

func SearchDomainNotFound

func SearchDomainNotFound(name string) error

func UserNotFound

func UserNotFound(name string) error

func ViewNotFound

func ViewNotFound(name string) error

Types

type Action

type Action struct {
	Type string
	ID   string `yaml:"-"`
	Name string

	EmailAction            EmailAction            `yaml:"emailAction,omitempty"`
	HumioRepoAction        HumioRepoAction        `yaml:"humioRepoAction,omitempty"`
	OpsGenieAction         OpsGenieAction         `yaml:"opsGenieAction,omitempty"`
	PagerDutyAction        PagerDutyAction        `yaml:"pagerDutyAction,omitempty"`
	SlackAction            SlackAction            `yaml:"slackAction,omitempty"`
	SlackPostMessageAction SlackPostMessageAction `yaml:"slackPostMessageAction,omitempty"`
	VictorOpsAction        VictorOpsAction        `yaml:"victorOpsAction,omitempty"`
	UploadFileAction       UploadFileAction       `yaml:"uploadFileAction,omitempty"`
	WebhookAction          WebhookAction          `yaml:"webhookAction,omitempty"`
}

type Actions

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

func (*Actions) Add

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

func (*Actions) Delete

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

func (*Actions) Get

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

func (*Actions) List

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

type AggregateAlert

type AggregateAlert struct {
	ID                    string `yaml:"-"`
	Name                  string
	Description           *string
	QueryString           string   `yaml:"queryString"`
	SearchIntervalSeconds int64    `yaml:"searchIntervalSeconds"`
	ActionNames           []string `yaml:"actionNames"`
	Labels                []string
	Enabled               bool
	ThrottleField         *string `yaml:"throttleField"`
	ThrottleTimeSeconds   int64   `yaml:"throttleTimeSeconds"`
	QueryOwnershipType    string  `yaml:"queryOwnershipType"`
	TriggerMode           string  `yaml:"triggerMode"`
	QueryTimestampType    string  `yaml:"queryTimestampType"`
	OwnershipRunAsID      string  `yaml:"ownershipRunAsID"`
}

type AggregateAlerts

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

func (*AggregateAlerts) Create

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

func (*AggregateAlerts) Delete

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

func (*AggregateAlerts) List

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

type Alert

type Alert struct {
	ID                 string `yaml:"-"`
	Name               string
	QueryString        string  `yaml:"queryString"`
	QueryStart         string  `yaml:"queryStart"`
	ThrottleField      *string `yaml:"throttleField"`
	TimeOfLastTrigger  *int64  `yaml:"timeOfLastTrigger"`
	IsStarred          bool    `yaml:"isStarred"`
	Description        *string
	ThrottleTimeMillis int64 `yaml:"throttleTimeMillis"`
	Enabled            bool
	Actions            []string
	Labels             []string
	LastError          *string `yaml:"lastError"`
	RunAsUserID        string  `yaml:"runAsUserID"`
	QueryOwnershipType string  `yaml:"queryOwnershipType"`
}

type Alerts

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

func (*Alerts) Add

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

func (*Alerts) Delete

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

func (*Alerts) Get

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

func (*Alerts) List

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

type Client

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

func NewClient

func NewClient(config Config) *Client

func NewClientWithTransport

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

func (*Client) Actions

func (c *Client) Actions() *Actions

func (*Client) Address

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

func (*Client) AggregateAlerts

func (c *Client) AggregateAlerts() *AggregateAlerts

func (*Client) Alerts

func (c *Client) Alerts() *Alerts

func (*Client) CACertificate

func (c *Client) CACertificate() string

func (*Client) ClusterNodes

func (c *Client) ClusterNodes() *ClusterNodes

func (*Client) Clusters

func (c *Client) Clusters() *Clusters

func (*Client) Config

func (c *Client) Config() Config

func (*Client) FeatureFlags

func (c *Client) FeatureFlags() *FeatureFlags

func (*Client) Files

func (c *Client) Files() *Files

func (*Client) FilterAlerts

func (c *Client) FilterAlerts() *FilterAlerts

func (*Client) Groups

func (c *Client) Groups() *Groups

func (*Client) HTTPRequest

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

func (*Client) HTTPRequestContext

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

func (*Client) Health

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

func (*Client) IngestTokens

func (c *Client) IngestTokens() *IngestTokens

func (*Client) Insecure

func (c *Client) Insecure() bool

func (*Client) Licenses

func (c *Client) Licenses() *Licenses

func (*Client) MakeRequest

func (c *Client) MakeRequest(ctx context.Context, req *graphql.Request, resp *graphql.Response) error

func (*Client) Packages

func (c *Client) Packages() *Packages

Packages constructs a Packages API client.

func (*Client) Parsers

func (c *Client) Parsers() *Parsers

func (*Client) QueryJobs

func (c *Client) QueryJobs() *QueryJobs

func (*Client) Repositories

func (c *Client) Repositories() *Repositories

func (*Client) Roles

func (c *Client) Roles() *Roles

func (*Client) ScheduledSearches

func (c *Client) ScheduledSearches() *ScheduledSearches

func (*Client) ScheduledSearchesV2 added in v0.38.0

func (c *Client) ScheduledSearchesV2() *ScheduledSearchesV2

func (*Client) SearchDomains

func (c *Client) SearchDomains() *SearchDomains

func (*Client) Status

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

func (*Client) Token

func (c *Client) Token() string

func (*Client) Tokens

func (c *Client) Tokens() *Tokens

func (*Client) Users

func (c *Client) Users() *Users

func (*Client) Viewer

func (c *Client) Viewer() *Viewer

func (*Client) Views

func (c *Client) Views() *Views

type Cluster

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

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

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

func (*ClusterNodes) Get

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

func (*ClusterNodes) List

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

func (*ClusterNodes) Unregister

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

type Clusters

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

func (*Clusters) Get

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 EmailAction

type EmailAction struct {
	Recipients      []string
	SubjectTemplate *string
	BodyTemplate    *string
	UseProxy        bool
}

type EntityNotFound

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

func (EntityNotFound) EntityType

func (e EntityNotFound) EntityType() EntityType

func (EntityNotFound) Error

func (e EntityNotFound) Error() string

func (EntityNotFound) Key

func (e EntityNotFound) Key() string

type EntityType

type EntityType string
const (
	EntityTypeSearchDomain    EntityType = "search-domain"
	EntityTypeRepository      EntityType = "repository"
	EntityTypeView            EntityType = "view"
	EntityTypeIngestToken     EntityType = "ingest-token"
	EntityTypeParser          EntityType = "parser"
	EntityTypeAction          EntityType = "action"
	EntityTypeAlert           EntityType = "alert"
	EntityTypeFilterAlert     EntityType = "filter-alert"
	EntityTypeScheduledSearch EntityType = "scheduled-search"
	EntityTypeAggregateAlert  EntityType = "aggregate-alert"
	EntityTypeUser            EntityType = "user"
	EntityTypeClusterNode     EntityType = "cluster-node"
)

func (EntityType) String

func (e EntityType) String() string

type ErrorList

type ErrorList []*GraphqlError

func (ErrorList) Error

func (errs ErrorList) Error() string

type FeatureFlag

type FeatureFlag struct {
	Flag         FeatureFlagName
	Experimental bool
	Description  string
}

type FeatureFlagName

type FeatureFlagName string

type FeatureFlags

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

func (*FeatureFlags) DisableForOrganization

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

func (*FeatureFlags) DisableForUser

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

func (*FeatureFlags) DisableGlobally

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

func (*FeatureFlags) EnableForOrganization

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

func (*FeatureFlags) EnableForUser

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

func (*FeatureFlags) EnableGlobally

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

func (*FeatureFlags) SupportedFlags

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

type File

type File struct {
	Name        string
	ContentHash string
}

type Files

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

func (*Files) Delete

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

func (*Files) Download

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

func (*Files) List

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

func (*Files) Upload

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

type FilterAlert

type FilterAlert struct {
	ID                  string `yaml:"-"`
	Name                string
	Description         *string
	QueryString         string   `yaml:"queryString"`
	ActionNames         []string `yaml:"actionNames"`
	Labels              []string
	Enabled             bool
	QueryOwnershipType  string  `yaml:"queryOwnershipType"`
	ThrottleTimeSeconds *int64  `yaml:"throttleTimeSeconds"`
	ThrottleField       *string `yaml:"throttleField"`
	OwnershipRunAsID    string  `yaml:"ownershipRunAsID"`
}

type FilterAlerts

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

func (*FilterAlerts) Create

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

func (*FilterAlerts) Delete

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

func (*FilterAlerts) List

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

type GraphqlError

type GraphqlError struct {
	Err        error                  `json:"-"`
	Message    string                 `json:"message"`
	Path       ast.Path               `json:"path,omitempty"`
	Locations  []gqlerror.Location    `json:"locations,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
	Rule       string                 `json:"-"`
	State      map[string]string      `json:"state,omitempty"`
}

func (*GraphqlError) Error

func (err *GraphqlError) Error() string

type Group

type Group struct {
	ID          string
	DisplayName string
}

type Groups

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

func (*Groups) AddUserToGroup

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

func (*Groups) List

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

func (*Groups) RemoveUserFromGroup

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

type Health

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

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

type HealthCheck

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

type HttpHeader

type HttpHeader struct {
	Header string
	Value  string
}

type HumioRepoAction

type HumioRepoAction struct {
	IngestToken string
}

type IngestPartition

type IngestPartition struct {
	Id      int
	NodeIds []int
}

type IngestToken

type IngestToken struct {
	Name           string
	Token          string
	AssignedParser string
}

type IngestTokens

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

func (*IngestTokens) Add

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

func (*IngestTokens) Get

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

func (*IngestTokens) List

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

func (*IngestTokens) Remove

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

func (*IngestTokens) Update

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

type InstallationErrors

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

type InstalledPackage

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

InstalledPackage contain the details of an installed package

type License

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

type Licenses

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

func (*Licenses) Get

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

func (*Licenses) Install

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

type OnPremLicense

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

func (OnPremLicense) ExpiresAt

func (l OnPremLicense) ExpiresAt() string

func (OnPremLicense) IssuedAt

func (l OnPremLicense) IssuedAt() string

type OpsGenieAction

type OpsGenieAction struct {
	ApiUrl   string
	GenieKey string
	UseProxy bool
}

type Packages

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

Packages is a API client for working with Humio packages.

func (*Packages) CreateArchive

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

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

InstallArchive installs a local package (zip file).

func (*Packages) InstallFromDirectory

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

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

func (*Packages) ListInstalled

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

ListInstalled returns a list of installed packages

func (*Packages) UninstallPackage

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

UninstallPackage uninstalls a package by name.

func (*Packages) Validate

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

Validate checks a package declaration validity against a Humio server.

type PagerDutyAction

type PagerDutyAction struct {
	Severity   string
	RoutingKey string
	UseProxy   bool
}

type Parser

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

type ParserListItem

type ParserListItem struct {
	ID        string
	Name      string
	IsBuiltIn bool
}

type ParserTestCase

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

type ParserTestCaseAssertions

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

type ParserTestEvent

type ParserTestEvent struct {
	RawString string `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

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

func (*Parsers) Export

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

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

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

func (QueryError) Error

func (e QueryError) Error() string

type QueryJobs

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

func (QueryJobs) Create

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

func (*QueryJobs) Delete

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

func (*QueryJobs) PollContext

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

type QueryResult

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

type QueryResultMetadata

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

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

type Repositories

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

func (*Repositories) Create

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

func (*Repositories) Delete

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

func (*Repositories) DisableS3Archiving

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

func (*Repositories) EnableS3Archiving

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

func (*Repositories) Get

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

func (*Repositories) List

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

func (*Repositories) UpdateAutomaticSearch

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

func (*Repositories) UpdateDescription

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

func (*Repositories) UpdateIngestBasedRetention

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

func (*Repositories) UpdateS3ArchivingConfiguration

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

func (*Repositories) UpdateStorageBasedRetention

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

func (*Repositories) UpdateTimeBasedRetention

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

type Repository

type Repository struct {
	ID                       string
	Name                     string
	Description              *string
	RetentionDays            *float64
	IngestRetentionSizeGB    *float64
	StorageRetentionSizeGB   *float64
	SpaceUsed                int64
	S3ArchivingConfiguration S3Configuration
	AutomaticSearch          bool
}

type Response

type Response struct {
	Data       interface{}            `json:"data"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
	Errors     ErrorList              `json:"errors,omitempty"`
}

type Role

type Role struct {
	ID                string
	DisplayName       string
	ViewPermissions   []string
	SystemPermissions []string
	OrgPermissions    []string
}

type Roles

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

func (*Roles) Get

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

func (*Roles) GetRoleID

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

func (*Roles) List

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

type S3Configuration

type S3Configuration struct {
	Bucket   string `graphql:"bucket"`
	Region   string `graphql:"region"`
	Disabled bool   `graphql:"disabled"`
	Format   string `graphql:"format"`
}

func (*S3Configuration) IsConfigured

func (s *S3Configuration) IsConfigured() bool

func (*S3Configuration) IsEnabled

func (s *S3Configuration) IsEnabled() bool

IsEnabled - determine if S3Configuration is enabled based on values and the Disabled field to avoid a bool defaulting to false

type ScheduledSearch

type ScheduledSearch struct {
	ID                 string `yaml:"-"`
	Name               string
	Description        *string
	QueryString        string `yaml:"queryString"`
	QueryStart         string `yaml:"queryStart"`
	QueryEnd           string `yaml:"queryEnd"`
	TimeZone           string `yaml:"timeZone"`
	Schedule           string
	BackfillLimit      int `yaml:"backfillLimit"`
	Enabled            bool
	ActionNames        []string `yaml:"actionNames"`
	OwnershipRunAsID   string   `yaml:"ownershipRunAsID"`
	Labels             []string
	QueryOwnershipType string `yaml:"queryOwnershipType"`
}

type ScheduledSearchV2 added in v0.38.0

type ScheduledSearchV2 struct {
	ID                          string   `yaml:"-"`
	Name                        string   `yaml:"name"`
	Description                 *string  `yaml:"description,omitempty"`
	QueryString                 string   `yaml:"queryString"`
	SearchIntervalSeconds       int64    `yaml:"searchIntervalSeconds"`
	SearchIntervalOffsetSeconds *int64   `yaml:"searchIntervalOffsetSeconds,omitempty"`
	QueryTimestampType          string   `yaml:"queryTimestampType"`
	MaxWaitTimeSeconds          *int64   `yaml:"maxWaitTimeSeconds,omitempty"`
	BackfillLimitV2             *int     `yaml:"backfillLimitV2,omitempty"`
	TimeZone                    string   `yaml:"timeZone"`
	Schedule                    string   `yaml:"schedule"`
	Enabled                     bool     `yaml:"enabled"`
	ActionNames                 []string `yaml:"actionNames"`
	Labels                      []string `yaml:"labels"`
	QueryOwnershipType          string   `yaml:"queryOwnershipType"`
	OwnershipRunAsID            string   `yaml:"ownershipRunAsID"`
}

type ScheduledSearches

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

func (*ScheduledSearches) Create

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

func (*ScheduledSearches) Delete

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

func (*ScheduledSearches) List

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

type ScheduledSearchesV2 added in v0.38.0

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

func (*ScheduledSearchesV2) Create added in v0.38.0

func (a *ScheduledSearchesV2) Create(searchDomainName string, newScheduledSearch *ScheduledSearchV2) (*ScheduledSearchV2, error)

func (*ScheduledSearchesV2) Delete added in v0.38.0

func (a *ScheduledSearchesV2) Delete(searchDomainName, scheduledSearchID string) error

func (*ScheduledSearchesV2) List added in v0.38.0

func (a *ScheduledSearchesV2) List(searchDomainName string) ([]ScheduledSearchV2, error)

type SearchDomain

type SearchDomain struct {
	Name            string
	Description     *string
	AutomaticSearch bool
}

type SearchDomains

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

func (*SearchDomains) Get

func (s *SearchDomains) Get(name string) (*SearchDomain, error)

type SlackAction

type SlackAction struct {
	Url      string
	Fields   []SlackField
	UseProxy bool
}

type SlackField

type SlackField struct {
	FieldName string
	Value     string
}

type SlackPostMessageAction

type SlackPostMessageAction struct {
	ApiToken string
	Channels []string
	Fields   []SlackField
	UseProxy bool
}

type StatusResponse

type StatusResponse struct {
	Status  string
	Version string
}

func (StatusResponse) AtLeast

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

func (StatusResponse) IsDown

func (s StatusResponse) IsDown() bool

type StatusValue

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

type Tokens

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

func (*Tokens) Rotate

func (t *Tokens) Rotate(tokenID string) (string, error)

type UnversionedPackageSpecifier

type UnversionedPackageSpecifier string

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

type UploadFileAction

type UploadFileAction struct {
	FileName string
}

type User

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

type Users

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

func (*Users) Add

func (u *Users) Add(username string, isRoot *bool, fullName, company, countryCode, email, picture *string) (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) Update

func (u *Users) Update(username string, isRoot *bool, fullName, company, countryCode, email, picture *string) (User, error)

type ValidationResponse

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

ValidationResponse contain the results of a package validation.

func (*ValidationResponse) IsValid

func (resp *ValidationResponse) IsValid() bool

IsValid returns true if there are no errors in the package

type VersionedPackageSpecifier

type VersionedPackageSpecifier string

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

type VictorOpsAction

type VictorOpsAction struct {
	MessageType string
	NotifyUrl   string
	UseProxy    bool
}

type View

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

type ViewConnection

type ViewConnection struct {
	RepoName string
	Filter   string
}

type ViewConnectionInput

type ViewConnectionInput struct {
	RepositoryName string
	Filter         string
}

type ViewListItem

type ViewListItem struct {
	Name            string
	Typename        string
	AutomaticSearch bool
}

type Viewer

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

func (*Viewer) Username

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

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

type Views

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

func (*Views) Create

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

func (*Views) Delete

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

func (*Views) Get

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

func (*Views) List

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

func (*Views) UpdateAutomaticSearch

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

func (*Views) UpdateConnections

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

func (*Views) UpdateDescription

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

type WebhookAction

type WebhookAction struct {
	Method       string
	Url          string
	Headers      []HttpHeader
	BodyTemplate string
	IgnoreSSL    bool
	UseProxy     bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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