gcp

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPInSubnet

type IPInSubnet struct {
	Subnet   SelfLink
	Name     string
	ID       string
	IP       string
	PublicIP string
}

IPInSubnet ...

type OpContext

type OpContext struct {
	Operation    *compute.Operation
	ProjectID    string
	Service      *compute.Service
	DesiredState string
}

OpContext ...

type Result

type Result struct {
	State string
	Error error
	Done  bool
}

Result ...

func RefreshResult

func RefreshResult(oco OpContext) (res Result, err error)

RefreshResult ...

type SelfLink = url.URL

SelfLink ...

type Stack

type Stack struct {
	Config      *stacks.ConfigurationOptions
	AuthOptions *stacks.AuthenticationOptions
	GcpConfig   *stacks.GCPConfiguration

	ComputeService *compute.Service
}

Stack ...

func New

New Create and initialize a ClientAPI

func (*Stack) AddPublicIPToVIP

func (s *Stack) AddPublicIPToVIP(vip *resources.VIP) error

AddPublicIPToVIP adds a public IP to VIP

func (*Stack) BindHostToVIP

func (s *Stack) BindHostToVIP(vip *resources.VIP, host *resources.Host) error

BindHostToVIP makes the host passed as parameter an allowed "target" of the VIP

func (*Stack) CreateGateway

func (s *Stack) CreateGateway(req resources.GatewayRequest) (*resources.Host, *userdata.Content, 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

func (s *Stack) CreateKeyPair(name string) (*resources.KeyPair, error)

CreateKeyPair creates and import a key pair

func (*Stack) CreateNetwork

func (s *Stack) CreateNetwork(req resources.NetworkRequest) (*resources.Network, error)

CreateNetwork creates a network named name

func (*Stack) CreateVIP

func (s *Stack) CreateVIP(networkID string, description string) (*resources.VIP, error)

CreateVIP creates a private virtual IP If public is set to true,

func (*Stack) CreateVolume

func (s *Stack) CreateVolume(request resources.VolumeRequest) (*resources.Volume, error)

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

func (s *Stack) DeleteGateway(ref string) error

DeleteGateway delete the public gateway referenced by ref (id or name)

func (*Stack) DeleteHost

func (s *Stack) DeleteHost(id string) (err error)

DeleteHost deletes the host identified by id

func (*Stack) DeleteKeyPair

func (s *Stack) DeleteKeyPair(id string) error

DeleteKeyPair deletes the key pair identified by id

func (*Stack) DeleteNetwork

func (s *Stack) DeleteNetwork(ref string) (err error)

DeleteNetwork deletes the network identified by id

func (*Stack) DeleteVIP

func (s *Stack) DeleteVIP(vip *resources.VIP) error

DeleteVIP deletes the port corresponding to the VIP

func (*Stack) DeleteVolume

func (s *Stack) DeleteVolume(ref string) error

DeleteVolume deletes the volume identified by id

func (*Stack) DeleteVolumeAttachment

func (s *Stack) DeleteVolumeAttachment(serverID, id string) error

DeleteVolumeAttachment ...

func (*Stack) GetAuthenticationOptions

func (s *Stack) GetAuthenticationOptions() stacks.AuthenticationOptions

GetAuthenticationOptions ...

func (*Stack) GetConfigurationOptions

func (s *Stack) GetConfigurationOptions() stacks.ConfigurationOptions

GetConfigurationOptions ...

func (*Stack) GetHostByName

func (s *Stack) GetHostByName(name string) (*resources.Host, error)

GetHostByName returns the host identified by ref (name or id)

func (*Stack) GetHostState

func (s *Stack) GetHostState(hostParam interface{}) (HostState.Enum, error)

GetHostState returns the host identified by id

func (*Stack) GetImage

func (s *Stack) GetImage(id string) (*resources.Image, error)

GetImage returns the Image referenced by id

func (*Stack) GetKeyPair

func (s *Stack) GetKeyPair(id string) (*resources.KeyPair, error)

GetKeyPair returns the key pair identified by id

func (*Stack) GetNetwork

func (s *Stack) GetNetwork(ref string) (*resources.Network, error)

GetNetwork returns the network identified by ref (id or name)

func (*Stack) GetNetworkByName

func (s *Stack) GetNetworkByName(ref string) (*resources.Network, error)

GetNetworkByName returns the network identified by ref (id or name)

func (*Stack) GetTemplate

func (s *Stack) GetTemplate(id string) (*resources.HostTemplate, error)

GetTemplate overload OpenStackGcp GetTemplate method to add GPU configuration

func (*Stack) GetVolume

func (s *Stack) GetVolume(ref string) (*resources.Volume, error)

GetVolume returns the volume identified 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) InspectHost

func (s *Stack) InspectHost(hostParam interface{}) (host *resources.Host, err error)

InspectHost returns the host identified by ref (name or id) or by a *resources.Host containing an id

func (*Stack) ListAvailabilityZones

func (s *Stack) ListAvailabilityZones() (map[string]bool, error)

ListAvailabilityZones lists the usable AvailabilityZones

func (*Stack) ListHosts

func (s *Stack) ListHosts() ([]*resources.Host, error)

ListHosts lists available hosts

func (*Stack) ListImages

func (s *Stack) ListImages() (images []resources.Image, err error)

ListImages lists available OS images

func (*Stack) ListKeyPairs

func (s *Stack) ListKeyPairs() ([]resources.KeyPair, error)

ListKeyPairs lists available key pairs

func (*Stack) ListNetworks

func (s *Stack) ListNetworks() ([]*resources.Network, error)

ListNetworks lists available networks

func (*Stack) ListRegions

func (s *Stack) ListRegions() ([]string, error)

ListRegions ...

func (*Stack) ListTemplates

func (s *Stack) ListTemplates(all bool) (templates []resources.HostTemplate, err error)

ListTemplates overload OpenStackGcp ListTemplate method to filter wind and flex instance and add GPU configuration

func (*Stack) ListVolumeAttachments

func (s *Stack) ListVolumeAttachments(serverID string) ([]resources.VolumeAttachment, error)

ListVolumeAttachments lists available volume attachment

func (*Stack) ListVolumes

func (s *Stack) ListVolumes() ([]resources.Volume, error)

ListVolumes return the list of all volume known on the current tenant

func (*Stack) RebootHost

func (s *Stack) RebootHost(id string) error

RebootHost reboot the host identified by id

func (*Stack) ResizeHost

func (s *Stack) ResizeHost(id string, request resources.SizingRequirements) (*resources.Host, error)

ResizeHost change the template used by an host

func (*Stack) StartHost

func (s *Stack) StartHost(id string) error

StartHost starts the host identified by id

func (*Stack) StopHost

func (s *Stack) StopHost(id string) error

StopHost stops the host identified by id

func (*Stack) UnbindHostFromVIP

func (s *Stack) UnbindHostFromVIP(vip *resources.VIP, host *resources.Host) error

UnbindHostFromVIP removes the bind between the VIP and a host

func (*Stack) WaitHostReady

func (s *Stack) WaitHostReady(hostParam interface{}, timeout time.Duration) (res *resources.Host, err 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.

Jump to

Keyboard shortcuts

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