qingcloud

package
v0.0.0-...-7d20a08 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INSTANCE_STATUS_PENDING    = "pending"
	INSTANCE_STATUS_RUNNING    = "running"
	INSTANCE_STATUS_STOPPED    = "stopped"
	INSTANCE_STATUS_SUSPENDED  = "suspended"
	INSTANCE_STATUS_TERMINATED = "terminated"
	INSTANCE_STATUS_CEASED     = "ceased"
)
View Source
const (
	DefaultSecurityGroupName = "docker-machine"
)

Variables

View Source
var DefaultInstanceClassByZone = map[string]int{"pek1": 0, "pek2": 0, "pek3a": 0, "gd1": 0, "ap1": 0, "sh1a": 1}

Functions

This section is empty.

Types

type Client

type Client interface {
	RunInstance(arg *RunInstanceArg) (*qcservice.Instance, error)
	DescribeInstance(instanceID *string) (*qcservice.Instance, error)
	StartInstance(instanceID *string) error
	StopInstance(instanceID *string, force bool) error
	RestartInstance(instanceID *string) error
	TerminateInstance(instanceID *string) error
	WaitInstanceStatus(instanceID *string, status string) error

	BindEIP(instanceID *string) (*qcservice.EIP, error)
	ReleaseEIP(eipID *string) error
	BindSecurityGroup(instanceID *string, rules []*qcservice.SecurityGroupRule) (*qcservice.SecurityGroup, error)
	DeleteSecurityGroup(sgID *string) error

	CreateKeyPair(keyPairName *string, publicKey *string) (*string, error)
	DescribeKeyPair(keyPairID *string) (*qcservice.KeyPair, error)
	DeleteKeyPair(keyPairID *string) error
}

func NewClient

func NewClient(config *config.Config, zone string) (Client, error)

type Driver

type Driver struct {
	*drivers.BaseDriver
	AccessKeyID     string
	SecretAccessKey string
	Zone            string
	Image           string
	CPU             int
	Memory          int
	LoginKeyPair    string
	VxNet           string
	InstanceID      *string
	EIP             *qcservice.EIP
	SecurityGroup   *qcservice.SecurityGroup
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(hostName, storePath string) *Driver

func (*Driver) Config

func (d *Driver) Config() *config.Config

func (*Driver) Create

func (d *Driver) Create() error

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetClient

func (d *Driver) GetClient() Client

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a Docker compatible host URL for connecting to this host e.g. tcp://1.2.3.4:2376

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a host forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck allows for pre-create operations to make sure a driver is ready for creation

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a host

func (*Driver) Restart

func (d *Driver) Restart() error

Restart a host. This may just call Stop(); Start() if the provider does not have any special restart behaviour.

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags configures the driver with the object that was returned by RegisterCreateFlags

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

type RunInstanceArg

type RunInstanceArg struct {
	CPU          int
	Memory       int
	ImageID      string
	LoginKeyPair string
	VxNet        string
	InstanceName string
}

type SSHKeyPair

type SSHKeyPair struct {
	ID string
}

Jump to

Keyboard shortcuts

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