oci

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MPL-2.0, MPL-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 NewRawConfigurationProvider added in v1.2.3

func NewRawConfigurationProvider(tenancy, user, region, fingerprint, privateKey string, privateKeyPassphrase *string) common.ConfigurationProvider

NewRawConfigurationProvider will create a rawConfigurationProvider.

Types

type Artifact

type Artifact struct {
	Image  core.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"`

	ConfigProvider ocicommon.ConfigurationProvider

	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"`
	UsePrivateIP bool   `mapstructure:"use_private_ip"`

	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"`
	// UserData and UserDataFile file are both optional and mutually exclusive.
	UserData     string `mapstructure:"user_data"`
	UserDataFile string `mapstructure:"user_data_file"`

	// 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) (core.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 compute client and a connected vcn client.

Jump to

Keyboard shortcuts

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