softlayer

package
v0.0.0-...-61f2413 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "packer.softlayer"

The unique ID for this builder.

View Source
const IMAGE_TYPE_FLEX = "flex"

Image Types

View Source
const IMAGE_TYPE_STANDARD = "standard"
View Source
const SOFTLAYER_API_URL = "api.softlayer.com/rest/v3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

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

Artifact represents a Softlayer image as the result of a Packer build.

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

BuilderId returns the builder Id.

func (*Artifact) Destroy

func (self *Artifact) Destroy() error

Destroy destroys the Softlayer image represented by the artifact.

func (*Artifact) Files

func (*Artifact) Files() []string

Files returns the files represented by the artifact.

func (*Artifact) Id

func (self *Artifact) Id() string

Id returns the Softlayer image ID.

func (*Artifact) State

func (self *Artifact) State(name string) interface{}

func (*Artifact) String

func (self *Artifact) String() string

String returns the string representation of the artifact.

type BlockDevice

type BlockDevice struct {
	Id        int64      `json:"id,omitempty"`
	Device    string     `json:"device,omitempty"`
	DiskImage *DiskImage `json:"diskImage,omitempty"`
}

type BlockDeviceTemplateGroup

type BlockDeviceTemplateGroup struct {
	Id string `json:"globalIdentifier"`
}

type Builder

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

Builder represents a Packer Builder.

func (*Builder) Cancel

func (self *Builder) Cancel()

Cancel.

func (*Builder) Prepare

func (self *Builder) Prepare(raws ...interface{}) (parms []string, retErr error)

Prepare processes the build configuration parameters.

func (*Builder) Run

func (self *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

Run executes a SoftLayer Packer build and returns a packer.Artifact representing a SoftLayer machine image (flex).

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`
	Comm                communicator.Config `mapstructure:",squash"`

	Username               string `mapstructure:"username"`
	APIKey                 string `mapstructure:"api_key"`
	DatacenterName         string `mapstructure:"datacenter_name"`
	ImageName              string `mapstructure:"image_name"`
	ImageDescription       string `mapstructure:"image_description"`
	ImageType              string `mapstructure:"image_type"`
	BaseImageId            string `mapstructure:"base_image_id"`
	BaseOsCode             string `mapstructure:"base_os_code"`
	PrivateNetworkOnlyFlag bool   `mapstructure:"private_network_only_flag"`

	InstanceName           string `mapstructure:"instance_name"`
	InstanceDomain         string `mapstructure:"instance_domain"`
	InstanceCpu            int    `mapstructure:"instance_cpu"`
	InstanceMemory         int64  `mapstructure:"instance_memory"`
	InstanceNetworkSpeed   int    `mapstructure:"instance_network_speed"`
	InstanceDiskCapacities []int  `mapstructure:"instance_disk_capacities"`

	RawStateTimeout string `mapstructure:"instance_state_timeout"`
	StateTimeout    time.Duration
	// contains filtered or unexported fields
}

type Datacenter

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

type DiskImage

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

type InstanceImage

type InstanceImage struct {
	Descption string `json:"description"`
	Name      string `json:"name"`
	Summary   string `json:"summary"`
}

type InstanceReq

type InstanceReq struct {
	HostName                 string                    `json:"hostname"`
	Domain                   string                    `json:"domain"`
	Datacenter               *Datacenter               `json:"datacenter"`
	Cpus                     int                       `json:"startCpus"`
	Memory                   int64                     `json:"maxMemory"`
	HourlyBillingFlag        bool                      `json:"hourlyBillingFlag"`
	LocalDiskFlag            bool                      `json:"localDiskFlag"`
	PrivateNetworkOnlyFlag   bool                      `json:"privateNetworkOnlyFlag"`
	NetworkComponents        []*NetworkComponent       `json:"networkComponents"`
	BlockDeviceTemplateGroup *BlockDeviceTemplateGroup `json:"blockDeviceTemplateGroup,omitempty"`
	BlockDevices             []*BlockDevice            `json:"blockDevices,omitempty"`
	OsReferenceCode          string                    `json:"operatingSystemReferenceCode,omitempty"`
	SshKeys                  []*SshKey                 `json:"sshKeys,omitempty"`
}

type InstanceType

type InstanceType struct {
	HostName               string `json:"hostname"`
	Domain                 string
	Datacenter             string
	Cpus                   int
	Memory                 int64
	HourlyBillingFlag      bool
	LocalDiskFlag          bool
	PrivateNetworkOnlyFlag bool
	DiskCapacities         []int
	NetworkSpeed           int
	ProvisioningSshKeyId   int64
	BaseImageId            string
	BaseOsCode             string
}

Based on: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Virtual_Guest_Configuration/

type NetworkComponent

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

type SoftLayerRequest

type SoftLayerRequest struct {
	Parameters interface{} `json:"parameters"`
}

type SoftlayerClient

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

func (SoftlayerClient) CreateInstance

func (self SoftlayerClient) CreateInstance(instance InstanceType) (map[string]interface{}, error)

func (SoftlayerClient) DestroyInstance

func (self SoftlayerClient) DestroyInstance(instanceId string) error

func (SoftlayerClient) DestroySshKey

func (self SoftlayerClient) DestroySshKey(keyId int64) error

func (SoftlayerClient) New

func (self SoftlayerClient) New(user string, key string) *SoftlayerClient

func (SoftlayerClient) UploadSshKey

func (self SoftlayerClient) UploadSshKey(label string, publicKey string) (keyId int64, err error)

type SshKey

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

Jump to

Keyboard shortcuts

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