openstack

package
v0.0.0-...-3464aa7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnwrapOpenStackError

func UnwrapOpenStackError(err error) error

UnwrapOpenStackError creates an error string from openstack api error

Types

type BaseServices

type BaseServices struct {
	Compute *gc.ServiceClient
	Network *gc.ServiceClient
	Volume  *gc.ServiceClient
	// contains filtered or unexported fields
}

type Config

type Config struct {
	// IdentityEndpoint specifies the HTTP endpoint that is required to work with
	// the Identity API of the appropriate version. While it's ultimately needed by
	// all of the identity services, it will often be populated by a provider-level
	// function.
	IdentityEndpoint string

	// Username is required if using Identity V2 API. Consult with your provider's
	// control panel to discover your account's username. In Identity V3, either
	// UserID or a combination of Username and DomainID or DomainName are needed.
	Username string
	UserID   string

	// Exactly one of Password or APIKey is required for the Identity V2 and V3
	// APIs. Consult with your provider's control panel to discover your account's
	// preferred method of authentication.
	Password string
	APIKey   string

	// At most one of DomainID and DomainName must be provided if using Username
	// with Identity V3. Otherwise, either are optional.
	DomainID   string
	DomainName string

	// The TenantID and TenantName fields are optional for the Identity V2 API.
	// Some api allow you to specify a TenantName instead of the TenantId.
	// Some require both. Your provider's authentication policies will determine
	// how these fields influence authentication.
	TenantID   string
	TenantName string

	// AllowReauth should be set to true if you grant permission for anyclouds to
	// cache your credentials in memory, and to allow anyclouds to attempt to
	// re-authenticate automatically if/when your token expires.  If you set it to
	// false, it will not cache these settings, but re-authentication will not be
	// possible.  This setting defaults to false.
	//
	// NOTE: The reauth function will try to re-authenticate endlessly if left unchecked.
	// The way to limit the number of attempts is to provide a custom HTTP client to the provider client
	// and provide a transport that implements the RoundTripper interface and stores the number of failed retries.
	// For an example of this, see here: https://github.com/gophercloud/rack/blob/1.0.0/auth/clients.go#L311
	AllowReauth bool

	// TokenID allows users to authenticate (possibly as another user) with an
	// authentication token ID.
	TokenID string

	//Openstack region (data center) where the infrastructure will be created
	Region string

	//PublicIPPool name of the floating IP pool
	//Necessary only if UseFloatingIP is true
	FloatingIPPool string

	//Name of the external network used to get public ip addresses
	ExternalNetworkName string
}

Config fields are the union of those recognized by each Provider identity implementation and provider.

type Configuration

type Configuration struct {
	ExternalNetworkName string
	ExternalNetworkID   string
}

type ImageManager

type ImageManager struct {
	Provider *Provider
}

ImageManager defines image management functions a anyclouds provider must provide

func (*ImageManager) Get

func (mgr *ImageManager) Get(id string) (*api.Image, api.GetImageError)

Get returns the image identified by id

func (*ImageManager) List

func (mgr *ImageManager) List() ([]api.Image, api.ListImageError)

List returns available image list

type KeyPairManager

type KeyPairManager struct {
	Provider *Provider
}

KeyPairManager openstack implementation of api.KeyPairManager

func (*KeyPairManager) Delete

func (mgr *KeyPairManager) Delete(name string) error

Delete a key pair

func (*KeyPairManager) Import

func (mgr *KeyPairManager) Import(name string, publicKey []byte) error

Import load a public key

type NetworkInterfacesManager

type NetworkInterfacesManager struct {
	Provider *Provider
}

func (*NetworkInterfacesManager) Delete

func (*NetworkInterfacesManager) Get

func (*NetworkInterfacesManager) List

type NetworkManager

type NetworkManager struct {
	Refactor *Provider
}

NetworkManager defines networking functions a anyclouds provider must provide

func (*NetworkManager) CreateNetwork

func (mgr *NetworkManager) CreateNetwork(options api.CreateNetworkOptions) (*api.Network, api.CreateNetworkError)

CreateNetwork creates a network

func (*NetworkManager) CreateSubnet

func (mgr *NetworkManager) CreateSubnet(options api.CreateSubnetOptions) (*api.Subnet, api.CreateSubnetError)

CreateSubnet creates a subnet

func (*NetworkManager) DeleteNetwork

func (mgr *NetworkManager) DeleteNetwork(id string) api.DeleteNetworkError

DeleteNetwork deletes the network identified by id

func (*NetworkManager) DeleteSubnet

func (mgr *NetworkManager) DeleteSubnet(networkID, subnetID string) api.DeleteSubnetError

DeleteSubnet deletes the subnet identified by id

func (*NetworkManager) GetNetwork

func (mgr *NetworkManager) GetNetwork(id string) (*api.Network, api.GetNetworkError)

GetNetwork returns the configuration of the network identified by id

func (*NetworkManager) GetSubnet

func (mgr *NetworkManager) GetSubnet(networkID, subnetID string) (*api.Subnet, api.GetSubnetError)

GetSubnet returns the configuration of the subnet identified by id

func (*NetworkManager) ListNetworks

func (mgr *NetworkManager) ListNetworks() ([]api.Network, api.ListNetworksError)

ListNetworks lists networks

func (*NetworkManager) ListSubnets

func (mgr *NetworkManager) ListSubnets(networkID string) ([]api.Subnet, api.ListSubnetsError)

ListSubnets lists the subnet

type Provider

