softlayer

package
Version: v0.16.2-gitlab.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIEndpoint = "https://api.softlayer.com/rest/v3"
)

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(hostName, storePath string) drivers.Driver

Types

type BlockDevice

type BlockDevice struct {
	Device    string    `json:"device"`
	DiskImage DiskImage `json:"diskImage"`
}

type Client

type Client struct {
	User     string
	ApiKey   string
	Endpoint string
}

func NewClient

func NewClient(user, key, endpoint string) *Client

func (*Client) SSHKey

func (c *Client) SSHKey() *sshKey

func (*Client) VirtualGuest

func (c *Client) VirtualGuest() *VirtualGuest

type Datacenter

type Datacenter struct {
	Name string `json:"name"`
}

type DiskImage

type DiskImage struct {
	Capacity int `json:"capacity"`
}

type Driver

type Driver struct {
	*drivers.BaseDriver

	Id       int
	Client   *Client
	SSHKeyID int
	// contains filtered or unexported fields
}

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

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

func (*Driver) GetCreateFlags

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

func (*Driver) GetIP

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

func (*Driver) GetSSHHostname

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

func (*Driver) GetState

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

func (*Driver) GetURL

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

func (*Driver) Kill

func (d *Driver) Kill() error

func (*Driver) Remove

func (d *Driver) Remove() error

func (*Driver) Restart

func (d *Driver) Restart() error

func (*Driver) SetConfigFromFlags

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

func (*Driver) Start

func (d *Driver) Start() error

func (*Driver) Stop

func (d *Driver) Stop() error

type HostSpec

type HostSpec struct {
	Hostname                       string            `json:"hostname"`
	Domain                         string            `json:"domain"`
	Cpu                            int               `json:"startCpus"`
	Memory                         int               `json:"maxMemory"`
	Datacenter                     Datacenter        `json:"datacenter"`
	SshKeys                        []*SSHKey         `json:"sshKeys"`
	BlockDevices                   []BlockDevice     `json:"blockDevices"`
	NetworkMaxSpeeds               []NetworkMaxSpeed `json:"networkComponents"`
	InstallScript                  string            `json:"postInstallScriptUri"`
	PrivateNetOnly                 bool              `json:"privateNetworkOnlyFlag"`
	Os                             string            `json:"operatingSystemReferenceCode"`
	HourlyBilling                  bool              `json:"hourlyBillingFlag"`
	LocalDisk                      bool              `json:"localDiskFlag"`
	PrimaryNetworkComponent        *NetworkComponent `json:"primaryNetworkComponent,omitempty"`
	PrimaryBackendNetworkComponent *NetworkComponent `json:"primaryBackendNetworkComponent,omitempty"`
}

type NetworkComponent

type NetworkComponent struct {
	NetworkVLAN *NetworkVLAN `json:"networkVlan"`
}

type NetworkMaxSpeed

type NetworkMaxSpeed struct {
	MaxSpeed int `json:"maxSpeed"`
}

type NetworkVLAN

type NetworkVLAN struct {
	Id int `json:"id"`
}

type SSHKey

type SSHKey struct {
	Key   string `json:"key,omitempty"`
	Id    int    `json:"id,omitempty"`
	Label string `json:"label,omitempty"`
}

type VirtualGuest

type VirtualGuest struct {
	*Client
}

func (*VirtualGuest) ActiveTransaction

func (c *VirtualGuest) ActiveTransaction(id int) (string, error)

func (*VirtualGuest) Cancel

func (c *VirtualGuest) Cancel(id int) error

func (*VirtualGuest) Create

func (c *VirtualGuest) Create(spec *HostSpec) (int, error)

func (*VirtualGuest) GetPrivateIP

func (c *VirtualGuest) GetPrivateIP(id int) (string, error)

func (*VirtualGuest) GetPublicIP

func (c *VirtualGuest) GetPublicIP(id int) (string, error)

func (*VirtualGuest) Pause

func (c *VirtualGuest) Pause(id int) error

func (*VirtualGuest) PowerOff

func (c *VirtualGuest) PowerOff(id int) error

func (*VirtualGuest) PowerOn

func (c *VirtualGuest) PowerOn(id int) error

func (*VirtualGuest) PowerState

func (c *VirtualGuest) PowerState(id int) (string, error)

func (*VirtualGuest) Reboot

func (c *VirtualGuest) Reboot(id int) error

func (*VirtualGuest) Resume

func (c *VirtualGuest) Resume(id int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL