flexibleengine

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptions

type AuthOptions struct {
	IdentityEndpoint string
	Username         string
	Password         string
	DomainName       string
	ProjectID        string

	AllowReauth bool

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

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

	// Name of the VPC (Virtual Private Cloud)
	VPCName string
	// CIDR if the VPC
	VPCCIDR string

	// Identifier for S3 object storage use
	S3AccessKeyID string
	// Password of the previous identifier
	S3AccessKeyPassword string
}

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

type Client

type Client struct {
	// Opts contains authentication options
	Opts *AuthOptions
	// Identity contains service client of Identity openstack service
	Identity *gc.ServiceClient

	// SecurityGroup is an instance of the default security group
	SecurityGroup *secgroups.SecGroup
	// contains filtered or unexported fields
}

Client is the implementation of the flexibleengine driver regarding to the api.ClientAPI

func AuthenticatedClient

func AuthenticatedClient(opts AuthOptions, cfg openstack.CfgOptions) (*Client, error)

AuthenticatedClient returns an authenticated client

func (*Client) AssociateFloatingIP

func (client *Client) AssociateFloatingIP(host *model.Host, id string) error

AssociateFloatingIP to host

func (*Client) Build

func (client *Client) Build(params map[string]interface{}) (api.ClientAPI, error)

Build build a new Client from configuration parameter

func (*Client) CreateFloatingIP

func (client *Client) CreateFloatingIP() (*FloatingIP, error)

CreateFloatingIP creates a floating IP

func (*Client) CreateGateway

func (client *Client) CreateGateway(req model.GatewayRequest) (*model.Host, error)

CreateGateway creates a gateway for a network. By current implementation, only one gateway can exist by Network because the object is intended to contain only one hostID

func (*Client) CreateHost

func (client *Client) CreateHost(request model.HostRequest) (*model.Host, error)

CreateHost creates a new host

func (*Client) CreateKeyPair

func (client *Client) CreateKeyPair(name string) (*model.KeyPair, error)

CreateKeyPair creates and import a key pair

func (*Client) CreateNetwork

func (client *Client) CreateNetwork(req model.NetworkRequest) (*model.Network, error)

