osclients

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const NovaMinimumMicroversion = "2.60"

NovaMinimumMicroversion is the minimum Nova microversion supported by CAPO 2.60 corresponds to OpenStack Queens

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. CAPO supports multiattach volume types, which were added in microversion 2.60.

Variables

This section is empty.

Functions

func Filter

func Filter[T any, R Result[T]](in <-chan R, filters ...func(T) bool) <-chan R

func JustOne

func JustOne[T any, R Result[*T]](in <-chan R, duplicateError error) (*T, error)

func NewResultErr

func NewResultErr[T any](err error) result[T]

func NewResultOk

func NewResultOk[T any](ok T) result[T]

Types

type ComputeClient

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

	CreateFlavor(ctx context.Context, opts flavors.CreateOptsBuilder) (*flavors.Flavor, error)
	GetFlavor(ctx context.Context, id string) (*flavors.Flavor, error)
	DeleteFlavor(ctx context.Context, id string) error
	ListFlavors(ctx context.Context, listOpts flavors.ListOptsBuilder) <-chan (Result[*flavors.Flavor])

	CreateServer(ctx context.Context, createOpts servers.CreateOptsBuilder, schedulerHints servers.SchedulerHintOptsBuilder) (*servers.Server, error)
	DeleteServer(ctx context.Context, serverID string) error
	GetServer(ctx context.Context, serverID string) (*servers.Server, error)
	ListServers(ctx context.Context, listOpts servers.ListOptsBuilder) <-chan (Result[*servers.Server])

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

	ListServerGroups() ([]servergroups.ServerGroup, error)
}

func NewComputeClient

func NewComputeClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (ComputeClient, error)

NewComputeClient returns a new compute client.

func NewComputeErrorClient

func NewComputeErrorClient(e error) ComputeClient

NewComputeErrorClient returns a ComputeClient in which every method returns the given error.

type ImageClient

type ImageClient interface {
	ListImages(listOpts images.ListOptsBuilder) ([]images.Image, error)
	GetImage(id string) (*images.Image, error)
	CreateImage(ctx context.Context, createOpts images.CreateOptsBuilder) (*images.Image, error)
	DeleteImage(ctx context.Context, id string) error
	UploadData(ctx context.Context, id string, data io.Reader) error
	GetImportInfo(ctx context.Context) (*imageimport.ImportInfo, error)
	CreateImport(ctx context.Context, id string, createOpts imageimport.CreateOptsBuilder) error
}

func NewImageClient

func NewImageClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (ImageClient, error)

NewImageClient returns a new glance client.

func NewImageErrorClient

func NewImageErrorClient(e error) ImageClient

NewImageErrorClient returns an ImageClient in which every method returns the given error.

type LbClient

type LbClient interface {
	CreateLoadBalancer(opts loadbalancers.CreateOptsBuilder) (*loadbalancers.LoadBalancer, error)
	ListLoadBalancers(opts loadbalancers.ListOptsBuilder) ([]loadbalancers.LoadBalancer, error)
	GetLoadBalancer(id string) (*loadbalancers.LoadBalancer, error)
	DeleteLoadBalancer(id string, opts loadbalancers.DeleteOptsBuilder) error
	CreateListener(opts listeners.CreateOptsBuilder) (*listeners.Listener, error)
	ListListeners(opts listeners.ListOptsBuilder) ([]listeners.Listener, error)
	UpdateListener(id string, opts listeners.UpdateOpts) (*listeners.Listener, error)
	GetListener(id string) (*listeners.Listener, error)
	DeleteListener(id string) error
	CreatePool(opts pools.CreateOptsBuilder) (*pools.Pool, error)
	ListPools(opts pools.ListOptsBuilder) ([]pools.Pool, error)
	GetPool(id string) (*pools.Pool, error)
	DeletePool(id string) error
	CreatePoolMember(poolID string, opts pools.CreateMemberOptsBuilder) (*pools.Member, error)
	ListPoolMember(poolID string, opts pools.ListMembersOptsBuilder) ([]pools.Member, error)
	DeletePoolMember(poolID string, lbMemberID string) error
	CreateMonitor(opts monitors.CreateOptsBuilder) (*monitors.Monitor, error)
	ListMonitors(opts monitors.ListOptsBuilder) ([]monitors.Monitor, error)
	DeleteMonitor(id string) error
	ListLoadBalancerProviders() ([]providers.Provider, error)
	ListOctaviaVersions() ([]apiversions.APIVersion, error)
	ListLoadBalancerFlavors() ([]flavors.Flavor, error)
}

func NewLbClient

func NewLbClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (LbClient, error)

NewLbClient returns a new loadbalancer client.

type NetworkClient

