pkg

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const StdinBufferSize = 4096

Variables

This section is empty.

Functions

func CheckAvailableNewVersion

func CheckAvailableNewVersion() (bool, string, string)

func DeleteClusterById added in v0.42.1

func DeleteClusterById(clusterId string, dryRunDisabled bool)

func DeleteClusterUnDeployedInError added in v0.44.4

func DeleteClusterUnDeployedInError()

func DeleteOldClustersWithInvalidCredentials added in v0.73.0

func DeleteOldClustersWithInvalidCredentials(ageInDay int, dryRunDisabled bool)

func DeleteOrganizationByClusterId

func DeleteOrganizationByClusterId(clusterId string, dryRunDisabled bool)

func DeleteProjectById added in v0.46.4

func DeleteProjectById(projectId string, dryRunDisabled bool)

func DeployAll

func DeployAll(dryRunDisabled bool)

func DeployById

func DeployById(clusterId string, dryRunDisabled bool)

func DeployClustersByBatch added in v0.83.0

func DeployClustersByBatch(listService AdminClusterListService, deployService AdminClusterBatchDeployService) error

func DeployFailedClusters added in v0.48.4

func DeployFailedClusters()

func DoRequestUserToAuthenticate added in v0.84.2

func DoRequestUserToAuthenticate(headless bool)

func ExecLog added in v0.64.0

func ExecLog(req *LogRequest)

func ExecPortForward added in v0.77.0

func ExecPortForward(req *PortForwardRequest)

func ExecShell

func ExecShell(req *ShellRequest)

func ForceFailedDeploymentsToInternalErrorStatus added in v0.64.0

func ForceFailedDeploymentsToInternalErrorStatus()

func GetCurrentVersion

func GetCurrentVersion() string

func GetLatestOnlineVersionNumber

func GetLatestOnlineVersionNumber() (string, error)

func GetLatestOnlineVersionUrl

func GetLatestOnlineVersionUrl() (string, error)

func GetVarsByClusterId

func GetVarsByClusterId(clusterID string) []utils.Var

func ListClusters added in v0.83.0

func ListClusters(listService AdminClusterListService) error

func LockById

func LockById(clusterId string, reason string)

func LockedClusters

func LockedClusters()

func PrintClustersTable added in v0.83.0

func PrintClustersTable(clusters []ClusterDetails) error

PrintClustersTable global method to output clusters table

func RetryQoveryClientApiRequestOnUnauthorized added in v0.84.2

func RetryQoveryClientApiRequestOnUnauthorized[T any](request QoveryClientApiRequest[T]) (*T, *http.Response, error)

RetryQoveryClientApiRequestOnUnauthorized To be able to ask for re-auth when first attempt leads to unauthorized

func UnockById

func UnockById(clusterId string)

func UpdateAll

func UpdateAll(dryRunDisabled bool, version string, providerKind string, parallelRun int)

func UpdateById

func UpdateById(clusterId string, dryRunDisabled bool, version string)

Types

type AdminClusterBatchDeployService added in v0.83.0

type AdminClusterBatchDeployService interface {
	Deploy(clusters []ClusterDetails) (*ClusterBatchDeployResult, error)
	PrintParameters()
}

type AdminClusterBatchDeployServiceImpl added in v0.83.0

type AdminClusterBatchDeployServiceImpl struct {
	// DryRunDisabled disable dry run
	DryRunDisabled bool
	// ParallelRun the number of parallel requests to be processed
	ParallelRun int
	// RefreshDelay the delay to fetch cluster status in process
	RefreshDelay int
	// CompleteBatchBeforeContinue to block on N parallel runs to be processed: true = 'batch' mode / false = 'on-the-fly' mode
	CompleteBatchBeforeContinue bool
	// UpgradeClusterNewK8sVersion indicates next version to trigger a cluster upgrade
	UpgradeClusterNewK8sVersion *string
	// UpgradeMode indicates if the cluster needs to be upgraded
	UpgradeMode bool
}

func NewAdminClusterBatchDeployServiceImpl added in v0.83.0

func NewAdminClusterBatchDeployServiceImpl(
	dryRun bool,
	parallelRun int,
	refreshDelay int,
	executionMode string,
	newK8sversionStr string,
) (*AdminClusterBatchDeployServiceImpl, error)

func (AdminClusterBatchDeployServiceImpl) Deploy added in v0.83.0

func (AdminClusterBatchDeployServiceImpl) PrintParameters added in v0.83.0

func (service AdminClusterBatchDeployServiceImpl) PrintParameters()

type AdminClusterListService added in v0.83.0

type AdminClusterListService interface {
	SelectClusters() ([]ClusterDetails, error)
}

type AdminClusterListServiceImpl added in v0.83.0

