scope

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const TIMEOUT = 1 * time.Hour

TIMEOUT is used while creating IBM Power VS client

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterScope

type ClusterScope struct {
	logr.Logger

	IBMVPCClients
	Cluster       *clusterv1.Cluster
	IBMVPCCluster *infrav1.IBMVPCCluster
	// contains filtered or unexported fields
}

ClusterScope defines a scope defined around a cluster.

func NewClusterScope

func NewClusterScope(params ClusterScopeParams, authenticator core.Authenticator, svcEndpoint string) (*ClusterScope, error)

NewClusterScope creates a new ClusterScope from the supplied parameters.

func (*ClusterScope) Close

func (s *ClusterScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*ClusterScope) CreateSubnet

func (s *ClusterScope) CreateSubnet() (*vpcv1.Subnet, error)

CreateSubnet creates a subnet within provided vpc and zone

func (*ClusterScope) CreateVPC

func (s *ClusterScope) CreateVPC() (*vpcv1.VPC, error)

CreateVPC creates a new IBM VPC in specified resource group

func (*ClusterScope) DeleteFloatingIP

func (s *ClusterScope) DeleteFloatingIP() error

DeleteFloatingIP deletes a Floating IP associated with floating ip id

func (*ClusterScope) DeleteSubnet

func (s *ClusterScope) DeleteSubnet() error

DeleteSubnet deletes a subnet associated with subnet id

func (*ClusterScope) DeleteVPC

func (s *ClusterScope) DeleteVPC() error

DeleteVPC deletes IBM VPC associated with a VPC id

func (*ClusterScope) PatchObject

