oci

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MPL-2.0, MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package oci contains a packer.Builder implementation that builds Oracle Bare Metal Cloud Services (OCI) images.

Index

Constants

View Source
const BuilderId = "packer.oracle.oci"

BuilderId uniquely identifies the builder

Variables

This section is empty.

Functions

func SSHConfig

func SSHConfig(username, password string) func(state multistep.StateBag) (*ssh.ClientConfig, error)

SSHConfig returns a function that can be used for the SSH communicator config for connecting to the instance created over SSH using the private key or password.

Types

type Artifact

type Artifact struct {
	Image  client.Image
	Region string
	// contains filtered or unexported fields
}

Artifact is an artifact implementation that contains a built Custom Image.

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

BuilderId uniquely identifies the builder.

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

Destroy deletes the custom image associated with the artifact.

func (*Artifact) Files

func (a *Artifact) Files() []string

Files lists the files associated with an artifact. We don't have any files as the custom image is stored server side.

func (*Artifact) Id

func (a *Artifact) Id() string

Id returns the OCID of the associated Image.

func (*Artifact) State

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

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

Builder is a builder implementation that creates Oracle OCI custom images.

func (*Builder) Cancel

func (b *Builder) Cancel()

Cancel terminates a running build.

func (*Builder) Prepare

func (b *Builder) Prepare(rawConfig ...interface{}) ([]string, error)

func (*Builder) Run

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

type Config

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

	AccessCfg *client.Config

	AccessCfgFile        string `mapstructure:"access_cfg_file"`
	AccessCfgFileAccount string `mapstructure:"access_cfg_file_account"`

	// Access config overrides
	UserID      string `mapstructure:"user_ocid"`
	TenancyID   string `mapstructure:"tenancy_ocid"`
	Region      string `mapstructure:"region"`
	Fingerprint string `mapstructure:"fingerprint"`
	KeyFile     string `mapstructure:"key_file"`
	PassPhrase  string `mapstructure:"pass_phrase"`

	AvailabilityDomain string `mapstructure:"availability_domain"`
	CompartmentID      string `mapstructure:"compartment_ocid"`

	// Image
	BaseImageID string `mapstructure:"base_image_ocid"`
	Shape       string `mapstructure:"shape"`
	ImageName   string `mapstructure:"image_name"`

	// Networking
	SubnetID string `mapstructure:"subnet_ocid"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(raws ...interface{}) (*Config, error)

type Driver

type Driver interface {
	CreateInstance(publicKey string) (string, error)
	CreateImage(id string) (client.Image, error)
	DeleteImage(id string) error
	GetInstanceIP(id string) (string, error)
	TerminateInstance(id string) error
	WaitForImageCreation(id string) error
	WaitForInstanceState(id string, waitStates []string, terminalState string) error
}

Driver interfaces between the builder steps and the OCI SDK.

func NewDriverOCI

func NewDriverOCI(cfg *Config) (Driver, error)

NewDriverOCI Creates a new driverOCI with a connected client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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