flagsets

package
v3.0.0-...-c77a060 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Force = cli.BoolFlag{
	Name:  force,
	Usage: "Do not prompt for confirmation when destroying data or increasing costs.",
}

Force is a flag common to a bunch of commands and can have a generic Usage.

View Source
var ImageInstallAuthFlags = []cli.Flag{
	cli.StringFlag{
		Name:  "authorized-keys",
		Usage: "Public keys that will be authorised to log in as root, separated by newlines.",
	},
	cli.GenericFlag{
		Name:  "authorized-keys-file",
		Usage: "Local file to read the --authorized-keys from",
		Value: new(flags.FileFlag),
	},
	cli.StringFlag{
		Name:  "root-password",
		Usage: "Password for the root/Administrator user. If unset, will be randomly generated.",
	},
}

ImageInstallAuthFlags is common to a couple of commands and contains additional additional flags for when you're passing true to PrepareImageInstall.

View Source
var ImageInstallFlags = []cli.Flag{
	cli.StringFlag{
		Name:  "firstboot-script",
		Usage: "Script which runs on the server's first boot after imaging.",
	},
	cli.GenericFlag{
		Name:  "firstboot-script-file",
		Usage: "Local file to read the firstboot script from.",
		Value: new(flags.FileFlag),
	},
	cli.StringFlag{
		Name:  "image",
		Usage: "Image to install on the server. See `bytemark images` for the list of available images.",
	},
}

ImageInstallFlags is common to a few commands and contains additonial flags that get stitched the commands that use it.

View Source
var ServerSpecFlags = []cli.Flag{
	cli.IntFlag{
		Name:  "cores",
		Value: 1,
		Usage: "Number of CPU cores",
	},
	cli.StringFlag{
		Name:  "cdrom",
		Usage: "URL pointing to an ISO which will be attached to the cloud server as a CD",
	},
	cli.GenericFlag{
		Name:  "disc",
		Usage: "One or more disc specifications. Defaults to a single 25GiB sata-grade disc",
		Value: new(flags.DiscSpecFlag),
	},
	Force,
	cli.StringFlag{
		Name:  "hwprofile",
		Usage: "The hardware profile to use. Defaults to the current modern profile. See `bytemark profiles` for a list of hardware profiles available.",
	},
	cli.BoolFlag{
		Name:  "hwprofile-locked",
		Usage: "If set, the hardware profile will be 'locked', meaning that when Bytemark updates the hardware profiles your VM will keep its current one.",
	},
	cli.GenericFlag{
		Name:  "memory",
		Value: new(flags.SizeSpecFlag),
		Usage: "How much memory the server will have available, specified in GiB or with GiB/MiB units. Defaults to 1GiB.",
	},
	cli.BoolFlag{
		Name:  "no-image",
		Usage: "Specifies that the server should not be imaged.",
	},
	cli.StringFlag{
		Name:  "backup",
		Usage: "Add a backup schedule for the first disk at the given frequency (daily, weekly, monthly, or never)",
		Value: "weekly",
	},
	cli.BoolFlag{
		Name:  "stopped",
		Usage: "If set, the server will not be started, even to image it.",
	},
	cli.StringFlag{
		Name:  "zone",
		Usage: "Which zone the server will be created in. See `bytemark zones` for the choices.",
	},
}

ServerSpecFlags are a set of flags common to commands which set up a server spec. (most notably add vm default and add server)

Functions

func BackupScheduleIntervalFromWords

func BackupScheduleIntervalFromWords(words string) (freq int, err error)

BackupScheduleIntervalFromWords deteremines the backup interval

func Forced

func Forced(c *app.Context) bool

Forced indicates whether the Force flag was set in this context

func PrepareImageInstall

func PrepareImageInstall(c *app.Context, authentication bool) (imageInstall brain.ImageInstall, defaulted bool, err error)

PrepareImageInstall is a funcion that prepares an image to be imaged on a server. set authentication to true when you wanna read in authorized-keys/-file and root-password too.

func PrepareServerSpec

func PrepareServerSpec(c *app.Context, authentication bool) (spec brain.VirtualMachineSpec, err error)

PrepareServerSpec sets up the server spec by reading in all the flags. set authentication to true when you wanna read in authorized-keys/-file and root-password too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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