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

openstack

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagNameEtcdClusterPrefix = "k8s.io/etcd/"
	TagNameRolePrefix        = "k8s.io/role/"
	TagClusterName           = "KubernetesCluster"
	TagRoleMaster            = "master"
)
View Source
const (
	INSTANCE_GROUP_GENERATION = "ig_generation"
	CLUSTER_GENERATION        = "cluster_generation"
)

Variables

View Source
var ErrNotFound = "Resource not found"

ErrNotFound is used to inform that the object is not found

Functions

func GetServerFixedIP

func GetServerFixedIP(server *servers.Server, interfaceName string) (poolAddress string, err error)

Types

type Address

type Address struct {
	IPType string `mapstructure:"OS-EXT-IPS:type"`
	Addr   string
}

type OpenstackAPITarget

type OpenstackAPITarget struct {
	Cloud OpenstackCloud
}

func NewOpenstackAPITarget

func NewOpenstackAPITarget(cloud OpenstackCloud) *OpenstackAPITarget

func (*OpenstackAPITarget) Finish

func (t *OpenstackAPITarget) Finish(taskMap map[string]fi.Task) error

func (*OpenstackAPITarget) ProcessDeletions

func (t *OpenstackAPITarget) ProcessDeletions() bool

type OpenstackCloud

