opensearch

package
v0.0.0-...-48b24a7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityLogEntryResourceTypeOpenSearch activitylog.ActivityLogEntryResourceType = "OPENSEARCH"
)

Variables

View Source
var (
	SortFilterOpenSearch       = sortfilter.New[*OpenSearch, OpenSearchOrderField, *OpenSearchFilter]()
	SortFilterOpenSearchAccess = sortfilter.New[*OpenSearchAccess, OpenSearchAccessOrderField, struct{}]()
)

Functions

func AddSearch

func AddSearch(client search.Client, watcher *watcher.Watcher[*OpenSearch])

func NamePrefix

func NamePrefix(teamSlug slug.Slug) string

NamePrefix returns the Kubernetes resource name prefix for OpenSearch instances belonging to the given team (e.g. "opensearch-myteam-").

func NewLoaderContext

func NewLoaderContext(ctx context.Context, tenantName string, watcher *watcher.Watcher[*OpenSearch], aivenClient aiven.AivenClient, logger logrus.FieldLogger) context.Context

func NewWatcher

func NewWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*OpenSearch]

Types

type AivenDataLoaderKey

type AivenDataLoaderKey struct {
	Project     string
	ServiceName string
}

type CreateOpenSearchCredentialsInput

type CreateOpenSearchCredentialsInput struct {
	TeamSlug        slug.Slug                             `json:"teamSlug"`
	EnvironmentName string                                `json:"environmentName"`
	InstanceName    string                                `json:"instanceName"`
	Permission      aivencredentials.CredentialPermission `json:"permission"`
	TTL             string                                `json:"ttl"`
}

type CreateOpenSearchCredentialsPayload

type CreateOpenSearchCredentialsPayload struct {
	Credentials *OpenSearchCredentials `json:"credentials"`
}

type CreateOpenSearchInput

type CreateOpenSearchInput struct {
	OpenSearchInput
}

type CreateOpenSearchPayload

type CreateOpenSearchPayload struct {
	OpenSearch *OpenSearch `json:"openSearch"`
}

type DeleteOpenSearchInput

type DeleteOpenSearchInput struct {
	OpenSearchMetadataInput
}

type DeleteOpenSearchPayload

type DeleteOpenSearchPayload struct {
	OpenSearchDeleted *bool `json:"openSearchDeleted,omitempty"`
}

type OpenSearch

type OpenSearch struct {
	Name                  string                 `json:"name"`
	Status                *OpenSearchStatus      `json:"status"`
	TerminationProtection bool                   `json:"terminationProtection"`
	Tier                  OpenSearchTier         `json:"tier"`
	Memory                OpenSearchMemory       `json:"memory"`
	StorageGB             StorageGB              `json:"storageGB"`
	Labels                []*model.ResourceLabel `json:"labels"`
	TeamSlug              slug.Slug              `json:"-"`
	EnvironmentName       string                 `json:"-"`
	WorkloadReference     *workload.Reference    `json:"-"`
	AivenProject          string                 `json:"-"`
	MajorVersion          OpenSearchMajorVersion `json:"-"`
}

func Get

func Get(ctx context.Context, teamSlug slug.Slug, environment, name string) (*OpenSearch, error)

func GetByIdent

func GetByIdent(ctx context.Context, id ident.Ident) (*OpenSearch, error)

func GetForWorkload

func GetForWorkload(ctx context.Context, teamSlug slug.Slug, environment string, reference *nais_io_v1.OpenSearch) (*OpenSearch, error)

func ListAllForTeam

func ListAllForTeam(ctx context.Context, teamSlug slug.Slug, filter *OpenSearchFilter) []*OpenSearch

func (*OpenSearch) DeepCopyObject

func (r *OpenSearch) DeepCopyObject() runtime.Object

func (*OpenSearch) FullyQualifiedName

func (r *OpenSearch) FullyQualifiedName() string

func (*OpenSearch) GetLabels

func (r *OpenSearch) GetLabels() map[string]string

func (*OpenSearch) GetName

func (r *OpenSearch) GetName() string

func (*OpenSearch) GetNamespace

func (r *OpenSearch) GetNamespace() string

func (*OpenSearch) GetObjectKind

func (r *OpenSearch) GetObjectKind() schema.ObjectKind

func (OpenSearch) ID

func (o OpenSearch) ID() ident.Ident

func (OpenSearch) IsActivityLogger

func (OpenSearch) IsActivityLogger()

func (OpenSearch) IsNode

func (OpenSearch) IsNode()

func (OpenSearch) IsPersistence

func (OpenSearch) IsPersistence()

func (OpenSearch) IsSearchNode

func (OpenSearch) IsSearchNode()

type OpenSearchAccess

type OpenSearchAccess struct {
	Access            string              `json:"access"`
	TeamSlug          slug.Slug           `json:"-"`
	EnvironmentName   string              `json:"-"`
	WorkloadReference *workload.Reference `json:"-"`
}

type OpenSearchAccessConnection

type OpenSearchAccessConnection = pagination.Connection[*OpenSearchAccess]

type OpenSearchAccessEdge