type AdminClusterListServiceImpl struct {
	// Filters based on ClusterDetails struct fields (reflection is used to filter fields)
	Filters map[string]string
}

func NewAdminClusterListServiceImpl added in v0.83.0

func NewAdminClusterListServiceImpl(filters map[string]string) (*AdminClusterListServiceImpl, error)

func (AdminClusterListServiceImpl) SelectClusters added in v0.83.0

func (service AdminClusterListServiceImpl) SelectClusters() ([]ClusterDetails, error)

type ClusterBatchDeployResult added in v0.83.0

type ClusterBatchDeployResult struct {
	// ProcessedClusters clusters that have been processed, non matter the final state created
	ProcessedClusters []ClusterDetails
	// PendingClusters clusters in the pending queue (their state were not in ready state)
	PendingClusters []ClusterDetails
}

type ClusterDetails added in v0.83.0

type ClusterDetails struct {
	OrganizationId        string `json:"organization_id"`
	OrganizationName      string `json:"organization_name"`
	OrganizationPlan      string `json:"organization_plan"`
	ClusterId             string `json:"cluster_id"`
	ClusterName           string `json:"cluster_name"`
	ClusterType           string `json:"cluster_type"`
	ClusterCreatedAt      string `json:"cluster_created_at"`
	ClusterLastDeployedAt string `json:"cluster_last_deployed_at"`
	ClusterK8sVersion     string `json:"cluster_k8s_version"`
	Mode                  string `json:"mode"`
	IsProduction          bool   `json:"is_production"`
	CurrentStatus         string `json:"current_status"`
}

type DeviceFlowParameters added in v0.84.2

type DeviceFlowParameters struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationUri         string `json:"verification_uri"`
	VerificationUriComplete string `json:"verification_uri_complete"`
	ExpiresIn               int64  `json:"expires_in"`
	Interval                int64  `json:"interval"`
}

type ListOfClustersEligibleToUpdate added in v0.83.0

type ListOfClustersEligibleToUpdate struct {
	Results []ClusterDetails
}

type ListPodResponse added in v0.78.0

type ListPodResponse struct {
	Pods []PodResponse
}

func ExecListPods added in v0.78.0

func ExecListPods(req *PortForwardRequest) (*ListPodResponse, error)

type LogMessage added in v0.64.0

type LogMessage struct {
	CreatedAt Timestamp `json:"created_at"`
	Message   string    `json:"message"`
	Version   string    `json:"version"`
	PodName   string    `json:"pod_name"`
}

type LogRequest added in v0.64.0

type LogRequest struct {
	ServiceID      utils.Id
	EnvironmentID  utils.Id
	ProjectID      utils.Id
	OrganizationID utils.Id
	ClusterID      utils.Id
	RawFormat      bool
}

type PodResponse added in v0.78.0

type PodResponse struct {
	Name  string
	Ports []uint16
}

type PortForwardRequest added in v0.77.0

type PortForwardRequest struct {
	ServiceID      utils.Id `url:"service"`
	EnvironmentID  utils.Id `url:"environment"`
	ProjectID      utils.Id `url:"project"`
	OrganizationID utils.Id `url:"organization"`
	ClusterID      utils.Id `url:"cluster"`
	PodName        string   `url:"pod_name,omitempty"`
	ServiceType    string   `url:"service_type"`
	Port           uint16   `url:"port"`
	LocalPort      uint16
}

type QoveryClientApiRequest added in v0.84.2

type QoveryClientApiRequest[T any] func(needToRefetchClient bool) (*T, *http.Response, error)

type ShellRequest

type ShellRequest struct {
	ServiceID      utils.Id `url:"service"`
	EnvironmentID  utils.Id `url:"environment"`
	ProjectID      utils.Id `url:"project"`
	OrganizationID utils.Id `url:"organization"`
	ClusterID      utils.Id `url:"cluster"`
	PodName        string   `url:"pod_name,omitempty"`
	ContainerName  string   `url:"container_name,omitempty"`
	Command        []string `url:"command"`
	TtyWidth       uint16   `url:"tty_width"`
	TtyHeight      uint16   `url:"tty_height"`
}

type Timestamp added in v0.64.0

type Timestamp struct {
	time.Time
}

func (*Timestamp) UnmarshalJSON added in v0.64.0

func (p *Timestamp) UnmarshalJSON(bytes []byte) error

UnmarshalJSON decodes an int64 timestamp into a time.Time object

type TokensResponse added in v0.84.2

type TokensResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type WebsocketPortForward added in v0.77.0

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

func (WebsocketPortForward) Read added in v0.77.0

func (w WebsocketPortForward) Read(p []byte) (n int, err error)

func (WebsocketPortForward) Write added in v0.77.0

func (w WebsocketPortForward) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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