upcloudimport

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 23 Imported by: 1 module, 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

Index

Constants

View Source
const (
	BuilderID string = "packer.post-processor.upcloud-import"
)
View Source
const DefaultTimeout time.Duration = 60 * time.Minute

Variables

This section is empty.

Functions

func NewImage added in v1.7.0

func NewImage(path string) (*image, error)

Types

type Artifact

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

func (*Artifact) BuilderId

func (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

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

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State

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

func (*Artifact) String

func (a *Artifact) String() string

type Config

type Config struct {
	// The username to use when interfacing with the UpCloud API.
	Username string `mapstructure:"username"`

	// The password to use when interfacing with the UpCloud API.
	Password string `mapstructure:"password"`

	// The API token to use when interfacing with the UpCloud API. This is mutually exclusive with username and password.
	Token string `mapstructure:"token"`

	// The list of zones in which the template should be imported
	Zones []string `mapstructure:"zones" required:"true"`

	// The name of the template. Use `replace_existing` to replace existing template
	// with same name or suffix template name with e.g. timestamp to avoid errors during import
	TemplateName string `mapstructure:"template_name" required:"true"`

	// Replace existing template if one exists with the same name. Defaults to `false`.
	ReplaceExisting bool `mapstructure:"replace_existing"`

	// The storage tier to use. Available options are `maxiops`, `archive`, and `standard`. Defaults to `maxiops`.
	StorageTier string `mapstructure:"storage_tier"`

	// The storage size in gigabytes. If not specified, defaults to the image size
	// (minimum 10GB). When importing compressed images that expand significantly, specify
	// a larger value to ensure adequate space for the uncompressed content.
	StorageSize int `mapstructure:"storage_size"`

	// The amount of time to wait for resource state changes. Defaults to `60m`.
	Timeout time.Duration `mapstructure:"state_timeout_duration"`

	common.PackerConfig `mapstructure:",squash"`
	// contains filtered or unexported fields
}

func NewConfig

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

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatConfig

type FlatConfig struct {
	Username            *string           `mapstructure:"username" cty:"username" hcl:"username"`
	Password            *string           `mapstructure:"password" cty:"password" hcl:"password"`
	Token               *string           `mapstructure:"token" cty:"token" hcl:"token"`
	Zones               []string          `mapstructure:"zones" required:"true" cty:"zones" hcl:"zones"`
	TemplateName        *string           `mapstructure:"template_name" required:"true" cty:"template_name" hcl:"template_name"`
	ReplaceExisting     *bool             `mapstructure:"replace_existing" cty:"replace_existing" hcl:"replace_existing"`
	StorageTier         *string           `mapstructure:"storage_tier" cty:"storage_tier" hcl:"storage_tier"`
	StorageSize         *int              `mapstructure:"storage_size" cty:"storage_size" hcl:"storage_size"`
	Timeout             *string           `mapstructure:"state_timeout_duration" cty:"state_timeout_duration" hcl:"state_timeout_duration"`
	PackerBuildName     *string           `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType   *string           `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion   *string           `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug         *bool             `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce         *bool             `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError       *string           `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars      map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars []string          `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type PostProcessor

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

func (*PostProcessor) ConfigSpec

func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec

func (*PostProcessor) Configure

func (p *PostProcessor) Configure(raws ...interface{}) error

func (*PostProcessor) PostProcess

func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, a packer.Artifact) (packer.Artifact, bool, bool, error)

PostProcess takes a previously created Artifact and produces another Artifact. If an error occurs, it should return that error. If `keep` is true, then the previous artifact defaults to being kept if user has not given a value to keep_input_artifact. If forceOverride is true, then any user input for keep_input_artifact is ignored and the artifact is either kept or discarded according to the value set in `keep`. PostProcess is cancellable using context.

Jump to

Keyboard shortcuts

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