type OpenSearchAccessEdge = pagination.Edge[*OpenSearchAccess]

type OpenSearchAccessOrder

type OpenSearchAccessOrder struct {
	Field     OpenSearchAccessOrderField `json:"field"`
	Direction model.OrderDirection       `json:"direction"`
}

type OpenSearchAccessOrderField

type OpenSearchAccessOrderField string

func (OpenSearchAccessOrderField) IsValid

func (e OpenSearchAccessOrderField) IsValid() bool

func (OpenSearchAccessOrderField) MarshalGQL

func (e OpenSearchAccessOrderField) MarshalGQL(w io.Writer)

func (OpenSearchAccessOrderField) String

func (*OpenSearchAccessOrderField) UnmarshalGQL

func (e *OpenSearchAccessOrderField) UnmarshalGQL(v any) error

type OpenSearchCreatedActivityLogEntry

type OpenSearchCreatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type OpenSearchCredentials

type OpenSearchCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	URI      string `json:"uri"`
}

type OpenSearchDeletedActivityLogEntry

type OpenSearchDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type OpenSearchEdge

type OpenSearchEdge = pagination.Edge[*OpenSearch]

type OpenSearchFacets

type OpenSearchFacets struct {
	AllOpenSearches []*OpenSearch
	Filter          *OpenSearchFilter
	// contains filtered or unexported fields
}

func (*OpenSearchFacets) Environments

func (f *OpenSearchFacets) Environments(ctx context.Context) []model.StringFacetItem

Environments computes environments facets for an OpenSearch query.

func (*OpenSearchFacets) Filtered

func (f *OpenSearchFacets) Filtered(ctx context.Context) []*OpenSearch

Filtered returns the filtered OpenSearch instances, computing it exactly once per request.

func (*OpenSearchFacets) Labels

Labels computes labels facets for an OpenSearch query.

func (*OpenSearchFacets) Tiers

Tiers computes tiers facets for an OpenSearch query.

type OpenSearchFilter

type OpenSearchFilter struct {
	Name         string             `json:"name"`
	Environments []string           `json:"environments"`
	Tiers        []OpenSearchTier   `json:"tiers"`
	Labels       model.LabelFilters `json:"labels,omitempty"`
}

type OpenSearchInput

type OpenSearchInput struct {
	OpenSearchMetadataInput
	Tier      OpenSearchTier         `json:"tier"`
	Memory    OpenSearchMemory       `json:"memory"`
	Version   OpenSearchMajorVersion `json:"version"`
	StorageGB StorageGB              `json:"storageGB"`
}

func (*OpenSearchInput) Validate

func (o *OpenSearchInput) Validate(ctx context.Context) error

func (*OpenSearchInput) ValidationErrors

func (o *OpenSearchInput) ValidationErrors(ctx context.Context) *validate.ValidationErrors

type OpenSearchMajorVersion

type OpenSearchMajorVersion string
const (
	OpenSearchMajorVersionV1    OpenSearchMajorVersion = "V1"
	OpenSearchMajorVersionV2    OpenSearchMajorVersion = "V2"
	OpenSearchMajorVersionV2_19 OpenSearchMajorVersion = "V2_19"
	OpenSearchMajorVersionV3_3  OpenSearchMajorVersion = "V3_3"
)

func OpenSearchMajorVersionFromAivenString

func OpenSearchMajorVersionFromAivenString(s string) (OpenSearchMajorVersion, error)

func (OpenSearchMajorVersion) IsValid

func (e OpenSearchMajorVersion) IsValid() bool

func (OpenSearchMajorVersion) MarshalGQL

func (e OpenSearchMajorVersion) MarshalGQL(w io.Writer)

func (OpenSearchMajorVersion) String

func (e OpenSearchMajorVersion) String() string

func (OpenSearchMajorVersion) ToAivenString

func (e OpenSearchMajorVersion) ToAivenString() (string, error)

ToAivenString returns the version string without the "V" prefix, e.g. "2" or "1".

func (*OpenSearchMajorVersion) UnmarshalGQL

func (e *OpenSearchMajorVersion) UnmarshalGQL(v any) error

func (OpenSearchMajorVersion) ValidateUpgradePath

func (e OpenSearchMajorVersion) ValidateUpgradePath(other OpenSearchMajorVersion) error

type OpenSearchMemory

type OpenSearchMemory string
const (
	OpenSearchMemoryGB2  OpenSearchMemory = "GB_2"
	OpenSearchMemoryGB4  OpenSearchMemory = "GB_4"
	OpenSearchMemoryGB8  OpenSearchMemory = "GB_8"
	OpenSearchMemoryGB16 OpenSearchMemory = "GB_16"
	OpenSearchMemoryGB32 OpenSearchMemory = "GB_32"
	OpenSearchMemoryGB64 OpenSearchMemory = "GB_64"
)

func (OpenSearchMemory) IsValid

func (e OpenSearchMemory) IsValid() bool

func (OpenSearchMemory) MarshalGQL

func (e OpenSearchMemory) MarshalGQL(w io.Writer)

func (OpenSearchMemory) String

func (e OpenSearchMemory) String() string

