compute

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Overview

Package compute is a generated GoMock package.

Index

Constants

View Source
const NovaMinimumMicroversion = "2.53"

NovaMinimumMicroversion is the minimum Nova microversion supported by CAPO 2.53 corresponds to OpenStack Pike

For the canonical description of Nova microversions, see https://docs.openstack.org/nova/latest/reference/api-microversion-history.html

CAPO uses server tags, which were added in microversion 2.52.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.5.1

type Client interface {
	ListAvailabilityZones() ([]availabilityzones.AvailabilityZone, error)

	ListImages(listOpts images.ListOptsBuilder) ([]images.Image, error)

	GetFlavorIDFromName(flavor string) (string, error)
	CreateServer(createOpts servers.CreateOptsBuilder) (*ServerExt, error)
	DeleteServer(serverID string) error
	GetServer(serverID string) (*ServerExt, error)
	ListServers(listOpts servers.ListOptsBuilder) ([]ServerExt, error)

	ListAttachedInterfaces(serverID string) ([]attachinterfaces.Interface, error)
	DeleteAttachedInterface(serverID, portID string) error

	ListVolumes(opts volumes.ListOptsBuilder) ([]volumes.Volume, error)
	CreateVolume(opts volumes.CreateOptsBuilder) (*volumes.Volume, error)
	DeleteVolume(volumeID string, opts volumes.DeleteOptsBuilder) error
	GetVolume(volumeID string) (*volumes.Volume, error)
}

type InstanceIdentifier added in v0.5.0

type InstanceIdentifier struct {
	ID   string
	Name string
}

InstanceIdentifier describes an instance which has not necessarily been fetched.

type InstanceNetworkStatus added in v0.5.0

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 added in v0.5.0

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 added in v0.5.0

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 added in v0.5.0

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

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

type InstanceSpec added in v0.5.0

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
	Subnet         string
	ServerGroupID  string
	Trunk          bool
	Tags           []string
	SecurityGroups []infrav1.SecurityGroupParam
	Networks       []infrav1.NetworkParam
	Ports          []infrav1.PortOpts
}

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 added in v0.5.0

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

InstanceStatus represents instance data which has been returned by OpenStack.

func NewInstanceStatusFromServer added in v0.5.0

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

func (*InstanceStatus) APIInstance added in v0.5.0

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

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

func (*InstanceStatus) AvailabilityZone added in v0.5.0

func (is *InstanceStatus) AvailabilityZone() string

func (*InstanceStatus) ID added in v0.5.0

func (is *InstanceStatus) ID() string

func (*InstanceStatus) InstanceIdentifier added in v0.5.0

func (is *InstanceStatus) InstanceIdentifier() *InstanceIdentifier

InstanceIdentifier returns an InstanceIdentifier object for an InstanceStatus.

func (*InstanceStatus) Name added in v0.5.0

func (is *InstanceStatus) Name() string

func (*InstanceStatus) NetworkStatus added in v0.5.0

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

NetworkStatus returns an InstanceNetworkStatus object for an InstanceStatus.

func (*InstanceStatus) SSHKeyName added in v0.5.0

func (is *InstanceStatus) SSHKeyName() string

func (*InstanceStatus) State added in v0.5.0

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

type MockClient added in v0.5.1

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

MockClient is a mock of Client interface.

func NewMockClient added in v0.5.1

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) CreateServer added in v0.5.1

func (m *MockClient) CreateServer(arg0 servers.CreateOptsBuilder) (*ServerExt, error)

CreateServer mocks base method.

func (*MockClient) CreateVolume added in v0.5.1

func (m *MockClient) CreateVolume(arg0 volumes.CreateOptsBuilder) (*volumes.Volume, error)

CreateVolume mocks base method.

func (*MockClient) DeleteAttachedInterface added in v0.5.1

func (m *MockClient) DeleteAttachedInterface(arg0, arg1 string) error

DeleteAttachedInterface mocks base method.

func (*MockClient) DeleteServer added in v0.5.1

func (m *MockClient) DeleteServer(arg0 string) error

DeleteServer mocks base method.

func (*MockClient) DeleteVolume added in v0.5.1

func (m *MockClient) DeleteVolume(arg0 string, arg1 volumes.DeleteOptsBuilder) error

DeleteVolume mocks base method.

func (*MockClient) EXPECT added in v0.5.1

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GetFlavorIDFromName added in v0.5.1

func (m *MockClient) GetFlavorIDFromName(arg0 string) (string, error)

GetFlavorIDFromName mocks base method.

func (*MockClient) GetServer added in v0.5.1

func (m *MockClient) GetServer(arg0 string) (*ServerExt, error)

GetServer mocks base method.

func (*MockClient) GetVolume added in v0.5.1

func (m *MockClient) GetVolume(arg0 string) (*volumes.Volume, error)