type Provider struct {
	Config                   Configuration
	BaseServices             BaseServices
	KeyPairManager           KeyPairManager
	ImagesManager            ImageManager
	NetworkManager           NetworkManager
	NetworkInterfacesManager NetworkInterfacesManager
	TemplateManager          ServerTemplateManager
	ServerManager            ServerManager
	SecurityGroupManager     SecurityGroupManager
	VolumeManager            VolumeManager
	PublicIPAddressManager   PublicIPManager
}

Provider Provider provider

func (*Provider) GetImageManager

func (p *Provider) GetImageManager() api.ImageManager

GetImageManager returns an Provider ImageManager

func (*Provider) GetNetworkInterfaceManager

func (p *Provider) GetNetworkInterfaceManager() api.NetworkInterfaceManager

func (*Provider) GetNetworkManager

func (p *Provider) GetNetworkManager() api.NetworkManager

GetNetworkManager returns an Provider NetworkManager

func (*Provider) GetPublicIPAddressManager

func (p *Provider) GetPublicIPAddressManager() api.PublicIPManager

func (*Provider) GetSecurityGroupManager

func (p *Provider) GetSecurityGroupManager() api.SecurityGroupManager

GetSecurityGroupManager returns an Provider SecurityGroupManager

func (*Provider) GetServerManager

func (p *Provider) GetServerManager() api.ServerManager

GetServerManager returns an Provider ServerManager

func (*Provider) GetTemplateManager

func (p *Provider) GetTemplateManager() api.ServerTemplateManager

GetTemplateManager returns an Provider ServerTemplateManager

func (*Provider) GetVolumeManager

func (p *Provider) GetVolumeManager() api.VolumeManager

GetVolumeManager returns an Provider VolumeManager

func (*Provider) Init

func (p *Provider) Init(config io.Reader, format string) error

Init initialize Provider Provider

type PublicIPManager

type PublicIPManager struct {
	OpenStack *Provider
}

PublicIPManager openstack implementation of api.PublicIPManager

func (*PublicIPManager) Associate

func (*PublicIPManager) Create

func (*PublicIPManager) Delete

func (mgr *PublicIPManager) Delete(publicIPId string) api.DeletePublicIPError

func (*PublicIPManager) Dissociate

func (mgr *PublicIPManager) Dissociate(publicIPID string) api.DissociatePublicIPError

func (*PublicIPManager) Get

func (mgr *PublicIPManager) Get(publicIPID string) (*api.PublicIP, api.GetPublicIPError)

func (*PublicIPManager) List

func (*PublicIPManager) ListAvailablePools

func (mgr *PublicIPManager) ListAvailablePools() ([]api.PublicIPPool, api.ListAvailablePublicIPPoolsError)

type SecurityGroupManager

type SecurityGroupManager struct {
	Provider *Provider
}

SecurityGroupManager defines security group management functions a anyclouds provider must provide

func (*SecurityGroupManager) AddSecurityRule

AddSecurityRule adds a security rule to an Provider security group

func (*SecurityGroupManager) Attach

Attach a server to a security group

func (*SecurityGroupManager) Create

Create creates an openstack security group

func (*SecurityGroupManager) Delete

Delete deletes the Openstack security group identified by id

func (*SecurityGroupManager) Get

Get returns the security group identified by id fetching rules

func (*SecurityGroupManager) List

List list all Openstack security groups defined in the tenant

func (*SecurityGroupManager) RemoveSecurityRule

func (mgr *SecurityGroupManager) RemoveSecurityRule(groupID, ruleID string) api.RemoveSecurityRuleError

RemoveSecurityRule deletes a security rule from an Provider security group

type ServerManager

type ServerManager struct {
	Provider *Provider
}

ServerManager defines Server management functions an anyclouds provider must provide

func (*ServerManager) Create

Create creates an Server with options

func (*ServerManager) Delete

func (mgr *ServerManager) Delete(id string) api.DeleteServerError

Delete delete Server identified by id

func (*ServerManager) Get

func (mgr *ServerManager) Get(id string) (*api.Server, api.GetServerError)

Get get Servers

func (*ServerManager) List

func (mgr *ServerManager) List() ([]api.Server, api.ListServersError)

List list Servers

func (*ServerManager) Resize

func (mgr *ServerManager) Resize(id string, templateID string) api.ResizeServerError

Resize resize a server

func (*ServerManager) Start

func (mgr *ServerManager) Start(id string) api.StartServerError

Start starts an Server

func (*ServerManager) Stop

func (mgr *ServerManager) Stop(id string) api.StopServerError

Stop stops an Server

type ServerTemplateManager

type ServerTemplateManager struct {
	Provider *Provider
}

ServerTemplateManager defines Server template management functions a anyclouds provider must provide

func (*ServerTemplateManager) Get

Get returns the template identified by ids

func (*ServerTemplateManager) List

List returns available VM templates

type VolumeManager

type VolumeManager struct {
	Provider *Provider
}

VolumeManager defines volume management functions an anyclouds provider must provide

func (*VolumeManager) Attach

Attach attaches a volume to an Server

func (*VolumeManager) Create

Create creates a volume with options

func (*VolumeManager) Delete

func (mgr *VolumeManager) Delete(id string) api.DeleteVolumeError

Delete deletes volume identified by id

func (*VolumeManager) Detach

Detach detach a volume from an Server

func (*VolumeManager) Get

func (mgr *VolumeManager) Get(id string) (*api.Volume, api.GetVolumeError)

Get returns volume details

func (*VolumeManager) List

func (mgr *VolumeManager) List() ([]api.Volume, api.ListVolumesError)

List lists volumes along filter

func (*VolumeManager) ListAttachments

ListAttachments returns all the attachments of an Server

func (*VolumeManager) Resize

Jump to

Keyboard shortcuts

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