func (*OpenSearchMemory) UnmarshalGQL

func (e *OpenSearchMemory) UnmarshalGQL(v any) error

type OpenSearchMetadataInput

type OpenSearchMetadataInput struct {
	Name            string    `json:"name"`
	EnvironmentName string    `json:"environmentName"`
	TeamSlug        slug.Slug `json:"teamSlug"`
}

func (*OpenSearchMetadataInput) Validate

func (v *OpenSearchMetadataInput) Validate(ctx context.Context) error

func (*OpenSearchMetadataInput) ValidationErrors

type OpenSearchOrder

type OpenSearchOrder struct {
	Field     OpenSearchOrderField `json:"field"`
	Direction model.OrderDirection `json:"direction"`
}

type OpenSearchOrderField

type OpenSearchOrderField string

func (OpenSearchOrderField) IsValid

func (e OpenSearchOrderField) IsValid() bool

func (OpenSearchOrderField) MarshalGQL

func (e OpenSearchOrderField) MarshalGQL(w io.Writer)

func (OpenSearchOrderField) String

func (e OpenSearchOrderField) String() string

func (*OpenSearchOrderField) UnmarshalGQL

func (e *OpenSearchOrderField) UnmarshalGQL(v any) error

type OpenSearchState

type OpenSearchState int
const (
	OpenSearchStateUnknown OpenSearchState = iota
	OpenSearchStateRunning
	OpenSearchStateRebalancing
	OpenSearchStateRebuilding
	OpenSearchStatePoweroff
)

func State

func State(ctx context.Context, os *OpenSearch) (OpenSearchState, error)

func (OpenSearchState) IsValid

func (e OpenSearchState) IsValid() bool

func (OpenSearchState) MarshalGQL

func (e OpenSearchState) MarshalGQL(w io.Writer)

func (OpenSearchState) String

func (e OpenSearchState) String() string

func (*OpenSearchState) UnmarshalGQL

func (e *OpenSearchState) UnmarshalGQL(v any) error

type OpenSearchStatus

type OpenSearchStatus struct {
	State      string             `json:"state"`
	Conditions []metav1.Condition `json:"conditions"`
}

type OpenSearchTier

type OpenSearchTier string
const (
	OpenSearchTierSingleNode       OpenSearchTier = "SINGLE_NODE"
	OpenSearchTierHighAvailability OpenSearchTier = "HIGH_AVAILABILITY"
)

func (OpenSearchTier) IsValid

func (e OpenSearchTier) IsValid() bool

func (OpenSearchTier) MarshalGQL

func (e OpenSearchTier) MarshalGQL(w io.Writer)

func (OpenSearchTier) String

func (e OpenSearchTier) String() string

func (*OpenSearchTier) UnmarshalGQL

func (e *OpenSearchTier) UnmarshalGQL(v any) error

type OpenSearchTierFacetItem

type OpenSearchTierFacetItem struct {
	Tier  OpenSearchTier `json:"tier"`
	Count int            `json:"count"`
}

type OpenSearchUpdatedActivityLogEntry

type OpenSearchUpdatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *OpenSearchUpdatedActivityLogEntryData `json:"data"`
}

type OpenSearchUpdatedActivityLogEntryData

type OpenSearchUpdatedActivityLogEntryData struct {
	UpdatedFields []*OpenSearchUpdatedActivityLogEntryDataUpdatedField `json:"updatedFields"`
}

type OpenSearchUpdatedActivityLogEntryDataUpdatedField

type OpenSearchUpdatedActivityLogEntryDataUpdatedField struct {
	Field    string  `json:"field"`
	OldValue *string `json:"oldValue,omitempty"`
	NewValue *string `json:"newValue,omitempty"`
}

type OpenSearchVersion

type OpenSearchVersion struct {
	Actual       *string                `json:"actual,omitempty"`
	DesiredMajor OpenSearchMajorVersion `json:"desiredMajor"`
}

func GetOpenSearchVersion

func GetOpenSearchVersion(ctx context.Context, os *OpenSearch) (*OpenSearchVersion, error)

type StorageGB

type StorageGB int

func StorageGBFromAivenString

func StorageGBFromAivenString(s string) (StorageGB, error)

func (StorageGB) MarshalGQL

func (o StorageGB) MarshalGQL(w io.Writer)

func (StorageGB) String

func (o StorageGB) String() string

func (StorageGB) ToAivenString

func (o StorageGB) ToAivenString() string

func (*StorageGB) UnmarshalGQL

func (o *StorageGB) UnmarshalGQL(v any) error

type TeamInventoryCountOpenSearches

type TeamInventoryCountOpenSearches struct {
	Total int
}

type UpdateOpenSearchInput

type UpdateOpenSearchInput struct {
	OpenSearchInput
	Labels []*model.ResourceLabel `json:"labels,omitempty"`
}

func (*UpdateOpenSearchInput) Validate

func (i *UpdateOpenSearchInput) Validate(ctx context.Context) error

type UpdateOpenSearchPayload

type UpdateOpenSearchPayload struct {
	OpenSearch *OpenSearch `json:"openSearch"`
}

Jump to

Keyboard shortcuts

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