GetVolume mocks base method.

func (*MockClient) ListAttachedInterfaces added in v0.5.1

func (m *MockClient) ListAttachedInterfaces(arg0 string) ([]attachinterfaces.Interface, error)

ListAttachedInterfaces mocks base method.

func (*MockClient) ListAvailabilityZones added in v0.5.1

func (m *MockClient) ListAvailabilityZones() ([]availabilityzones.AvailabilityZone, error)

ListAvailabilityZones mocks base method.

func (*MockClient) ListImages added in v0.5.1

func (m *MockClient) ListImages(arg0 images.ListOptsBuilder) ([]images.Image, error)

ListImages mocks base method.

func (*MockClient) ListServers added in v0.5.1

func (m *MockClient) ListServers(arg0 servers.ListOptsBuilder) ([]ServerExt, error)

ListServers mocks base method.

func (*MockClient) ListVolumes added in v0.5.1

func (m *MockClient) ListVolumes(arg0 volumes.ListOptsBuilder) ([]volumes.Volume, error)

ListVolumes mocks base method.

type MockClientMockRecorder added in v0.5.1

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) CreateServer added in v0.5.1

func (mr *MockClientMockRecorder) CreateServer(arg0 interface{}) *gomock.Call

CreateServer indicates an expected call of CreateServer.

func (*MockClientMockRecorder) CreateVolume added in v0.5.1

func (mr *MockClientMockRecorder) CreateVolume(arg0 interface{}) *gomock.Call

CreateVolume indicates an expected call of CreateVolume.

func (*MockClientMockRecorder) DeleteAttachedInterface added in v0.5.1

func (mr *MockClientMockRecorder) DeleteAttachedInterface(arg0, arg1 interface{}) *gomock.Call

DeleteAttachedInterface indicates an expected call of DeleteAttachedInterface.

func (*MockClientMockRecorder) DeleteServer added in v0.5.1

func (mr *MockClientMockRecorder) DeleteServer(arg0 interface{}) *gomock.Call

DeleteServer indicates an expected call of DeleteServer.

func (*MockClientMockRecorder) DeleteVolume added in v0.5.1

func (mr *MockClientMockRecorder) DeleteVolume(arg0, arg1 interface{}) *gomock.Call

DeleteVolume indicates an expected call of DeleteVolume.

func (*MockClientMockRecorder) GetFlavorIDFromName added in v0.5.1

func (mr *MockClientMockRecorder) GetFlavorIDFromName(arg0 interface{}) *gomock.Call

GetFlavorIDFromName indicates an expected call of GetFlavorIDFromName.

func (*MockClientMockRecorder) GetServer added in v0.5.1

func (mr *MockClientMockRecorder) GetServer(arg0 interface{}) *gomock.Call

GetServer indicates an expected call of GetServer.

func (*MockClientMockRecorder) GetVolume added in v0.5.1

func (mr *MockClientMockRecorder) GetVolume(arg0 interface{}) *gomock.Call

GetVolume indicates an expected call of GetVolume.

func (*MockClientMockRecorder) ListAttachedInterfaces added in v0.5.1

func (mr *MockClientMockRecorder) ListAttachedInterfaces(arg0 interface{}) *gomock.Call

ListAttachedInterfaces indicates an expected call of ListAttachedInterfaces.

func (*MockClientMockRecorder) ListAvailabilityZones added in v0.5.1

func (mr *MockClientMockRecorder) ListAvailabilityZones() *gomock.Call

ListAvailabilityZones indicates an expected call of ListAvailabilityZones.

func (*MockClientMockRecorder) ListImages added in v0.5.1

func (mr *MockClientMockRecorder) ListImages(arg0 interface{}) *gomock.Call

ListImages indicates an expected call of ListImages.

func (*MockClientMockRecorder) ListServers added in v0.5.1

func (mr *MockClientMockRecorder) ListServers(arg0 interface{}) *gomock.Call

ListServers indicates an expected call of ListServers.

func (*MockClientMockRecorder) ListVolumes added in v0.5.1

func (mr *MockClientMockRecorder) ListVolumes(arg0 interface{}) *gomock.Call

ListVolumes indicates an expected call of ListVolumes.

type ServerExt added in v0.5.0

ServerExt is the base gophercloud Server with extensions used by InstanceStatus.

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 added in v0.3.5

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

func (*Service) DeleteInstance added in v0.3.5

func (s *Service) DeleteInstance(eventObject runtime.Object, instanceSpec *InstanceSpec, instanceStatus *InstanceStatus) error

func (*Service) GetAvailabilityZones added in v0.3.0

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

func (*Service) GetInstanceStatus added in v0.5.0

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

func (*Service) GetInstanceStatusByName added in v0.5.0

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

func (*Service) GetManagementPort added in v0.5.0

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