type OpenstackCloud interface {
	fi.Cloud

	ComputeClient() *gophercloud.ServiceClient
	BlockStorageClient() *gophercloud.ServiceClient
	NetworkingClient() *gophercloud.ServiceClient
	LoadBalancerClient() *gophercloud.ServiceClient
	DNSClient() *gophercloud.ServiceClient
	UseOctavia() bool

	// Region returns the region which cloud will run on
	Region() string

	// GetInstance will return a openstack server provided its ID
	GetInstance(id string) (*servers.Server, error)

	// ListInstances will return a slice of openstack servers provided list opts
	ListInstances(servers.ListOptsBuilder) ([]servers.Server, error)

	// CreateInstance will create an openstack server provided create opts
	CreateInstance(servers.CreateOptsBuilder) (*servers.Server, error)

	//DeleteInstanceWithID will delete instance
	DeleteInstanceWithID(instanceID string) error

	// SetVolumeTags will set the tags for the Cinder volume
	SetVolumeTags(id string, tags map[string]string) error

	// GetCloudTags will return the tags attached on cloud
	GetCloudTags() map[string]string

	// ListVolumes will return the Cinder volumes which match the options
	ListVolumes(opt cinder.ListOptsBuilder) ([]cinder.Volume, error)

	// CreateVolume will create a new Cinder Volume
	CreateVolume(opt cinder.CreateOptsBuilder) (*cinder.Volume, error)

	AttachVolume(serverID string, opt volumeattach.CreateOpts) (*volumeattach.VolumeAttachment, error)

	//DeleteVolume will delete volume
	DeleteVolume(volumeID string) error

	//ListSecurityGroups will return the Neutron security groups which match the options
	ListSecurityGroups(opt sg.ListOpts) ([]sg.SecGroup, error)

	//CreateSecurityGroup will create a new Neutron security group
	CreateSecurityGroup(opt sg.CreateOptsBuilder) (*sg.SecGroup, error)

	//DeleteSecurityGroup will delete securitygroup
	DeleteSecurityGroup(sgID string) error

	//DeleteSecurityGroupRule will delete securitygrouprule
	DeleteSecurityGroupRule(ruleID string) error

	//ListSecurityGroupRules will return the Neutron security group rules which match the options
	ListSecurityGroupRules(opt sgr.ListOpts) ([]sgr.SecGroupRule, error)

	//CreateSecurityGroupRule will create a new Neutron security group rule
	CreateSecurityGroupRule(opt sgr.CreateOptsBuilder) (*sgr.SecGroupRule, error)

	//GetNetwork will return the Neutron network which match the id
	GetNetwork(networkID string) (*networks.Network, error)

	//ListNetworks will return the Neutron networks which match the options
	ListNetworks(opt networks.ListOptsBuilder) ([]networks.Network, error)

	//ListExternalNetworks will return the Neutron networks with the router:external property
	GetExternalNetwork() (*networks.Network, error)

	// GetExternalSubnet will return the subnet for floatingip which is used in external router
	GetExternalSubnet() (*subnets.Subnet, error)

	// GetLBFloatingSubnet will return the subnet for floatingip which is used in lb
	GetLBFloatingSubnet() (*subnets.Subnet, error)

	//CreateNetwork will create a new Neutron network
	CreateNetwork(opt networks.CreateOptsBuilder) (*networks.Network, error)

	//DeleteNetwork will delete neutron network
	DeleteNetwork(networkID string) error

	//ListRouters will return the Neutron routers which match the options
	ListRouters(opt routers.ListOpts) ([]routers.Router, error)

	//CreateRouter will create a new Neutron router
	CreateRouter(opt routers.CreateOptsBuilder) (*routers.Router, error)

	//DeleteRouter will delete neutron router
	DeleteRouter(routerID string) error

	//DeleteSubnet will delete neutron subnet
	DeleteSubnet(subnetID string) error

	//ListSubnets will return the Neutron subnets which match the options
	ListSubnets(opt subnets.ListOptsBuilder) ([]subnets.Subnet, error)

	//CreateSubnet will create a new Neutron subnet
	CreateSubnet(opt subnets.CreateOptsBuilder) (*subnets.Subnet, error)

	// GetKeypair will return the Nova keypair
	GetKeypair(name string) (*keypairs.KeyPair, error)

	// ListKeypairs will return the all Nova keypairs
	ListKeypairs() ([]keypairs.KeyPair, error)

	// DeleteKeyPair will delete a Nova keypair
	DeleteKeyPair(name string) error

	// CreateKeypair will create a new Nova Keypair
	CreateKeypair(opt keypairs.CreateOptsBuilder) (*keypairs.KeyPair, error)

	CreatePort(opt ports.CreateOptsBuilder) (*ports.Port, error)

	//GetPort will return a Neutron port by ID
	GetPort(id string) (*ports.Port, error)

	//ListPorts will return the Neutron ports which match the options
	ListPorts(opt ports.ListOptsBuilder) ([]ports.Port, error)

	// DeletePort will delete a neutron port
	DeletePort(portID string) error

	//CreateRouterInterface will create a new Neutron router interface
	CreateRouterInterface(routerID string, opt routers.AddInterfaceOptsBuilder) (*routers.InterfaceInfo, error)

	//DeleteRouterInterface will delete router interface from subnet
	DeleteRouterInterface(routerID string, opt routers.RemoveInterfaceOptsBuilder) error

	// CreateServerGroup will create a new server group.
	CreateServerGroup(opt servergroups.CreateOptsBuilder) (*servergroups.ServerGroup, error)

	// ListServerGroups will list available server groups
	ListServerGroups() ([]servergroups.ServerGroup, error)

	// DeleteServerGroup will delete a nova server group
	DeleteServerGroup(groupID string) error

	// ListDNSZones will list available DNS zones
	ListDNSZones(opt zones.ListOptsBuilder) ([]zones.Zone, error)

	// ListDNSRecordsets will list the DNS recordsets for the given zone id
	ListDNSRecordsets(zoneID string, opt recordsets.ListOptsBuilder) ([]recordsets.RecordSet, error)

	GetLB(loadbalancerID string) (*loadbalancers.LoadBalancer, error)

	CreateLB(opt loadbalancers.CreateOptsBuilder) (*loadbalancers.LoadBalancer, error)

	ListLBs(opt loadbalancers.ListOptsBuilder) ([]loadbalancers.LoadBalancer, error)

	// DeleteLB will delete loadbalancer
	DeleteLB(lbID string, opt loadbalancers.DeleteOpts) error

	GetApiIngressStatus(cluster *kops.Cluster) ([]kops.ApiIngressStatus, error)

	FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error)

	// DefaultInstanceType determines a suitable instance type for the specified instance group
	DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error)

	// Returns the availability zones for the service client passed (compute, volume, network)
	ListAvailabilityZones(serviceClient *gophercloud.ServiceClient) ([]az.AvailabilityZone, error)

	AssociateToPool(server *servers.Server, poolID string, opts v2pools.CreateMemberOpts) (*v2pools.Member, error)

	CreatePool(opts v2pools.CreateOpts) (*v2pools.Pool, error)

	GetPool(poolID string, memberID string) (*v2pools.Member, error)

	ListPools(v2pools.ListOpts) ([]v2pools.Pool, error)

	// ListMonitors will list HealthMonitors matching the provided options
	ListMonitors(monitors.ListOpts) ([]monitors.Monitor, error)

	// DeleteMonitor will delete a Pool resources Health Monitor
	DeleteMonitor(monitorID string) error

	// DeletePool will delete loadbalancer pool
	DeletePool(poolID string) error

	ListListeners(opts listeners.ListOpts) ([]listeners.Listener, error)

	CreateListener(opts listeners.CreateOpts) (*listeners.Listener, error)

	// DeleteListener will delete loadbalancer listener
	DeleteListener(listenerID string) error

	GetStorageAZFromCompute(azName string) (*az.AvailabilityZone, error)

	GetFloatingIP(id string) (fip *floatingips.FloatingIP, err error)

	AssociateFloatingIPToInstance(serverID string, opts floatingips.AssociateOpts) (err error)

	ListServerFloatingIPs(id string) ([]*string, error)

	ListFloatingIPs() (fips []floatingips.FloatingIP, err error)
	ListL3FloatingIPs(opts l3floatingip.ListOpts) (fips []l3floatingip.FloatingIP, err error)
	CreateFloatingIP(opts floatingips.CreateOpts) (*floatingips.FloatingIP, error)
	CreateL3FloatingIP(opts l3floatingip.CreateOpts) (fip *l3floatingip.FloatingIP, err error)
	DeleteFloatingIP(id string) error
	DeleteL3FloatingIP(id string) error
}

func NewOpenstackCloud

func NewOpenstackCloud(tags map[string]string, spec *kops.ClusterSpec) (OpenstackCloud, error)

Jump to

Keyboard shortcuts

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