Documentation
¶
Index ¶
Constants ¶
const ( // VolumeStatusAvailable indicates that he volume is available to be attached. VolumeStatusAvailable = "available" // VolumeStatusCreating indicates that the volume is being created. VolumeStatusCreating = "creating" // VolumeStatusDownloading indicates that the volume is in downloading state. VolumeStatusDownloading = "downloading" // VolumeStatusDeleting indicates that the volume is in the process of being deleted. VolumeStatusDeleting = "deleting" // VolumeStatusError indicates that the volume is in error state. VolumeStatusError = "error" // VolumeStatusInUse indicates that the volume is currently in use. VolumeStatusInUse = "in-use" )
const ( // ServerStatusActive indicates that the server is active. ServerStatusActive = "ACTIVE" // ServerStatusBuild indicates tha the server has not yet finished the build process. ServerStatusBuild = "BUILD" // ServerStatusDeleted indicates that the server is deleted. ServerStatusDeleted = "DELETED" // ServerStatusError indicates that the server is in error. ServerStatusError = "ERROR" )
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
IsNotFoundError checks if an error returned by OpenStack service calls is caused by HTTP 404 status code.
func IsUnauthenticated ¶
IsUnauthenticated checks if an error returned by OpenStack service calls is caused by HTTP 401 status code.
func IsUnauthorized ¶
IsUnauthorized checks if an error returned by OpenStack service calls is caused by HTTP 403 status code.
Types ¶
type Compute ¶
type Compute interface {
// CreateServer creates a server.
CreateServer(opts servers.CreateOptsBuilder) (*servers.Server, error)
// BootFromVolume creates a server from a block device mapping.
BootFromVolume(opts servers.CreateOptsBuilder) (*servers.Server, error)
// GetServer fetches server data from the supplied ID.
GetServer(id string) (*servers.Server, error)
// ListServers lists all servers based on opts constraints.
ListServers(opts servers.ListOptsBuilder) ([]servers.Server, error)
// DeleteServer deletes a server with the supplied ID. If the server does not exist it returns nil.
DeleteServer(id string) error
// FlavorIDFromName resolves the given flavor name to a unique ID.
FlavorIDFromName(name string) (string, error)
// ImageIDFromName resolves the given image name to a unique ID.
ImageIDFromName(name string) (string, error)
}
Compute is an interface for communication with Nova service.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory can create clients for Nova and Neutron OpenStack services.
func NewFactoryFromSecret ¶
NewFactoryFromSecret can create a Factory from the a kubernetes secret.
func NewFactoryFromSecretData ¶
NewFactoryFromSecretData can create a Factory from the a kubernetes secret's data.
type Network ¶
type Network interface {
// GetSubnet fetches the subnet data from the supplied ID.
GetSubnet(id string) (*subnets.Subnet, error)
// CreatePort creates a Neutron port.
CreatePort(opts ports.CreateOptsBuilder) (*ports.Port, error)
// ListPorts lists all ports.
ListPorts(opts ports.ListOptsBuilder) ([]ports.Port, error)
// UpdatePort updates the port from the supplied ID.
UpdatePort(id string, opts ports.UpdateOptsBuilder) error
// DeletePort deletes the port from the supplied ID.
DeletePort(id string) error
// NetworkIDFromName resolves the given network name to a unique ID.
NetworkIDFromName(name string) (string, error)
// GroupIDFromName resolves the given security group name to a unique ID.
GroupIDFromName(name string) (string, error)
// PortIDFromName resolves the given port name to a unique ID.
PortIDFromName(name string) (string, error)
// TagPort tags a port with the specified labels.
TagPort(id string, tags []string) error
}
Network is an interface for communication with Neutron service.
type Option ¶
type Option func(opts gophercloud.EndpointOpts) gophercloud.EndpointOpts
Option can modify client parameters by manipulating EndpointOpts.
func WithRegion ¶
WithRegion returns an Option that can modify the region a client targets.
type Storage ¶
type Storage interface {
// CreateVolume creates a Cinder volume.
CreateVolume(opts volumes.CreateOptsBuilder) (*volumes.Volume, error)
// GetVolume retrieves information about a volume.
GetVolume(id string) (*volumes.Volume, error)
// DeleteVolume deletes a volume
DeleteVolume(id string) error
// VolumeIDFromName resolves the given volume name to a unique ID.
VolumeIDFromName(name string) (string, error)
// ListVolumes lists all volumes
ListVolumes(opts volumes.ListOptsBuilder) ([]volumes.Volume, error)
}
Storage is an interface for communication with Cinder service.