commands

package
v0.0.0-...-3ddd6c1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKey string
View Source
var ActionCommand = cli.Command{
	Name:  "action",
	Usage: "Action commands.",
	Subcommands: []cli.Command{
		{
			Name:   "show",
			Usage:  "Show an action.",
			Action: actionShow,
		},
		{
			Name:   "list",
			Usage:  "List all actions.",
			Action: actionList,
		},
	},
}
View Source
var DomainCommand = cli.Command{
	Name:  "domain",
	Usage: "Domain commands.",
	Subcommands: []cli.Command{
		DomainRecordCommand,
		{
			Name:   "show",
			Usage:  "Show an domain.",
			Action: domainShow,
		},
		{
			Name:   "list",
			Usage:  "List all domains.",
			Action: domainList,
		},
		{
			Name:   "create",
			Usage:  "Create new domain.",
			Action: domainCreate,
		},
		{
			Name:   "destroy",
			Usage:  "Destroy a domain.",
			Action: domainDestroy,
		},
	},
}
View Source
var DomainRecordCommand = cli.Command{
	Name:  "record",
	Usage: "Domain record commands.",
	Subcommands: []cli.Command{
		{
			Name:   "list",
			Usage:  "List domain records.",
			Action: domainRecordList,
		},
		{
			Name:   "show",
			Usage:  "Show domain record.",
			Action: domainRecordShow,
		},
		{
			Name:  "create",
			Usage: "Create domain record.",
			Flags: []cli.Flag{
				cli.StringFlag{Name: "type", Value: "A", Usage: "Type for domain record."},
				cli.IntFlag{Name: "priority", Value: 0, Usage: "Priority for domain record. (Type: MX, SRV)"},
				cli.IntFlag{Name: "port", Value: 0, Usage: "Port for domain record. (Type: SRV)"},
				cli.IntFlag{Name: "weight", Value: 0, Usage: "Weight for domain record. (Type: SRV)"},
			},
			Action: domainRecordCreate,
		},
		{
			Name:   "destroy",
			Usage:  "Destroy domain record.",
			Action: domainRecordDestroy,
		},
	},
}
View Source
var DropletActionCommand = cli.Command{
	Name:  "action",
	Usage: "Droplet Action Commands.",
	Subcommands: []cli.Command{
		{
			Name:   "reboot",
			Usage:  "Reboot droplet.",
			Action: dropletActionReboot,
		},
		{
			Name:   "power_cycle",
			Usage:  "Powercycle droplet.",
			Action: dropletActionPowercycle,
		},
		{
			Name:   "shutdown",
			Usage:  "Shutdown droplet.",
			Action: dropletActionShutdown,
		},
		{
			Name:   "poweroff",
			Usage:  "Power off droplet.",
			Action: dropletActionPoweroff,
		},
		{
			Name:   "poweron",
			Usage:  "Power on droplet.",
			Action: dropletActionPoweron,
		},
		{
			Name:   "password_reset",
			Usage:  "Reset password for droplet.",
			Action: dropletActionPasswordReset,
		},
		{
			Name:  "resize",
			Usage: "Resize droplet.",
			Flags: []cli.Flag{
				cli.StringFlag{Name: "size", Value: "512mb", Usage: "Size slug."},
				cli.BoolFlag{Name: "disk", Usage: "Whether to increase disk size"},
			},
			Action: dropletActionResize,
		},
	},
}
View Source
var DropletCommand = cli.Command{
	Name:  "droplet",
	Usage: "Droplet commands.",
	Subcommands: []cli.Command{
		DropletActionCommand,
		{
			Name:   "create",
			Usage:  "Create droplet.",
			Action: dropletCreate,
			Flags: []cli.Flag{
				cli.StringFlag{Name: "domain", Value: "", Usage: "Domain name to append to server name. (e.g. server01.example.com)"},
				cli.StringFlag{Name: "user-data", Value: "", Usage: "User data for creating server."},
				cli.StringFlag{Name: "ssh-keys", Value: "", Usage: "Comma seperated list of SSH Keys for server access. (e.g. --ssh-keys Work,Home)"},
				cli.StringFlag{Name: "size", Value: "512mb", Usage: "Size of Droplet."},
				cli.StringFlag{Name: "region", Value: "nyc3", Usage: "Region of Droplet."},
				cli.StringFlag{Name: "image", Value: "ubuntu-14-04-x64", Usage: "Image slug of Droplet."},
				cli.BoolFlag{Name: "backups", Usage: "Turn on backups."},
				cli.BoolFlag{Name: "ipv6", Usage: "Turn on IPv6 networking."},
				cli.BoolFlag{Name: "private-networking", Usage: "Turn on private networking."},
				cli.BoolFlag{Name: "add-region", Usage: "Append region to server name. (e.g. server01.sfo1)"},
			},
		},
		{
			Name:   "list",
			Usage:  "List droplets.",
			Action: dropletList,
		},
		{
			Name:   "show",
			Usage:  "Show droplet.",
			Action: dropletShow,
		},
		{
			Name:   "destroy",
			Usage:  "Destroy droplet.",
			Action: dropletDestroy,
			Flags: []cli.Flag{
				cli.IntFlag{Name: "id", Usage: "ID for Droplet. (e.g. 1234567)"},
			},
		},
	},
}
View Source
var OutputFormat string
View Source
var RegionCommand = cli.Command{
	Name:  "region",
	Usage: "Region commands.",
	Subcommands: []cli.Command{
		{
			Name:   "show",
			Usage:  "Show a Region.",
			Action: regionShow,
		},
		{
			Name:   "list",
			Usage:  "List All Regions.",
			Action: regionList,
		},
	},
}
View Source
var SSHCommand = cli.Command{
	Name:  "sshkey",
	Usage: "SSH Key commands.",
	Subcommands: []cli.Command{
		{
			Name:   "create",
			Usage:  "Create SSH key.",
			Action: sshCreate,
		},
		{
			Name:   "list",
			Usage:  "List all SSH keys.",
			Action: sshList,
		},
		{
			Name:   "show",
			Usage:  "Show SSH key.",
			Action: sshShow,
		},
		{
			Name:   "destroy",
			Usage:  "Destroy SSH key.",
			Action: sshDestroy,
		},
	},
}
View Source
var SizeCommand = cli.Command{
	Name:  "size",
	Usage: "Size commands.",
	Subcommands: []cli.Command{
		{
			Name:   "show",
			Usage:  "Show a size.",
			Action: sizeShow,
		},
		{
			Name:   "list",
			Usage:  "List all sizes.",
			Action: sizeList,
		},
	},
}

Functions

func WriteOutput

func WriteOutput(data interface{})

Types

type CLIOutput

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

func NewCLIOutput

func NewCLIOutput() *CLIOutput

func (*CLIOutput) Flush

func (c *CLIOutput) Flush()

func (*CLIOutput) Header

func (c *CLIOutput) Header(a ...string)

func (*CLIOutput) Writeln

func (c *CLIOutput) Writeln(format string, a ...interface{})

Jump to

Keyboard shortcuts

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