client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TIMEOUT is default timeout used by Power VS client for operations like DeleteInstance
	TIMEOUT = time.Hour

	//DefaultCredentialNamespace is the default namespace used to create a client object
	DefaultCredentialNamespace = "openshift-machine-api"
	//DefaultCredentialSecret is the credential secret name used by node update controller to fetch API key
	DefaultCredentialSecret = "powervs-credentials"

	//InstanceStateNameShutoff is indicates the shutoff state of Power VS instance
	InstanceStateNameShutoff = "SHUTOFF"
	//InstanceStateNameActive is indicates the active state of Power VS instance
	InstanceStateNameActive = "ACTIVE"
	//InstanceStateNameBuild is indicates the build state of Power VS instance
	InstanceStateNameBuild = "BUILD"

	//PowerServiceType is the power-iaas service type of IBM Cloud
	PowerServiceType = "power-iaas"
)

Variables

View Source
var (
	//ErrorInstanceNotFound is error type for Instance Not Found
	ErrorInstanceNotFound = errors.New("instance Not Found")
)

Functions

func FormatProviderID

func FormatProviderID(region, zone, serviceInstanceID, vmInstanceID string) string

FormatProviderID formats and returns the provided instanceID

func GetAPIKey

func GetAPIKey(ctrlRuntimeClient client.Client, secretName, namespace string) (apikey string, err error)

GetAPIKey will return the api key read from given secretName in a given namespace

Types

type Client

type Client interface {
	CreateInstance(createParams *models.PVMInstanceCreate) (*models.PVMInstanceList, error)
	GetInstance(id string) (*models.PVMInstance, error)
	GetInstanceByName(name string) (*models.PVMInstance, error)
	GetInstances() (*models.PVMInstances, error)
	DeleteInstance(id string) error
	GetImages() (*models.Images, error)
	GetNetworks() (*models.Networks, error)
	GetCloudServiceInstances() ([]bluemixmodels.ServiceInstanceV2, error)

	GetZone() string
	GetRegion() string
}

Client is a wrapper object for actual PowerVS SDK clients to allow for easier testing.

func NewValidatedClient

func NewValidatedClient(ctrlRuntimeClient client.Client, secretName, namespace, cloudInstanceID string, debug bool) (Client, error)

NewValidatedClient creates and return a new Power VS client

type PowerVSClientBuilderFuncType

type PowerVSClientBuilderFuncType func(client client.Client, secretName, namespace, cloudInstanceID string,
	debug bool) (Client, error)

PowerVSClientBuilderFuncType is function type for building the Power VS client

type User

type User struct {
	ID      string
	Email   string
	Account string
	// contains filtered or unexported fields
}

User is used to hold the user details

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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