libraries

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterID

type ClusterID struct {
	ClusterID string `json:"cluster_id,omitempty" url:"cluster_id,omitempty"`
}

TODO: make package private

type ClusterLibraryList

type ClusterLibraryList struct {
	ClusterID string    `json:"cluster_id,omitempty" url:"cluster_id,omitempty"`
	Libraries []Library `json:"libraries,omitempty" tf:"slice_set,alias:library"`
}

ClusterLibraryList is request body for install and uninstall

func (*ClusterLibraryList) Diff

Diff returns install/uninstall lists given a cluster lib status

func (*ClusterLibraryList) Sort

func (cll *ClusterLibraryList) Sort()

func (*ClusterLibraryList) String

func (cll *ClusterLibraryList) String() string

type ClusterLibraryStatuses

type ClusterLibraryStatuses struct {
	ClusterID       string          `json:"cluster_id,omitempty"`
	LibraryStatuses []LibraryStatus `json:"library_statuses,omitempty"`
}

ClusterLibraryStatuses A status will be available for all libraries installed on the cluster via the API or the libraries UI as well as libraries set to be installed on all clusters via the libraries UI. If a library has been set to be installed on all clusters, is_library_for_all_clusters will be true, even if the library was also installed on the cluster.

func (ClusterLibraryStatuses) IsRetryNeeded

func (cls ClusterLibraryStatuses) IsRetryNeeded(refresh bool) (bool, error)

IsRetryNeeded returns first bool if there needs to be retry. If there needs to be retry, error message will explain why. If retry does not need to happen and error is not nil - it failed.

func (ClusterLibraryStatuses) ToLibraryList

func (cls ClusterLibraryStatuses) ToLibraryList() ClusterLibraryList

ToLibraryList convert to envity for convenient comparison

type Cran

type Cran struct {
	Package string `json:"package"`
	Repo    string `json:"repo,omitempty"`
}

Cran is a R library hosted on Maven

type LibrariesAPI

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

LibrariesAPI exposes the Library API

func NewLibrariesAPI

func NewLibrariesAPI(ctx context.Context, m any) LibrariesAPI

NewLibrariesAPI creates LibrariesAPI instance from provider meta

func (LibrariesAPI) ClusterStatus

func (a LibrariesAPI) ClusterStatus(clusterID string) (cls ClusterLibraryStatuses, err error)

ClusterStatus returns library status in cluster

func (LibrariesAPI) Install

func (a LibrariesAPI) Install(req ClusterLibraryList) error

Install library list on cluster

func (LibrariesAPI) Uninstall

func (a LibrariesAPI) Uninstall(req ClusterLibraryList) error

Uninstall library list from cluster

func (LibrariesAPI) UpdateLibraries

func (a LibrariesAPI) UpdateLibraries(clusterID string, add, remove ClusterLibraryList, timeout time.Duration) error

func (LibrariesAPI) WaitForLibrariesInstalled

func (a LibrariesAPI) WaitForLibrariesInstalled(wait Wait) (result *ClusterLibraryStatuses, err error)

clusterID string, timeout time.Duration, isActive bool, refresh bool

type Library

type Library struct {
	Jar   string `json:"jar,omitempty" tf:"group:lib"`
	Egg   string `json:"egg,omitempty" tf:"group:lib"`
	Whl   string `json:"whl,omitempty" tf:"group:lib"`
	Pypi  *PyPi  `json:"pypi,omitempty" tf:"group:lib"`
	Maven *Maven `json:"maven,omitempty" tf:"group:lib"`
	Cran  *Cran  `json:"cran,omitempty" tf:"group:lib"`
}

Library is a construct that contains information of the location of the library and how to download it

func NewLibraryFromInstanceState

func NewLibraryFromInstanceState(i any) (lib Library)

NewLibraryFromInstanceState returns library from instance state for custom schema hash function. The thing is that for sets of types with optional subtypes resource.SerializeResourceForHash doesn't seem to predictably give consistent hashcode - that's why AWS launched TestAccClusterLibraryList is flaky. As an alternative, i tried reflect resource, but init of everything takes way more lines of code, than this thing. And this function is readable enough.

func (Library) GetID added in v1.9.1

func (library Library) GetID(clusterId string) string

func (Library) String

func (library Library) String() string

type LibraryStatus

type LibraryStatus struct {
	Library  *Library `json:"library,omitempty"`
	Status   string   `json:"status,omitempty"`
	IsGlobal bool     `json:"is_library_for_all_clusters,omitempty"`
	Messages []string `json:"messages,omitempty"`
}

LibraryStatus is the status on a given cluster when using the libraries status api

type Maven

type Maven struct {
	Coordinates string   `json:"coordinates"`
	Repo        string   `json:"repo,omitempty"`
	Exclusions  []string `json:"exclusions,omitempty"`
}

Maven is a jar library hosted on Maven

type PyPi

type PyPi struct {
	Package string `json:"package"`
	Repo    string `json:"repo,omitempty"`
}

PyPi is a python library hosted on PYPI

type Wait

type Wait struct {
	ClusterID string
	Timeout   time.Duration
	IsRunning bool
	IsRefresh bool
}

Jump to

Keyboard shortcuts

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