Documentation ¶
Index ¶
- func FromIntIPversion(v int) IPVersion.Enum
- func ParseNeutronError(neutronError string) map[string]string
- func ProviderErrorToString(err error) string
- func ToGopherIPversion(v IPVersion.Enum) gophercloud.IPVersion
- func TranslateError(err error) error
- type Router
- type RouterRequest
- type Stack
- func (s *Stack) AddPublicIPToVIP(vip *resources.VIP) error
- func (s *Stack) BindHostToVIP(vip *resources.VIP, host *resources.Host) error
- func (s *Stack) CreateGateway(req resources.GatewayRequest) (host *resources.Host, userData *userdata.Content, err error)
- func (s *Stack) CreateHost(request resources.HostRequest) (host *resources.Host, userData *userdata.Content, err error)
- func (s *Stack) CreateKeyPair(name string) (*resources.KeyPair, error)
- func (s *Stack) CreateNetwork(req resources.NetworkRequest) (newNet *resources.Network, err error)
- func (s *Stack) CreateVIP(networkID string, name string) (*resources.VIP, error)
- func (s *Stack) CreateVolume(request resources.VolumeRequest) (volume *resources.Volume, err error)
- func (s *Stack) CreateVolumeAttachment(request resources.VolumeAttachmentRequest) (string, error)
- func (s *Stack) DeleteGateway(id string) error
- func (s *Stack) DeleteHost(id string) error
- func (s *Stack) DeleteKeyPair(id string) error
- func (s *Stack) DeleteNetwork(id string) error
- func (s *Stack) DeleteVIP(vip *resources.VIP) error
- func (s *Stack) DeleteVolume(id string) (err error)
- func (s *Stack) DeleteVolumeAttachment(serverID, vaID string) error
- func (s *Stack) GetAuthenticationOptions() stacks.AuthenticationOptions
- func (s *Stack) GetAvailabilityZoneOfServer(serverID string) (string, error)
- func (s *Stack) GetConfigurationOptions() stacks.ConfigurationOptions
- func (s *Stack) GetHostByName(name string) (*resources.Host, error)
- func (s *Stack) GetHostState(hostParam interface{}) (HostState.Enum, error)
- func (s *Stack) GetImage(id string) (image *resources.Image, err error)
- func (s *Stack) GetKeyPair(id string) (*resources.KeyPair, error)
- func (s *Stack) GetNetwork(id string) (*resources.Network, error)
- func (s *Stack) GetNetworkByName(name string) (*resources.Network, error)
- func (s *Stack) GetSecurityGroup(name string) (*secgroups.SecGroup, error)
- func (s *Stack) GetTemplate(id string) (template *resources.HostTemplate, err error)
- func (s *Stack) GetVolume(id string) (*resources.Volume, error)
- func (s *Stack) GetVolumeAttachment(serverID, id string) (*resources.VolumeAttachment, error)
- func (s *Stack) InitDefaultSecurityGroup() error
- func (s *Stack) InspectHost(hostParam interface{}) (*resources.Host, error)
- func (s *Stack) ListAvailabilityZones() (list map[string]bool, err error)
- func (s *Stack) ListHosts() ([]*resources.Host, error)
- func (s *Stack) ListImages() (imgList []resources.Image, err error)
- func (s *Stack) ListKeyPairs() ([]resources.KeyPair, error)
- func (s *Stack) ListNetworks() ([]*resources.Network, error)
- func (s *Stack) ListRegions() ([]string, error)
- func (s *Stack) ListRouters() ([]Router, error)
- func (s *Stack) ListTemplates() ([]resources.HostTemplate, error)
- func (s *Stack) ListVolumeAttachments(serverID string) ([]resources.VolumeAttachment, error)
- func (s *Stack) ListVolumes() ([]resources.Volume, error)
- func (s *Stack) RebootHost(id string) error
- func (s *Stack) ResizeHost(id string, request resources.SizingRequirements) (*resources.Host, error)
- func (s *Stack) SelectedAvailabilityZone() (string, error)
- func (s *Stack) StartHost(id string) error
- func (s *Stack) StopHost(id string) error
- func (s *Stack) UnbindHostFromVIP(vip *resources.VIP, host *resources.Host) error
- func (s *Stack) WaitHostReady(hostParam interface{}, timeout time.Duration) (*resources.Host, error)
- type Subnet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseNeutronError ¶
ParseNeutronError parses neutron json error and returns fields
func ProviderErrorToString ¶
ProviderErrorToString creates an error string from openstack api error
func ToGopherIPversion ¶
func ToGopherIPversion(v IPVersion.Enum) gophercloud.IPVersion
ToGopherIPversion ...
func TranslateError ¶
TranslateError translates gophercloud or openstack error to SafeScale error
Types ¶
type Router ¶
type Router struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` //NetworkID is the Network ID which the router gateway is connected to. NetworkID string `json:"network_id,omitempty"` }
Router represents a router
type RouterRequest ¶
type RouterRequest struct { Name string `json:"name,omitempty"` //NetworkID is the Network ID which the router gateway is connected to. NetworkID string `json:"network_id,omitempty"` }
RouterRequest represents a router request
type Stack ¶
type Stack struct { ComputeClient *gophercloud.ServiceClient NetworkClient *gophercloud.ServiceClient VolumeClient *gophercloud.ServiceClient Driver *gophercloud.ProviderClient // DefaultSecurityGroupName is the name of the default security groups DefaultSecurityGroupName string // DefaultSecurityGroupDescription contains a description for the default security groups DefaultSecurityGroupDescription string // SecurityGroup is an instance of the default security group SecurityGroup *secgroups.SecGroup ProviderNetworkID string // contains filtered or unexported fields }
Stack contains the needs to operate on stack OpenStack
func New ¶
func New( auth stacks.AuthenticationOptions, authScope *gophercloud.AuthScope, cfg stacks.ConfigurationOptions, serviceVersions map[string]string, ) (*Stack, error)
New authenticates and returns a Stack pointer
func (*Stack) AddPublicIPToVIP ¶
AddPublicIPToVIP adds a public IP to VIP
func (*Stack) BindHostToVIP ¶
BindHostToVIP makes the host passed as parameter an allowed "target" of the VIP
func (*Stack) CreateGateway ¶
func (s *Stack) CreateGateway(req resources.GatewayRequest) (host *resources.Host, userData *userdata.Content, err error)
CreateGateway creates a public Gateway for a private network
func (*Stack) CreateHost ¶
func (s *Stack) CreateHost(request resources.HostRequest) (host *resources.Host, userData *userdata.Content, err error)
CreateHost creates an host satisfying request
func (*Stack) CreateKeyPair ¶
CreateKeyPair creates and import a key pair
func (*Stack) CreateNetwork ¶
CreateNetwork creates a network named name
func (*Stack) CreateVolume ¶
CreateVolume creates a block volume - name is the name of the volume - size is the size of the volume in GB - volumeType is the type of volume to create, if volumeType is empty the driver use a default type
func (*Stack) CreateVolumeAttachment ¶
func (s *Stack) CreateVolumeAttachment(request resources.VolumeAttachmentRequest) (string, error)
CreateVolumeAttachment attaches a volume to an host - 'name' of the volume attachment - 'volume' to attach - 'host' on which the volume is attached
func (*Stack) DeleteGateway ¶
DeleteGateway delete the public gateway of a private network
func (*Stack) DeleteHost ¶
DeleteHost deletes the host identified by id
func (*Stack) DeleteKeyPair ¶
DeleteKeyPair deletes the key pair identified by id
func (*Stack) DeleteNetwork ¶
DeleteNetwork deletes the network identified by id
func (*Stack) DeleteVolume ¶
DeleteVolume deletes the volume identified by id
func (*Stack) DeleteVolumeAttachment ¶
DeleteVolumeAttachment deletes the volume attachment identified by id
func (*Stack) GetAuthenticationOptions ¶
func (s *Stack) GetAuthenticationOptions() stacks.AuthenticationOptions
GetAuthenticationOptions ...
func (*Stack) GetAvailabilityZoneOfServer ¶
GetAvailabilityZoneOfServer retrieves the availability zone of server 'serverID'
func (*Stack) GetConfigurationOptions ¶
func (s *Stack) GetConfigurationOptions() stacks.ConfigurationOptions
GetConfigurationOptions ...
func (*Stack) GetHostByName ¶
GetHostByName returns the host using the name passed as parameter
func (*Stack) GetHostState ¶
GetHostState returns the current state of host identified by id hostParam can be a string or an instance of *resources.Host; any other type will return an scerr.InvalidParameterError
func (*Stack) GetKeyPair ¶
GetKeyPair returns the key pair identified by id
func (*Stack) GetNetwork ¶
GetNetwork returns the network identified by id
func (*Stack) GetNetworkByName ¶
GetNetworkByName ...
func (*Stack) GetSecurityGroup ¶
GetSecurityGroup returns the default security group
func (*Stack) GetTemplate ¶
func (s *Stack) GetTemplate(id string) (template *resources.HostTemplate, err error)
GetTemplate returns the Template referenced by id
func (*Stack) GetVolumeAttachment ¶
func (s *Stack) GetVolumeAttachment(serverID, id string) (*resources.VolumeAttachment, error)
GetVolumeAttachment returns the volume attachment identified by id
func (*Stack) InitDefaultSecurityGroup ¶
InitDefaultSecurityGroup create an open Security Group The default security group opens all TCP, UDP, ICMP ports Security is managed individually on each host using a linux firewall
func (*Stack) InspectHost ¶
InspectHost updates the data inside host with the data from provider
func (*Stack) ListAvailabilityZones ¶
ListAvailabilityZones lists the usable AvailabilityZones
func (*Stack) ListImages ¶
ListImages lists available OS images
func (*Stack) ListKeyPairs ¶
ListKeyPairs lists available key pairs Returned list can be empty
func (*Stack) ListNetworks ¶
ListNetworks lists available networks
func (*Stack) ListRouters ¶
ListRouters lists available routers
func (*Stack) ListTemplates ¶
func (s *Stack) ListTemplates() ([]resources.HostTemplate, error)
ListTemplates lists available Host templates Host templates are sorted using Dominant Resource Fairness Algorithm
func (*Stack) ListVolumeAttachments ¶
func (s *Stack) ListVolumeAttachments(serverID string) ([]resources.VolumeAttachment, error)
ListVolumeAttachments lists available volume attachment
func (*Stack) ListVolumes ¶
ListVolumes returns the list of all volumes known on the current tenant
func (*Stack) RebootHost ¶
RebootHost reboots unconditionally the host identified by id
func (*Stack) ResizeHost ¶
func (s *Stack) ResizeHost(id string, request resources.SizingRequirements) (*resources.Host, error)
ResizeHost ...
func (*Stack) SelectedAvailabilityZone ¶
SelectedAvailabilityZone returns the selected availability zone
func (*Stack) UnbindHostFromVIP ¶
UnbindHostFromVIP removes the bind between the VIP and a host
func (*Stack) WaitHostReady ¶
func (s *Stack) WaitHostReady(hostParam interface{}, timeout time.Duration) (*resources.Host, error)
WaitHostReady waits an host achieve ready state hostParam can be an ID of host, or an instance of *resources.Host; any other type will return an utils.ErrInvalidParameter
type Subnet ¶
type Subnet struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` //IPVersion is IPv4 or IPv6 (see IPVersion) IPVersion IPVersion.Enum `json:"ip_version,omitempty"` //Mask mask in CIDR notation Mask string `json:"mask,omitempty"` //NetworkID id of the parent network NetworkID string `json:"network_id,omitempty"` }
Subnet define a sub network