type NetworkClient interface {
	ListFloatingIP(opts floatingips.ListOptsBuilder) ([]floatingips.FloatingIP, error)
	CreateFloatingIP(opts floatingips.CreateOptsBuilder) (*floatingips.FloatingIP, error)
	DeleteFloatingIP(id string) error
	GetFloatingIP(id string) (*floatingips.FloatingIP, error)
	UpdateFloatingIP(id string, opts floatingips.UpdateOptsBuilder) (*floatingips.FloatingIP, error)

	ListPort(ctx context.Context, opts ports.ListOptsBuilder) ([]ports.Port, error)
	CreatePort(ctx context.Context, opts ports.CreateOptsBuilder) (*ports.Port, error)
	DeletePort(ctx context.Context, id string) error
	GetPort(ctx context.Context, id string) (*ports.Port, error)
	UpdatePort(id string, opts ports.UpdateOptsBuilder) (*ports.Port, error)

	ListTrunk(opts trunks.ListOptsBuilder) ([]trunks.Trunk, error)
	CreateTrunk(opts trunks.CreateOptsBuilder) (*trunks.Trunk, error)
	DeleteTrunk(id string) error

	ListTrunkSubports(trunkID string) ([]trunks.Subport, error)
	RemoveSubports(id string, opts trunks.RemoveSubportsOpts) error

	ListRouter(ctx context.Context, opts routers.ListOpts) ([]routers.Router, error)
	CreateRouter(ctx context.Context, opts routers.CreateOptsBuilder) (*routers.Router, error)
	DeleteRouter(ctx context.Context, id string) error
	GetRouter(ctx context.Context, id string) (*routers.Router, error)
	UpdateRouter(ctx context.Context, id string, opts routers.UpdateOptsBuilder) (*routers.Router, error)
	AddRouterInterface(ctx context.Context, id string, opts routers.AddInterfaceOptsBuilder) (*routers.InterfaceInfo, error)
	RemoveRouterInterface(ctx context.Context, id string, opts routers.RemoveInterfaceOptsBuilder) (*routers.InterfaceInfo, error)

	ListSecGroup(ctx context.Context, opts groups.ListOpts) ([]groups.SecGroup, error)
	CreateSecGroup(ctx context.Context, opts groups.CreateOptsBuilder) (*groups.SecGroup, error)
	DeleteSecGroup(ctx context.Context, id string) error
	GetSecGroup(ctx context.Context, id string) (*groups.SecGroup, error)
	UpdateSecGroup(ctx context.Context, id string, opts groups.UpdateOptsBuilder) (*groups.SecGroup, error)

	ListSecGroupRule(ctx context.Context, opts rules.ListOpts) ([]rules.SecGroupRule, error)
	CreateSecGroupRules(ctx context.Context, opts []rules.CreateOpts) ([]rules.SecGroupRule, error)
	DeleteSecGroupRule(ctx context.Context, id string) error
	GetSecGroupRule(ctx context.Context, id string) (*rules.SecGroupRule, error)

	ListNetwork(opts networks.ListOptsBuilder) pagination.Pager
	CreateNetwork(ctx context.Context, opts networks.CreateOptsBuilder) networks.CreateResult
	DeleteNetwork(ctx context.Context, id string) networks.DeleteResult
	GetNetwork(ctx context.Context, id string) networks.GetResult
	UpdateNetwork(ctx context.Context, id string, opts networks.UpdateOptsBuilder) networks.UpdateResult

	ListSubnet(ctx context.Context, opts subnets.ListOptsBuilder) ([]subnets.Subnet, error)
	CreateSubnet(ctx context.Context, opts subnets.CreateOptsBuilder) (*subnets.Subnet, error)
	DeleteSubnet(ctx context.Context, id string) error
	GetSubnet(ctx context.Context, id string) (*subnets.Subnet, error)
	UpdateSubnet(ctx context.Context, id string, opts subnets.UpdateOptsBuilder) (*subnets.Subnet, error)

	ListExtensions() ([]extensions.Extension, error)

	ReplaceAllAttributesTags(ctx context.Context, resourceType string, resourceID string, opts attributestags.ReplaceAllOptsBuilder) ([]string, error)
}

func NewNetworkClient

func NewNetworkClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (NetworkClient, error)

NewNetworkClient returns an instance of the networking service.

type Result

type Result[T any] interface {
	Ok() T
	Err() error
}

Result carries either a result or a non-nil error.

type VolumeClient

type VolumeClient interface {
	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)
}

func NewVolumeClient

func NewVolumeClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (VolumeClient, error)

NewVolumeClient returns a new cinder client.

func NewVolumeErrorClient

func NewVolumeErrorClient(e error) VolumeClient

NewVolumeErrorClient returns a VolumeClient in which every method returns the given error.

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