osd

package
v0.0.0-...-93e563e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package osd allows for the creation and management of OSD clusters.

Index

Constants

View Source
const (
	// APIVersion is the version of the OSD API to use.
	APIVersion = "v1"

	// TokenURL specifies the endpoint used to create access tokens.
	TokenURL = "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token"

	// ClientID is used to identify the client to OSD.
	ClientID = "cloud-services"
)
View Source
const (
	// DefaultFlavour is used when no specialized configuration exists.
	DefaultFlavour = "4"
)
View Source
const (
	// ResourceAWSCluster is the quota resource type for a cluster on AWS.
	ResourceAWSCluster = "cluster.aws"
)
View Source
const (

	// VersionPrefix is the string that every OSD version begins with.
	VersionPrefix = "openshift-"
)

Variables

View Source
var Environments = environments{

	"": "int",

	"int":   "https://api-integration.6943.hive-integration.openshiftapps.com",
	"stage": "https://api.stage.openshift.com",
	"prod":  "https://api.openshift.com",
}

Environments are known instance of OSD.

Functions

func HasQuotaFor

func HasQuotaFor(q *accounts.ResourceQuota, cfg *config.Config, resourceType, machineType string) bool

HasQuotaFor the desired configuration. If machineT is empty a default will try to be selected.

Types

type OSD

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

OSD acts as a client to manage an instance.

func New

func New(token, env string, debug bool) (*OSD, error)

New setups a client to connect to OSD.

func (*OSD) CheckQuota

func (u *OSD) CheckQuota(cfg *config.Config) (bool, error)

CheckQuota determines if enough quota is available to launch with cfg.

func (*OSD) ClusterKubeconfig

func (u *OSD) ClusterKubeconfig(clusterID string) (kubeconfig []byte, err error)

ClusterKubeconfig retrieves the kubeconfig of clusterID.

func (*OSD) ClusterState

func (u *OSD) ClusterState(clusterID string) (v1.ClusterState, error)

ClusterState retrieves the state of clusterID.

func (*OSD) CurrentAccount

func (u *OSD) CurrentAccount() (*accounts.Account, error)

CurrentAccount returns the current account being used.

func (*OSD) CurrentAccountQuota

func (u *OSD) CurrentAccountQuota() (*accounts.ResourceQuotaList, error)

CurrentAccountQuota returns quota available for the current account's organization in the environment.

func (*OSD) DefaultVersion

func (u *OSD) DefaultVersion() (string, error)

DefaultVersion returns the default version currently offered by OSD.

func (*OSD) DeleteCluster

func (u *OSD) DeleteCluster(clusterID string) error

DeleteCluster requests the deletion of clusterID.

func (*OSD) Flavour

func (u *OSD) Flavour(cfg *config.Config) string

Flavour returns the default flavour for cfg.

func (*OSD) FullLogs

func (u *OSD) FullLogs(clusterID string, ids ...string) (map[string][]byte, error)

FullLogs returns as much Logs as it can.

func (*OSD) GetCluster

func (u *OSD) GetCluster(clusterID string) (*v1.Cluster, error)

GetCluster returns the information about clusterID.

func (*OSD) LatestPrerelease

func (u *OSD) LatestPrerelease(major, minor int64, str string) (string, error)

LatestPrerelease gets latest prerelease containing str for major and minor versions. Negative versions match all.

func (*OSD) LaunchCluster

func (u *OSD) LaunchCluster(cfg *config.Config) (string, error)

LaunchCluster setups an new cluster using the OSD API and returns it's ID.

func (*OSD) Logs

func (u *OSD) Logs(clusterID string, length int, ids ...string) (logs map[string][]byte, err error)

Logs provides all logs available for clusterID, ids can be optionally provided for only specific logs.

func (*OSD) PreviousVersion

func (u *OSD) PreviousVersion(verStr string) (string, error)

PreviousVersion returns the first available previous version for the given version.

func (*OSD) WaitForClusterReady

func (u *OSD) WaitForClusterReady(clusterID string, timeout time.Duration) error

WaitForClusterReady blocks until clusterID is ready or a number of retries has been attempted.

Jump to

Keyboard shortcuts

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