Documentation
¶
Index ¶
- func UnwrapOpenStackError(err error) error
- type BaseServices
- type Config
- type Configuration
- type ImageManager
- type KeyPairManager
- type NetworkInterfacesManager
- func (mgr *NetworkInterfacesManager) Create(options api.CreateNetworkInterfaceOptions) (*api.NetworkInterface, api.CreateNetworkInterfaceError)
- func (mgr *NetworkInterfacesManager) Delete(id string) api.DeleteNetworkInterfaceError
- func (mgr *NetworkInterfacesManager) Get(id string) (*api.NetworkInterface, api.GetNetworkInterfaceError)
- func (mgr *NetworkInterfacesManager) List(options *api.ListNetworkInterfacesOptions) ([]api.NetworkInterface, api.ListNetworkInterfacesError)
- func (mgr *NetworkInterfacesManager) Update(options api.UpdateNetworkInterfaceOptions) (*api.NetworkInterface, api.UpdateNetworkInterfaceError)
- type NetworkManager
- func (mgr *NetworkManager) CreateNetwork(options api.CreateNetworkOptions) (*api.Network, api.CreateNetworkError)
- func (mgr *NetworkManager) CreateSubnet(options api.CreateSubnetOptions) (*api.Subnet, api.CreateSubnetError)
- func (mgr *NetworkManager) DeleteNetwork(id string) api.DeleteNetworkError
- func (mgr *NetworkManager) DeleteSubnet(networkID, subnetID string) api.DeleteSubnetError
- func (mgr *NetworkManager) GetNetwork(id string) (*api.Network, api.GetNetworkError)
- func (mgr *NetworkManager) GetSubnet(networkID, subnetID string) (*api.Subnet, api.GetSubnetError)
- func (mgr *NetworkManager) ListNetworks() ([]api.Network, api.ListNetworksError)
- func (mgr *NetworkManager) ListSubnets(networkID string) ([]api.Subnet, api.ListSubnetsError)
- type Provider
- func (p *Provider) GetImageManager() api.ImageManager
- func (p *Provider) GetNetworkInterfaceManager() api.NetworkInterfaceManager
- func (p *Provider) GetNetworkManager() api.NetworkManager
- func (p *Provider) GetPublicIPAddressManager() api.PublicIPManager
- func (p *Provider) GetSecurityGroupManager() api.SecurityGroupManager
- func (p *Provider) GetServerManager() api.ServerManager
- func (p *Provider) GetTemplateManager() api.ServerTemplateManager
- func (p *Provider) GetVolumeManager() api.VolumeManager
- func (p *Provider) Init(config io.Reader, format string) error
- type PublicIPManager
- func (mgr *PublicIPManager) Associate(options api.AssociatePublicIPOptions) api.AssociatePublicIPError
- func (mgr *PublicIPManager) Create(options api.CreatePublicIPOptions) (*api.PublicIP, api.CreatePublicIPError)
- func (mgr *PublicIPManager) Delete(publicIPId string) api.DeletePublicIPError
- func (mgr *PublicIPManager) Dissociate(publicIPID string) api.DissociatePublicIPError
- func (mgr *PublicIPManager) Get(publicIPID string) (*api.PublicIP, api.GetPublicIPError)
- func (mgr *PublicIPManager) List(options *api.ListPublicIPsOptions) ([]api.PublicIP, api.ListPublicIPsError)
- func (mgr *PublicIPManager) ListAvailablePools() ([]api.PublicIPPool, api.ListAvailablePublicIPPoolsError)
- type SecurityGroupManager
- func (mgr *SecurityGroupManager) AddSecurityRule(options api.AddSecurityRuleOptions) (*api.SecurityRule, api.AddSecurityRuleError)
- func (mgr *SecurityGroupManager) Attach(options api.AttachSecurityGroupOptions) api.AttachSecurityGroupError
- func (mgr *SecurityGroupManager) Create(options api.SecurityGroupOptions) (*api.SecurityGroup, api.CreateSecurityGroupError)
- func (mgr *SecurityGroupManager) Delete(id string) api.DeleteSecurityGroupError
- func (mgr *SecurityGroupManager) Get(id string) (*api.SecurityGroup, api.GetSecurityGroupError)
- func (mgr *SecurityGroupManager) List() ([]api.SecurityGroup, api.ListSecurityGroupsError)
- func (mgr *SecurityGroupManager) RemoveSecurityRule(groupID, ruleID string) api.RemoveSecurityRuleError
- type ServerManager
- func (mgr *ServerManager) Create(options api.CreateServerOptions) (*api.Server, api.CreateServerError)
- func (mgr *ServerManager) Delete(id string) api.DeleteServerError
- func (mgr *ServerManager) Get(id string) (*api.Server, api.GetServerError)
- func (mgr *ServerManager) List() ([]api.Server, api.ListServersError)
- func (mgr *ServerManager) Resize(id string, templateID string) api.ResizeServerError
- func (mgr *ServerManager) Start(id string) api.StartServerError
- func (mgr *ServerManager) Stop(id string) api.StopServerError
- type ServerTemplateManager
- type VolumeManager
- func (mgr *VolumeManager) Attach(options api.AttachVolumeOptions) (*api.VolumeAttachment, api.AttachVolumeError)
- func (mgr *VolumeManager) Create(options api.CreateVolumeOptions) (*api.Volume, api.CreateVolumeError)
- func (mgr *VolumeManager) Delete(id string) api.DeleteVolumeError
- func (mgr *VolumeManager) Detach(options api.DetachVolumeOptions) api.DetachVolumeError
- func (mgr *VolumeManager) Get(id string) (*api.Volume, api.GetVolumeError)
- func (mgr *VolumeManager) List() ([]api.Volume, api.ListVolumesError)
- func (mgr *VolumeManager) ListAttachments(options *api.ListAttachmentsOptions) ([]api.VolumeAttachment, api.ListVolumeAttachmentsError)
- func (mgr *VolumeManager) Resize(options api.ResizeVolumeOptions) (*api.Volume, api.ResizeVolumeError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnwrapOpenStackError ¶
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 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
type NetworkInterfacesManager ¶
type NetworkInterfacesManager struct {
Provider *Provider
}
func (*NetworkInterfacesManager) Create ¶
func (mgr *NetworkInterfacesManager) Create(options api.CreateNetworkInterfaceOptions) (*api.NetworkInterface, api.CreateNetworkInterfaceError)
func (*NetworkInterfacesManager) Delete ¶
func (mgr *NetworkInterfacesManager) Delete(id string) api.DeleteNetworkInterfaceError
func (*NetworkInterfacesManager) Get ¶
func (mgr *NetworkInterfacesManager) Get(id string) (*api.NetworkInterface, api.GetNetworkInterfaceError)
func (*NetworkInterfacesManager) List ¶
func (mgr *NetworkInterfacesManager) List(options *api.ListNetworkInterfacesOptions) ([]api.NetworkInterface, api.ListNetworkInterfacesError)
func (*NetworkInterfacesManager) Update ¶
func (mgr *NetworkInterfacesManager) Update(options api.UpdateNetworkInterfaceOptions) (*api.NetworkInterface, api.UpdateNetworkInterfaceError)
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
type PublicIPManager ¶
type PublicIPManager struct {
OpenStack *Provider
}
PublicIPManager openstack implementation of api.PublicIPManager
func (*PublicIPManager) Associate ¶
func (mgr *PublicIPManager) Associate(options api.AssociatePublicIPOptions) api.AssociatePublicIPError
func (*PublicIPManager) Create ¶
func (mgr *PublicIPManager) Create(options api.CreatePublicIPOptions) (*api.PublicIP, api.CreatePublicIPError)
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 (mgr *PublicIPManager) List(options *api.ListPublicIPsOptions) ([]api.PublicIP, api.ListPublicIPsError)
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 ¶
func (mgr *SecurityGroupManager) AddSecurityRule(options api.AddSecurityRuleOptions) (*api.SecurityRule, api.AddSecurityRuleError)
AddSecurityRule adds a security rule to an Provider security group
func (*SecurityGroupManager) Attach ¶
func (mgr *SecurityGroupManager) Attach(options api.AttachSecurityGroupOptions) api.AttachSecurityGroupError
Attach a server to a security group
func (*SecurityGroupManager) Create ¶
func (mgr *SecurityGroupManager) Create(options api.SecurityGroupOptions) (*api.SecurityGroup, api.CreateSecurityGroupError)
Create creates an openstack security group
func (*SecurityGroupManager) Delete ¶
func (mgr *SecurityGroupManager) Delete(id string) api.DeleteSecurityGroupError
Delete deletes the Openstack security group identified by id
func (*SecurityGroupManager) Get ¶
func (mgr *SecurityGroupManager) Get(id string) (*api.SecurityGroup, api.GetSecurityGroupError)
Get returns the security group identified by id fetching rules
func (*SecurityGroupManager) List ¶
func (mgr *SecurityGroupManager) List() ([]api.SecurityGroup, api.ListSecurityGroupsError)
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 ¶
func (mgr *ServerManager) Create(options api.CreateServerOptions) (*api.Server, api.CreateServerError)
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 ¶
func (mgr *ServerTemplateManager) Get(id string) (*api.ServerTemplate, api.GetServerTemplateError)
Get returns the template identified by ids
func (*ServerTemplateManager) List ¶
func (mgr *ServerTemplateManager) List() ([]api.ServerTemplate, api.ListServerTemplatesError)
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 ¶
func (mgr *VolumeManager) Attach(options api.AttachVolumeOptions) (*api.VolumeAttachment, api.AttachVolumeError)
Attach attaches a volume to an Server
func (*VolumeManager) Create ¶
func (mgr *VolumeManager) Create(options api.CreateVolumeOptions) (*api.Volume, api.CreateVolumeError)
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 ¶
func (mgr *VolumeManager) Detach(options api.DetachVolumeOptions) api.DetachVolumeError
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 ¶
func (mgr *VolumeManager) ListAttachments(options *api.ListAttachmentsOptions) ([]api.VolumeAttachment, api.ListVolumeAttachmentsError)
ListAttachments returns all the attachments of an Server
func (*VolumeManager) Resize ¶
func (mgr *VolumeManager) Resize(options api.ResizeVolumeOptions) (*api.Volume, api.ResizeVolumeError)