CreateNetwork creates a network (ie a subnet in the network associated to VPC in FlexibleEngine

func (*Client) CreateVPC

func (client *Client) CreateVPC(req VPCRequest) (*VPC, error)

CreateVPC creates a network, which is managed by VPC in FlexibleEngine

func (*Client) CreateVolume

func (client *Client) CreateVolume(request model.VolumeRequest) (*model.Volume, error)

CreateVolume creates a block volume

func (*Client) CreateVolumeAttachment

func (client *Client) CreateVolumeAttachment(request model.VolumeAttachmentRequest) (string, error)

CreateVolumeAttachment attaches a volume to an host

func (*Client) DeleteFloatingIP

func (client *Client) DeleteFloatingIP(id string) error

DeleteFloatingIP deletes a floating IP

func (*Client) DeleteGateway

func (client *Client) DeleteGateway(id string) error

DeleteGateway deletes the gateway associated with network identified by ID

func (*Client) DeleteHost

func (client *Client) DeleteHost(id string) error

DeleteHost deletes the host identified by id

func (*Client) DeleteKeyPair

func (client *Client) DeleteKeyPair(id string) error

DeleteKeyPair deletes the key pair identified by id

func (*Client) DeleteNetwork

func (client *Client) DeleteNetwork(id string) error

DeleteNetwork consists to delete subnet in FlexibleEngine VPC

func (*Client) DeleteVPC

func (client *Client) DeleteVPC(id string) error

DeleteVPC deletes a Network (ie a VPC in Flexible Engine) identified by 'id'

func (*Client) DeleteVolume

func (client *Client) DeleteVolume(id string) error

DeleteVolume deletes the volume identified by id

func (*Client) DeleteVolumeAttachment

func (client *Client) DeleteVolumeAttachment(serverID, vaID string) error

DeleteVolumeAttachment deletes the volume attachment identifed by id

func (*Client) DissociateFloatingIP

func (client *Client) DissociateFloatingIP(host *model.Host, id string) error

DissociateFloatingIP from host

func (*Client) FindFloatingIPByIP

func (client *Client) FindFloatingIPByIP(ipAddress string) (*FloatingIP, error)

FindFloatingIPByIP returns FloatingIP instance associated with 'ipAddress'

func (*Client) GetAuthOpts

func (client *Client) GetAuthOpts() (model.Config, error)

GetAuthOpts returns the auth options

func (*Client) GetCfgOpts

func (client *Client) GetCfgOpts() (model.Config, error)

GetCfgOpts return configuration parameters

func (*Client) GetFloatingIP

func (client *Client) GetFloatingIP(id string) (*FloatingIP, error)

GetFloatingIP returns FloatingIP instance corresponding to ID 'id'

func (*Client) GetHost

func (client *Client) GetHost(hostParam interface{}) (*model.Host, error)

GetHost updates the data inside host with the data from provider

func (*Client) GetHostByName

func (client *Client) GetHostByName(name string) (*model.Host, error)

GetHostByName ...

func (*Client) GetHostState

func (client *Client) GetHostState(hostParam interface{}) (HostState.Enum, error)

GetHostState ...

func (*Client) GetImage

func (client *Client) GetImage(id string) (*model.Image, error)

GetImage returns the Image referenced by id

func (*Client) GetKeyPair

func (client *Client) GetKeyPair(id string) (*model.KeyPair, error)

GetKeyPair returns the key pair identified by id

func (*Client) GetNetwork

func (client *Client) GetNetwork(id string) (*model.Network, error)

GetNetwork returns the network identified by id

func (*Client) GetNetworkByName

func (client *Client) GetNetworkByName(name string) (*model.Network, error)

GetNetworkByName ...

func (*Client) GetTemplate

func (client *Client) GetTemplate(id string) (*model.HostTemplate, error)

GetTemplate returns the Template referenced by id

func (*Client) GetVPC

func (client *Client) GetVPC(id string) (*VPC, error)

GetVPC returns the information about a VPC identified by 'id'

func (*Client) GetVolume

func (client *Client) GetVolume(id string) (*model.Volume, error)

GetVolume returns the volume identified by id If volume not found, returns (nil, nil)

func (*Client) GetVolumeAttachment

func (client *Client) GetVolumeAttachment(serverID, id string) (*model.VolumeAttachment, error)

GetVolumeAttachment returns the volume attachment identified by id

func (*Client) ListAvailabilityZones

func (client *Client) ListAvailabilityZones(all bool) (map[string]bool, error)

ListAvailabilityZones lists the usable Availability Zones

func (*Client) ListFloatingIPs

func (client *Client) ListFloatingIPs() pagination.Pager

ListFloatingIPs lists all the floating IP currently requested for the VPC

func (*Client) ListHosts

func (client *Client) ListHosts() ([]*model.Host, error)

ListHosts lists available hosts

func (*Client) ListImages

func (client *Client) ListImages(all bool) ([]model.Image, error)

ListImages lists available OS images

func (*Client) ListKeyPairs

func (client *Client) ListKeyPairs() ([]model.KeyPair, error)

ListKeyPairs lists available key pairs

func (*Client) ListNetworks

func (client *Client) ListNetworks() ([]*model.Network, error)

ListNetworks lists networks

func (*Client) ListTemplates

func (client *Client) ListTemplates(all bool) ([]model.HostTemplate, error)

ListTemplates lists available host templates Host templates are sorted using Dominant Resource Fairness Algorithm

func (*Client) ListVPCs

func (client *Client) ListVPCs() ([]VPC, error)

ListVPCs lists all the VPC created

func (*Client) ListVolumeAttachments

func (client *Client) ListVolumeAttachments(serverID string) ([]model.VolumeAttachment, error)

ListVolumeAttachments lists available volume attachment

func (*Client) ListVolumes

func (client *Client) ListVolumes() ([]model.Volume, error)

ListVolumes lists volumes

func (*Client) RebootHost

func (client *Client) RebootHost(id string) error

RebootHost ...

func (*Client) StartHost

func (client *Client) StartHost(id string) error

StartHost starts the host identified by id

func (*Client) StopHost

func (client *Client) StopHost(id string) error

StopHost stops the host identified by id

func (*Client) WaitHostReady

func (client *Client) WaitHostReady(hostParam interface{}, timeout time.Duration) (*model.Host, error)

WaitHostReady waits an host achieve ready state hostParam can be an ID of host, or an instance of *model.Host; any other type will panic

type FloatingIP

type FloatingIP struct {
	ID              string `json:"id"`
	Status          string `json:"status"`
	Type            string `json:"type"`
	PublicIPAddress string `json:"public_ip_address"`
	TenantID        string `json:"tenant_id"`
	CreateTime      string `json:"create_time"`
	BandwidthSize   int    `json:"bandwidth_size"`
}

FloatingIP represents a FlexibleEngine Floating IP

type ListOpts

type ListOpts struct {
	Marker string `json:"marker,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

ListOpts to define parameter of list

type VPC

type VPC struct {
	ID      string `json:"id"`
	Name    string `json:"name,omitempty"`
	CIDR    string `json:"cidr,omitempty"`
	Status  string `json:"status,omitempty"`
	Network *networks.Network
	Router  *routers.Router
}

VPC contains information about a VPC

type VPCRequest

type VPCRequest struct {
	Name string `json:"name"`
	CIDR string `json:"cidr"`
}

VPCRequest defines a request to create a VPC

Jump to

Keyboard shortcuts

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