Help us shape the future of Go! Take the 2026 Go Developer Survey

compute

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Devicename

func Devicename(index int) (string, error)

func HashInstanceSpec

func HashInstanceSpec(computeInstance *InstanceSpec) (string, error)

Types

type InstanceIdentifier

type InstanceIdentifier struct {
	ID   string
	Name string
}

InstanceIdentifier describes an instance which has not necessarily been fetched.

type InstanceNetworkStatus

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

InstanceNetworkStatus represents the network status of an OpenStack instance as used by CAPO. Therefore it may use more context than just data which was returned by OpenStack.

func (*InstanceNetworkStatus) Addresses

func (ns *InstanceNetworkStatus) Addresses() []corev1.NodeAddress

Addresses returns a list of NodeAddresses containing all addresses which will be reported on the OpenStackMachine object.

func (*InstanceNetworkStatus) FloatingIP

func (ns *InstanceNetworkStatus) FloatingIP(networkName string) string

FloatingIP returns the first listed floating ip of an instance for the given network name.

func (*InstanceNetworkStatus) IP

func (ns *InstanceNetworkStatus) IP(networkName string) string

IP returns the first listed ip of an instance for the given network name.

type InstanceSpec

type InstanceSpec struct {
	Name                      string
	Image                     string
	ImageUUID                 string
	Flavor                    string
	SSHKeyName                string
	UserData                  string
	Metadata                  map[string]string
	ConfigDrive               bool
	FailureDomain             string
	RootVolume                *infrav1.RootVolume
	CustomeVolumes            []*infrav1.RootVolume
	Subnet                    string
	ServerGroupID             string
	Trunk                     bool
	Tags                      []string
	SecurityGroups            []infrav1.SecurityGroupParam
	Networks                  []infrav1.NetworkParam
	Ports                     []infrav1.PortOpts
	DeleteVolumeOnTermination bool
}

InstanceSpec defines the fields which can be set on a new OpenStack instance.

InstanceSpec does not contain all of the fields of infrav1.Instance, as not all of them can be set on a new instance.

type InstanceStatus

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

InstanceStatus represents instance data which has been returned by OpenStack.

func NewInstanceStatusFromServer

func NewInstanceStatusFromServer(server *clients.ServerExt, logger logr.Logger) *InstanceStatus

func (*InstanceStatus) APIInstance

func (is *InstanceStatus) APIInstance(openStackCluster *infrav1.OpenStackCluster) (*infrav1.Instance, error)

APIInstance returns an infrav1.Instance object for use by the API.

func (*InstanceStatus) AvailabilityZone

func (is *InstanceStatus) AvailabilityZone() string

func (*InstanceStatus) ID

func (is *InstanceStatus) ID() string

func (*InstanceStatus) InstanceIdentifier

func (is *InstanceStatus) InstanceIdentifier() *InstanceIdentifier

InstanceIdentifier returns an InstanceIdentifier object for an InstanceStatus.

func (*InstanceStatus) Name

func (is *InstanceStatus) Name() string

func (*InstanceStatus) NetworkStatus

func (is *InstanceStatus) NetworkStatus() (*InstanceNetworkStatus, error)

NetworkStatus returns an InstanceNetworkStatus object for an InstanceStatus.

func (*InstanceStatus) SSHKeyName

func (is *InstanceStatus) SSHKeyName() string

func (*InstanceStatus) State

func (is *InstanceStatus) State() infrav1.InstanceState

type Service

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

func NewService

func NewService(scope *scope.Scope) (*Service, error)

NewService returns an instance of the compute service.

func (*Service) CreateInstance

func (s *Service) CreateInstance(eventObject runtime.Object, openStackCluster *infrav1.OpenStackCluster, instanceSpec *InstanceSpec, clusterName string) (*InstanceStatus, error)

func (*Service) DeleteInstance

func (s *Service) DeleteInstance(eventObject runtime.Object, instanceStatus *InstanceStatus, instanceName string, rootVolume *infrav1.RootVolume) error

func (*Service) GetAvailabilityZones

func (s *Service) GetAvailabilityZones() ([]availabilityzones.AvailabilityZone, error)

func (*Service) GetInstanceStatus

func (s *Service) GetInstanceStatus(resourceID string) (instance *InstanceStatus, err error)

func (*Service) GetInstanceStatusByName

func (s *Service) GetInstanceStatusByName(eventObject runtime.Object, name string) (instance *InstanceStatus, err error)

func (*Service) GetManagementPort

func (s *Service) GetManagementPort(openStackCluster *infrav1.OpenStackCluster, instanceStatus *InstanceStatus) (*ports.Port, error)

GetManagementPort returns the port which is used for management and external traffic. Cluster floating IPs must be associated with this port.

Jump to

Keyboard shortcuts

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