ovh

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: 10 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 {
	// // Endpoint ovh end point (ovh-eu, ovh-ca ...)
	// Endpoint string
	// //Application or Project Name
	// ApplicationName string
	// Application Key or project ID
	ApplicationKey string
	// //Consumer key
	// ConsumerKey string
	// Openstack identifier
	OpenstackID string
	// OpenStack password
	OpenstackPassword string
	// Name of the data center (GRA3, BHS3 ...)
	Region string
	// Project Name
	ProjectName string
}

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

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the implementation of the ovh driver regarding to the api.ClientAPI This client used ovh api and opensatck ovh api to maximize code reuse

func AuthenticatedClient

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

AuthenticatedClient returns an authenticated client

func (*Client) Build

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

Build build a new Client from configuration parameter

func (*Client) CreateGateway

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

CreateGateway creates a public Gateway for a private network

func (*Client) CreateHost

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

CreateHost creates an host satisfying request

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 named name

func (*Client) CreateVolume

func (client *Client) CreateVolume(request model.VolumeRequest) (*model.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 (*Client) CreateVolumeAttachment

func (client *Client) CreateVolumeAttachment(request model.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 (*Client) DeleteGateway

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

DeleteGateway delete the public gateway of a private network

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(networkRef string) error

DeleteNetwork deletes the network 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 ...

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) GetHost

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

GetHost returns the host identified by id

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 returns the host identified by id

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(ref string) (*model.Network, error)

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

func (*Client) GetNetworkByName

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

GetNetworkByName returns the network identified name

func (*Client) GetTemplate

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

GetTemplate overload OpenStack GetTemplate method to add GPU configuration

func (*Client) GetVolume

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

GetVolume returns the volume identified by id

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 ...

func (*Client) ListHosts

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

ListHosts lists all 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 overload OpenStack ListTemplate method to filter wind and flex instance and add GPU configuration

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 volume IDs

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(hostID string, timeout time.Duration) (*model.Host, error)

WaitHostReady waits an host achieve ready state

Jump to

Keyboard shortcuts

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