yandex

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderID = "packer.yandex"

The unique ID for this builder.

View Source
const StandardImagesFolderID = "standard-images"

Variables

View Source
var TemplateFuncs = template.FuncMap{
	"clean_image_name": templateCleanImageName,
}

Functions

This section is empty.

Types

type Artifact

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

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*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 Builder

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

Builder represents a Packer Builder.

func (*Builder) Prepare

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

Prepare processes the build configuration parameters.

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

Run executes a yandex Packer build and returns a packer.Artifact representing a Yandex.Cloud compute image.

type Config

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

	Endpoint              string `mapstructure:"endpoint"`
	FolderID              string `mapstructure:"folder_id"`
	ServiceAccountKeyFile string `mapstructure:"service_account_key_file"`
	Token                 string `mapstructure:"token"`

	DiskName            string            `mapstructure:"disk_name"`
	DiskSizeGb          int               `mapstructure:"disk_size_gb"`
	DiskType            string            `mapstructure:"disk_type"`
	ImageDescription    string            `mapstructure:"image_description"`
	ImageFamily         string            `mapstructure:"image_family"`
	ImageLabels         map[string]string `mapstructure:"image_labels"`
	ImageName           string            `mapstructure:"image_name"`
	ImageProductIDs     []string          `mapstructure:"image_product_ids"`
	InstanceCores       int               `mapstructure:"instance_cores"`
	InstanceMemory      int               `mapstructure:"instance_mem_gb"`
	InstanceName        string            `mapstructure:"instance_name"`
	Labels              map[string]string `mapstructure:"labels"`
	PlatformID          string            `mapstructure:"platform_id"`
	Metadata            map[string]string `mapstructure:"metadata"`
	SerialLogFile       string            `mapstructure:"serial_log_file"`
	SourceImageFamily   string            `mapstructure:"source_image_family"`
	SourceImageFolderID string            `mapstructure:"source_image_folder_id"`
	SourceImageID       string            `mapstructure:"source_image_id"`
	SubnetID            string            `mapstructure:"subnet_id"`
	UseIPv4Nat          bool              `mapstructure:"use_ipv4_nat"`
	UseIPv6             bool              `mapstructure:"use_ipv6"`
	UseInternalIP       bool              `mapstructure:"use_internal_ip"`
	Zone                string            `mapstructure:"zone"`

	StateTimeout time.Duration `mapstructure:"state_timeout"`
	// contains filtered or unexported fields
}

func NewConfig

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

type Driver

type Driver interface {
	DeleteImage(id string) error
	SDK() *ycsdk.SDK
	GetImage(imageID string) (*Image, error)
	GetImageFromFolder(ctx context.Context, folderID string, family string) (*Image, error)
	DeleteDisk(ctx context.Context, diskID string) error
	DeleteInstance(ctx context.Context, instanceID string) error
	DeleteSubnet(ctx context.Context, subnetID string) error
	DeleteNetwork(ctx context.Context, networkID string) error
}

func NewDriverYC

func NewDriverYC(ui packer.Ui, config *Config) (Driver, error)

type Image

type Image struct {
	ID            string
	FolderID      string
	Labels        map[string]string
	Licenses      []string
	MinDiskSizeGb int
	Name          string
	Family        string
	SizeGb        int
}

Jump to

Keyboard shortcuts

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