diskconfig

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package diskconfig provides information and interaction with the Disk Config extension that works with the OpenStack Compute service.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDiskConfig = errors.New("DiskConfig must be either diskconfig.Auto or diskconfig.Manual.")

ErrInvalidDiskConfig is returned if an invalid string is specified for a DiskConfig option.

Functions

This section is empty.

Types

type CreateOptsExt

type CreateOptsExt struct {
	servers.CreateOptsBuilder

	// DiskConfig [optional] controls how the created server's disk is partitioned.
	DiskConfig DiskConfig `json:"OS-DCF:diskConfig,omitempty"`
}

CreateOptsExt adds a DiskConfig option to the base CreateOpts.

func (CreateOptsExt) ToServerCreateMap

func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error)

ToServerCreateMap adds the diskconfig option to the base server creation options.

type DiskConfig

type DiskConfig string

DiskConfig represents one of the two possible settings for the DiskConfig option when creating, rebuilding, or resizing servers: Auto or Manual.

const (
	// Auto builds a server with a single partition the size of the target flavor disk and
	// automatically adjusts the filesystem to fit the entire partition. Auto may only be used with
	// images and servers that use a single EXT3 partition.
	Auto DiskConfig = "AUTO"

	// Manual builds a server using whatever partition scheme and filesystem are present in the source
	// image. If the target flavor disk is larger, the remaining space is left unpartitioned. This
	// enables images to have non-EXT3 filesystems, multiple partitions, and so on, and enables you
	// to manage the disk configuration. It also results in slightly shorter boot times.
	Manual DiskConfig = "MANUAL"
)

func ExtractDiskConfig

func ExtractDiskConfig(page pagination.Page, index int) (*DiskConfig, error)

ExtractDiskConfig returns the DiskConfig setting for a specific server acquired from an servers.ExtractServers call, while iterating through a Pager.

func ExtractGet

func ExtractGet(result servers.GetResult) (*DiskConfig, error)

ExtractGet returns the disk configuration from a servers.Get call.

func ExtractRebuild

func ExtractRebuild(result servers.RebuildResult) (*DiskConfig, error)

ExtractRebuild returns the disk configuration from a servers.Rebuild call.

func ExtractUpdate

func ExtractUpdate(result servers.UpdateResult) (*DiskConfig, error)

ExtractUpdate returns the disk configuration from a servers.Update call.

type RebuildOptsExt

type RebuildOptsExt struct {
	servers.RebuildOptsBuilder

	// DiskConfig [optional] controls how the rebuilt server's disk is partitioned.
	DiskConfig DiskConfig
}

RebuildOptsExt adds a DiskConfig option to the base RebuildOpts.

func (RebuildOptsExt) ToServerRebuildMap

func (opts RebuildOptsExt) ToServerRebuildMap() (map[string]interface{}, error)

ToServerRebuildMap adds the diskconfig option to the base server rebuild options.

type ResizeOptsExt

type ResizeOptsExt struct {
	servers.ResizeOptsBuilder

	// DiskConfig [optional] controls how the resized server's disk is partitioned.
	DiskConfig DiskConfig
}

ResizeOptsExt adds a DiskConfig option to the base server resize options.

func (ResizeOptsExt) ToServerResizeMap

func (opts ResizeOptsExt) ToServerResizeMap() (map[string]interface{}, error)

ToServerResizeMap adds the diskconfig option to the base server creation options.

Jump to

Keyboard shortcuts

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