func (s *ClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

func (*ClusterScope) ReserveFIP

func (s *ClusterScope) ReserveFIP() (*vpcv1.FloatingIP, error)

ReserveFIP creates a Floating IP in a provided resource group and zone

type ClusterScopeParams

type ClusterScopeParams struct {
	IBMVPCClients
	Client        client.Client
	Logger        logr.Logger
	Cluster       *clusterv1.Cluster
	IBMVPCCluster *infrav1.IBMVPCCluster
}

ClusterScopeParams defines the input parameters used to create a new ClusterScope.

type IBMPowerVSClient

type IBMPowerVSClient struct {
	InstanceClient *instance.IBMPIInstanceClient
	NetworkClient  *instance.IBMPINetworkClient
	ImageClient    *instance.IBMPIImageClient
	// contains filtered or unexported fields
}

IBMPowerVSClient used to store IBM Power VS client information

func NewIBMPowerVSClient

func NewIBMPowerVSClient(token, account, cloudInstanceID, region, zone string, debug bool) (_ *IBMPowerVSClient, err error)

NewIBMPowerVSClient creates and returns a IBM Power VS client

type IBMVPCClients

type IBMVPCClients struct {
	VPCService *vpcv1.VpcV1
}

IBMVPCClients hosts the IBM VPC service

type MachineScope

type MachineScope struct {
	logr.Logger

	IBMVPCClients
	Cluster *clusterv1.Cluster
	Machine *clusterv1.Machine

	IBMVPCCluster *infrav1.IBMVPCCluster
	IBMVPCMachine *infrav1.IBMVPCMachine
	// contains filtered or unexported fields
}

MachineScope defines a scope defined around a machine and its cluster.

func NewMachineScope

func NewMachineScope(params MachineScopeParams, authenticator core.Authenticator, svcEndpoint string) (*MachineScope, error)

NewMachineScope creates a new MachineScope from the supplied parameters.

func (*MachineScope) Close

func (m *MachineScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*MachineScope) CreateMachine

func (m *MachineScope) CreateMachine() (*vpcv1.Instance, error)

CreateMachine creates a vpc machine

func (*MachineScope) DeleteMachine

func (m *MachineScope) DeleteMachine() error

DeleteMachine deletes the vpc machine associated with machine instance id.

func (*MachineScope) GetBootstrapData

func (m *MachineScope) GetBootstrapData() (string, error)

GetBootstrapData returns the bootstrap data from the secret in the Machine's bootstrap.dataSecretName.

func (*MachineScope) GetMachine

func (m *MachineScope) GetMachine(instanceID string) (*vpcv1.Instance, error)

GetMachine returns a machine associated with a machine instanceID

func (*MachineScope) PatchObject

func (m *MachineScope) PatchObject() error

PatchObject persists the cluster configuration and status.

type MachineScopeParams

type MachineScopeParams struct {
	IBMVPCClients
	Client        client.Client
	Logger        logr.Logger
	Cluster       *clusterv1.Cluster
	Machine       *clusterv1.Machine
	IBMVPCCluster *infrav1.IBMVPCCluster
	IBMVPCMachine *infrav1.IBMVPCMachine
}

MachineScopeParams defines the input parameters used to create a new MachineScope.

type PowerVSClusterScope

type PowerVSClusterScope struct {
	logr.Logger

	IBMPowerVSClient  *IBMPowerVSClient
	Cluster           *clusterv1.Cluster
	IBMPowerVSCluster *v1alpha4.IBMPowerVSCluster
	// contains filtered or unexported fields
}

PowerVSClusterScope defines a scope defined around a Power VS Cluster.

func NewPowerVSClusterScope

func NewPowerVSClusterScope(params PowerVSClusterScopeParams) (*PowerVSClusterScope, error)

NewPowerVSClusterScope creates a new PowerVSClusterScope from the supplied parameters.

func (*PowerVSClusterScope) Close

func (s *PowerVSClusterScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*PowerVSClusterScope) PatchObject

func (s *PowerVSClusterScope) PatchObject() error

PatchObject persists the cluster configuration and status.

type PowerVSClusterScopeParams

type PowerVSClusterScopeParams struct {
	Client            client.Client
	Logger            logr.Logger
	Cluster           *clusterv1.Cluster
	IBMPowerVSCluster *v1alpha4.IBMPowerVSCluster
}

PowerVSClusterScopeParams defines the input parameters used to create a new PowerVSClusterScope.

type PowerVSMachineScope

type PowerVSMachineScope struct {
	logr.Logger

	IBMPowerVSClient  *IBMPowerVSClient
	Cluster           *clusterv1.Cluster
	Machine           *clusterv1.Machine
	IBMPowerVSCluster *v1alpha4.IBMPowerVSCluster
	IBMPowerVSMachine *v1alpha4.IBMPowerVSMachine
	// contains filtered or unexported fields
}

PowerVSMachineScope defines a scope defined around a Power VS Machine.

func NewPowerVSMachineScope

func NewPowerVSMachineScope(params PowerVSMachineScopeParams) (*PowerVSMachineScope, error)

NewPowerVSMachineScope creates a new PowerVSMachineScope from the supplied parameters.

func (*PowerVSMachineScope) Close

func (m *PowerVSMachineScope) Close() error

Close closes the current scope persisting the cluster configuration and status.

func (*PowerVSMachineScope) CreateMachine

func (m *PowerVSMachineScope) CreateMachine() (*models.PVMInstanceReference, error)

CreateMachine creates a power vs machine

func (*PowerVSMachineScope) DeleteMachine

func (m *PowerVSMachineScope) DeleteMachine() error

DeleteMachine deletes the power vs machine associated with machine instance id and service instance id.

func (*PowerVSMachineScope) GetBootstrapData

func (m *PowerVSMachineScope) GetBootstrapData() (string, error)

GetBootstrapData returns the base64 encoded bootstrap data from the secret in the Machine's bootstrap.dataSecretName

func (*PowerVSMachineScope) GetImages

func (m *PowerVSMachineScope) GetImages() (*models.Images, error)

func (*PowerVSMachineScope) GetNetworks

func (m *PowerVSMachineScope) GetNetworks() (*models.Networks, error)

func (*PowerVSMachineScope) PatchObject

func (m *PowerVSMachineScope) PatchObject() error

PatchObject persists the cluster configuration and status.

type PowerVSMachineScopeParams

type PowerVSMachineScopeParams struct {
	Logger            logr.Logger
	Client            client.Client
	Cluster           *clusterv1.Cluster
	Machine           *clusterv1.Machine
	IBMPowerVSCluster *v1alpha4.IBMPowerVSCluster
	IBMPowerVSMachine *v1alpha4.IBMPowerVSMachine
}

PowerVSMachineScopeParams defines the input parameters used to create a new PowerVSMachineScope.

Jump to

Keyboard shortcuts

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