Documentation ¶
Index ¶
- Variables
- func AddBoolFlag(cmd *Command, name, shorthand string, def bool, desc string, opts ...flagOpt)
- func AddIntFlag(cmd *Command, name, shorthand string, def int, desc string, opts ...flagOpt)
- func AddStringFlag(cmd *Command, name, shorthand, dflt, desc string, opts ...flagOpt)
- func AddStringMapStringFlag(cmd *Command, name, shorthand string, def map[string]string, desc string, ...)
- func AddStringSliceFlag(cmd *Command, name, shorthand string, def []string, desc string, ...)
- func AskForConfirm(message string) error
- func AskForConfirmDelete(resourceType string, count int) error
- func Execute()
- func RunAccountGet(c *CmdConfig) error
- func RunAccountRateLimit(c *CmdConfig) error
- func RunAuthInit(retrieveUserTokenFunc func() (string, error)) func(c *CmdConfig) error
- func RunAuthList(c *CmdConfig) error
- func RunAuthSwitch(c *CmdConfig) error
- func RunBalanceGet(c *CmdConfig) error
- func RunBillingHistoryList(c *CmdConfig) error
- func RunCmdActionGet(c *CmdConfig) error
- func RunCmdActionList(c *CmdConfig) error
- func RunCmdActionWait(c *CmdConfig) error
- func RunCmdTagCreate(c *CmdConfig) error
- func RunCmdTagDelete(c *CmdConfig) error
- func RunCmdTagGet(c *CmdConfig) error
- func RunCmdTagList(c *CmdConfig) error
- func RunCompletionBash(c *CmdConfig) error
- func RunCompletionZsh(c *CmdConfig) error
- func RunDomainCreate(c *CmdConfig) error
- func RunDomainDelete(c *CmdConfig) error
- func RunDomainGet(c *CmdConfig) error
- func RunDomainList(c *CmdConfig) error
- func RunFirewallAddRules(c *CmdConfig) error
- func RunFirewallAddServers(c *CmdConfig) error
- func RunFirewallAddTags(c *CmdConfig) error
- func RunFirewallCreate(c *CmdConfig) error
- func RunFirewallDelete(c *CmdConfig) error
- func RunFirewallGet(c *CmdConfig) error
- func RunFirewallList(c *CmdConfig) error
- func RunFirewallListByServer(c *CmdConfig) error
- func RunFirewallRemoveRules(c *CmdConfig) error
- func RunFirewallRemoveServers(c *CmdConfig) error
- func RunFirewallRemoveTags(c *CmdConfig) error
- func RunFirewallUpdate(c *CmdConfig) error
- func RunFloatingIPActionsAssign(c *CmdConfig) error
- func RunFloatingIPActionsGet(c *CmdConfig) error
- func RunFloatingIPActionsUnassign(c *CmdConfig) error
- func RunFloatingIPCreate(c *CmdConfig) error
- func RunFloatingIPDelete(c *CmdConfig) error
- func RunFloatingIPGet(c *CmdConfig) error
- func RunFloatingIPList(c *CmdConfig) error
- func RunImageActionsGet(c *CmdConfig) error
- func RunImageActionsTransfer(c *CmdConfig) error
- func RunImagesCreate(c *CmdConfig) error
- func RunImagesDelete(c *CmdConfig) error
- func RunImagesGet(c *CmdConfig) error
- func RunImagesList(c *CmdConfig) error
- func RunImagesListApplication(c *CmdConfig) error
- func RunImagesListDistribution(c *CmdConfig) error
- func RunImagesListUser(c *CmdConfig) error
- func RunImagesUpdate(c *CmdConfig) error
- func RunInvoicesGet(c *CmdConfig) error
- func RunInvoicesGetCSV(c *CmdConfig) error
- func RunInvoicesGetPDF(c *CmdConfig) error
- func RunInvoicesList(c *CmdConfig) error
- func RunInvoicesSummary(c *CmdConfig) error
- func RunKeyCreate(c *CmdConfig) error
- func RunKeyDelete(c *CmdConfig) error
- func RunKeyGet(c *CmdConfig) error
- func RunKeyImport(c *CmdConfig) error
- func RunKeyList(c *CmdConfig) error
- func RunKeyUpdate(c *CmdConfig) error
- func RunLoadBalancerAddForwardingRules(c *CmdConfig) error
- func RunLoadBalancerAddServers(c *CmdConfig) error
- func RunLoadBalancerCreate(c *CmdConfig) error
- func RunLoadBalancerDelete(c *CmdConfig) error
- func RunLoadBalancerGet(c *CmdConfig) error
- func RunLoadBalancerList(c *CmdConfig) error
- func RunLoadBalancerRemoveForwardingRules(c *CmdConfig) error
- func RunLoadBalancerRemoveServers(c *CmdConfig) error
- func RunLoadBalancerUpdate(c *CmdConfig) error
- func RunPluginList(c *CmdConfig) error
- func RunPluginRun(c *CmdConfig) error
- func RunProjectResourcesAssign(c *CmdConfig) error
- func RunProjectResourcesGet(c *CmdConfig) error
- func RunProjectResourcesList(c *CmdConfig) error
- func RunProjectsCreate(c *CmdConfig) error
- func RunProjectsDelete(c *CmdConfig) error
- func RunProjectsGet(c *CmdConfig) error
- func RunProjectsList(c *CmdConfig) error
- func RunProjectsUpdate(c *CmdConfig) error
- func RunRecordCreate(c *CmdConfig) error
- func RunRecordDelete(c *CmdConfig) error
- func RunRecordList(c *CmdConfig) error
- func RunRecordUpdate(c *CmdConfig) error
- func RunRegionList(c *CmdConfig) error
- func RunSSH(c *CmdConfig) error
- func RunServerActionChangeKernel(c *CmdConfig) error
- func RunServerActionDisableBackups(c *CmdConfig) error
- func RunServerActionEnableBackups(c *CmdConfig) error
- func RunServerActionEnableIPv6(c *CmdConfig) error
- func RunServerActionEnablePrivateNetworking(c *CmdConfig) error
- func RunServerActionGet(c *CmdConfig) error
- func RunServerActionPasswordReset(c *CmdConfig) error
- func RunServerActionPowerCycle(c *CmdConfig) error
- func RunServerActionPowerOff(c *CmdConfig) error
- func RunServerActionPowerOn(c *CmdConfig) error
- func RunServerActionReboot(c *CmdConfig) error
- func RunServerActionRebuild(c *CmdConfig) error
- func RunServerActionRename(c *CmdConfig) error
- func RunServerActionResize(c *CmdConfig) error
- func RunServerActionRestore(c *CmdConfig) error
- func RunServerActionShutdown(c *CmdConfig) error
- func RunServerActionSnapshot(c *CmdConfig) error
- func RunServerActions(c *CmdConfig) error
- func RunServerBackups(c *CmdConfig) error
- func RunServerCreate(c *CmdConfig) error
- func RunServerDelete(c *CmdConfig) error
- func RunServerGet(c *CmdConfig) error
- func RunServerKernels(c *CmdConfig) error
- func RunServerList(c *CmdConfig) error
- func RunServerNeighbors(c *CmdConfig) error
- func RunServerSnapshots(c *CmdConfig) error
- func RunServerTag(c *CmdConfig) error
- func RunServerUntag(c *CmdConfig) error
- func RunSizeList(c *CmdConfig) error
- func RunSnapshotDelete(c *CmdConfig) error
- func RunSnapshotGet(c *CmdConfig) error
- func RunSnapshotList(c *CmdConfig) error
- func RunVPCCreate(c *CmdConfig) error
- func RunVPCDelete(c *CmdConfig) error
- func RunVPCGet(c *CmdConfig) error
- func RunVPCList(c *CmdConfig) error
- func RunVPCUpdate(c *CmdConfig) error
- type CmdConfig
- type CmdRunner
- type Command
- func Account() *Command
- func Actions() *Command
- func Auth() *Command
- func Balance() *Command
- func BillingHistory() *Command
- func CmdBuilder(parent *Command, cr CmdRunner, cliText, shortdesc string, longdesc string, ...) *Command
- func Completion() *Command
- func Domain() *Command
- func Firewall() *Command
- func FloatingIP() *Command
- func FloatingIPAction() *Command
- func ImageAction() *Command
- func Images() *Command
- func Invoices() *Command
- func LoadBalancer() *Command
- func Plugin() *Command
- func ProjectResourcesCmd() *Command
- func Projects() *Command
- func Region() *Command
- func SSH(parent *Command) *Command
- func SSHKeys() *Command
- func Server() *Command
- func ServerAction() *Command
- func Size() *Command
- func Snapshot() *Command
- func Tags() *Command
- func VPCs() *Command
- func Version() *Command
- type UnknownSchemeError
Constants ¶
This section is empty.
Variables ¶
var ( //DoitCmd is the root level bl command that all other commands attach to DoitCmd = &Command{ Command: &cobra.Command{ Use: "bl", Short: "bl is a command line interface (CLI) for the BinaryLane API.", }, } //Writer wires up stdout for all commands to write to Writer = os.Stdout //APIURL customize API base URL APIURL string //Context current auth context Context string //Output global output format Output string //Token global authorization token Token string //Trace toggles http tracing output Trace bool )
var (
ErrUnknownTerminal = errors.New("unknown terminal")
)
ErrUnknownTerminal signifies an unknown terminal. It is returned when doit can't ascertain the current terminal type with requesting an auth token.
Functions ¶
func AddBoolFlag ¶
AddBoolFlag adds a boolean flag to a command.
func AddIntFlag ¶
AddIntFlag adds an integr flag to a command.
func AddStringFlag ¶
AddStringFlag adds a string flag to a command.
func AddStringMapStringFlag ¶
func AddStringMapStringFlag(cmd *Command, name, shorthand string, def map[string]string, desc string, opts ...flagOpt)
AddStringMapStringFlag adds a map of strings by strings flag to a command.
func AddStringSliceFlag ¶
func AddStringSliceFlag(cmd *Command, name, shorthand string, def []string, desc string, opts ...flagOpt)
AddStringSliceFlag adds a string slice flag to a command.
func AskForConfirm ¶
AskForConfirm parses and verifies user input for confirmation.
func AskForConfirmDelete ¶
AskForConfirmDelete builds a message to ask the user to confirm deleteing one or multiple resources and then sends it through to AskForConfirm to parses and verifies user input.
func RunAccountRateLimit ¶
RunAccountRateLimit retrieves API rate limits for the account.
func RunAuthInit ¶
RunAuthInit initializes the bl config. Configuration is stored in $XDG_CONFIG_HOME/bl. On Unix, if XDG_CONFIG_HOME is not set, use $HOME/.config. On Windows use %APPDATA%/bl/config.
func RunAuthList ¶
RunAuthList lists all available auth contexts from the user's bl config.
func RunAuthSwitch ¶
RunAuthSwitch changes the default context and writes it to the configuration.
func RunBillingHistoryList ¶
RunBillingHistoryList runs invoice list.
func RunCmdActionWait ¶
RunCmdActionWait waits for an action to complete or error.
func RunCompletionBash ¶
RunCompletionBash outputs completion code for bash.
func RunCompletionZsh ¶
RunCompletionZsh outputs completion code for zsh shell.
func RunDomainDelete ¶
RunDomainDelete deletes a domain by name.
func RunFirewallAddRules ¶
RunFirewallAddRules adds rules to a Firewall.
func RunFirewallAddServers ¶
RunFirewallAddServers adds servers to a Firewall.
func RunFirewallAddTags ¶
RunFirewallAddTags adds tags to a Firewall.
func RunFirewallCreate ¶
RunFirewallCreate creates a new Firewall with a given configuration.
func RunFirewallDelete ¶
RunFirewallDelete deletes a Firewall by its identifier.
func RunFirewallGet ¶
RunFirewallGet retrieves an existing Firewall by its identifier.
func RunFirewallListByServer ¶
RunFirewallListByServer lists Firewalls for a given Server.
func RunFirewallRemoveRules ¶
RunFirewallRemoveRules removes rules from a Firewall.
func RunFirewallRemoveServers ¶
RunFirewallRemoveServers removes servers from a Firewall.
func RunFirewallRemoveTags ¶
RunFirewallRemoveTags removes tags from a Firewall.
func RunFirewallUpdate ¶
RunFirewallUpdate updates an existing Firewall with new configuration.
func RunFloatingIPActionsAssign ¶
RunFloatingIPActionsAssign assigns a floating IP to a server.
func RunFloatingIPActionsGet ¶
RunFloatingIPActionsGet retrieves an action for a floating IP.
func RunFloatingIPActionsUnassign ¶
RunFloatingIPActionsUnassign unassigns a floating IP to a server.
func RunFloatingIPCreate ¶
RunFloatingIPCreate runs floating IP create.
func RunFloatingIPDelete ¶
RunFloatingIPDelete runs floating IP delete.
func RunFloatingIPGet ¶
RunFloatingIPGet retrieves a floating IP's details.
func RunFloatingIPList ¶
RunFloatingIPList runs floating IP create.
func RunImageActionsGet ¶
RunImageActionsGet retrieves an action for an image.
func RunImageActionsTransfer ¶
RunImageActionsTransfer an image.
func RunImagesCreate ¶
RunImagesCreate creates a new custom image.
func RunImagesGet ¶
RunImagesGet retrieves an image by id or slug.
func RunImagesListApplication ¶
RunImagesListApplication lists application iamges.
func RunImagesListDistribution ¶
RunImagesListDistribution lists distributions that are available.
func RunImagesListUser ¶
RunImagesListUser lists user images.
func RunInvoicesGetCSV ¶
RunInvoicesGetCSV runs an invoice get csv.
func RunInvoicesGetPDF ¶
RunInvoicesGetPDF runs an invoice get pdf.
func RunInvoicesSummary ¶
RunInvoicesSummary runs an invoice summary.
func RunLoadBalancerAddForwardingRules ¶
RunLoadBalancerAddForwardingRules adds forwarding rules to a load balancer.
func RunLoadBalancerAddServers ¶
RunLoadBalancerAddServers adds servers to a load balancer.
func RunLoadBalancerCreate ¶
RunLoadBalancerCreate creates a new load balancer with a given configuration.
func RunLoadBalancerDelete ¶
RunLoadBalancerDelete deletes a load balancer by its identifier.
func RunLoadBalancerGet ¶
RunLoadBalancerGet retrieves an existing load balancer by its identifier.
func RunLoadBalancerList ¶
RunLoadBalancerList lists load balancers.
func RunLoadBalancerRemoveForwardingRules ¶
RunLoadBalancerRemoveForwardingRules removes forwarding rules from a load balancer.
func RunLoadBalancerRemoveServers ¶
RunLoadBalancerRemoveServers removes servers from a load balancer.
func RunLoadBalancerUpdate ¶
RunLoadBalancerUpdate updates an existing load balancer with new configuration.
func RunPluginList ¶
RunPluginList is a command for listing available plugins.
func RunPluginRun ¶
RunPluginRun is a command for running a plugin.
func RunProjectResourcesAssign ¶
RunProjectResourcesAssign assigns a Project Resource.
func RunProjectResourcesGet ¶
RunProjectResourcesGet retrieves a Project Resource.
func RunProjectResourcesList ¶
RunProjectResourcesList lists the Projects.
func RunProjectsCreate ¶
RunProjectsCreate creates a new Project with a given configuration.
func RunProjectsDelete ¶
RunProjectsDelete deletes a Project with a given configuration.
func RunProjectsGet ¶
RunProjectsGet retrieves an existing Project by its identifier. Use "default" as an identifier to retrieve your default project.
func RunProjectsUpdate ¶
RunProjectsUpdate updates an existing Project with a given configuration.
func RunRecordCreate ¶
RunRecordCreate creates a domain record.
func RunRecordDelete ¶
RunRecordDelete deletes a domain record.
func RunRecordList ¶
RunRecordList list records for a domain.
func RunRecordUpdate ¶
RunRecordUpdate updates a domain record.
func RunServerActionChangeKernel ¶
RunServerActionChangeKernel changes the kernel for a server.
func RunServerActionDisableBackups ¶
RunServerActionDisableBackups disables backups for a server.
func RunServerActionEnableBackups ¶
RunServerActionEnableBackups disables backups for a server.
func RunServerActionEnableIPv6 ¶
RunServerActionEnableIPv6 enables IPv6 for a server.
func RunServerActionEnablePrivateNetworking ¶
RunServerActionEnablePrivateNetworking enables private networking for a server.
func RunServerActionGet ¶
RunServerActionGet returns a server action by id.
func RunServerActionPasswordReset ¶
RunServerActionPasswordReset resets the server root password.
func RunServerActionPowerCycle ¶
RunServerActionPowerCycle power cycles a server.
func RunServerActionPowerOff ¶
RunServerActionPowerOff turns server power off.
func RunServerActionPowerOn ¶
RunServerActionPowerOn turns server power on.
func RunServerActionReboot ¶
RunServerActionReboot reboots a server.
func RunServerActionRebuild ¶
RunServerActionRebuild rebuilds a server using an image id or slug.
func RunServerActionRename ¶
RunServerActionRename renames a server.
func RunServerActionResize ¶
RunServerActionResize resizes a server giving a size slug and optionally expands the disk.
func RunServerActionRestore ¶
RunServerActionRestore restores a server using an image id.
func RunServerActionShutdown ¶
RunServerActionShutdown shuts a server down.
func RunServerActionSnapshot ¶
RunServerActionSnapshot creates a snapshot for a server.
func RunServerActions ¶
RunServerActions returns a list of actions for a server.
func RunServerBackups ¶
RunServerBackups returns a list of backup images for a server.
func RunServerDelete ¶
RunServerDelete destroy a server by id.
func RunServerKernels ¶
RunServerKernels returns a list of available kernels for a server.
func RunServerList ¶
RunServerList returns a list of servers.
func RunServerNeighbors ¶
RunServerNeighbors returns a list of server neighbors.
func RunServerSnapshots ¶
RunServerSnapshots returns a list of available snapshots for a server.
func RunSnapshotDelete ¶
RunSnapshotDelete destroys snapshot(s) by id
func RunSnapshotList ¶
RunSnapshotList returns a list of snapshots
func RunVPCCreate ¶
RunVPCCreate creates a new VPC with a given configuration.
func RunVPCDelete ¶
RunVPCDelete deletes a VPC by its identifier.
func RunVPCUpdate ¶
RunVPCUpdate updates an existing VPC with new configuration.
Types ¶
type CmdConfig ¶
type CmdConfig struct { NS string Doit blcli.Config Out io.Writer Args []string // services Keys func() bl.KeysService Sizes func() bl.SizesService Regions func() bl.RegionsService Images func() bl.ImagesService ImageActions func() bl.ImageActionsService LoadBalancers func() bl.LoadBalancersService FloatingIPs func() bl.FloatingIPsService FloatingIPActions func() bl.FloatingIPActionsService Servers func() bl.ServersService ServerActions func() bl.ServerActionsService Domains func() bl.DomainsService Actions func() bl.ActionsService Account func() bl.AccountService Balance func() bl.BalanceService BillingHistory func() bl.BillingHistoryService Invoices func() bl.InvoicesService Tags func() bl.TagsService Snapshots func() bl.SnapshotsService Firewalls func() bl.FirewallsService Projects func() bl.ProjectsService VPCs func() bl.VPCsService // contains filtered or unexported fields }
CmdConfig is a command configuration.
func NewCmdConfig ¶
func NewCmdConfig(ns string, dc blcli.Config, out io.Writer, args []string, initClient bool) (*CmdConfig, error)
NewCmdConfig creates an instance of a CmdConfig.
func (*CmdConfig) Display ¶
func (c *CmdConfig) Display(d displayers.Displayable) error
Display displays the output from a command.
type Command ¶
Command is a wrapper around cobra.Command that adds bl specific functionality.
func BillingHistory ¶
func BillingHistory() *Command
BillingHistory creates the BillingHistory commands hierarchy.
func CmdBuilder ¶
func CmdBuilder(parent *Command, cr CmdRunner, cliText, shortdesc string, longdesc string, out io.Writer, options ...cmdOption) *Command
CmdBuilder builds a new command.
func FloatingIP ¶
func FloatingIP() *Command
FloatingIP creates the command hierarchy for floating ips.
func FloatingIPAction ¶
func FloatingIPAction() *Command
FloatingIPAction creates the floating IP action command.
func ProjectResourcesCmd ¶
func ProjectResourcesCmd() *Command
ProjectResourcesCmd creates the project resources commands hierarchy.
func (*Command) AddCommand ¶
AddCommand adds child commands and adds child commands for cobra as well.
func (*Command) ChildCommands ¶
ChildCommands returns the child commands.
type UnknownSchemeError ¶
type UnknownSchemeError struct {
Scheme string
}
UnknownSchemeError signifies an unknown HTTP scheme.
func (*UnknownSchemeError) Error ¶
func (use *UnknownSchemeError) Error() string
Source Files ¶
- account.go
- actions.go
- auth.go
- balance.go
- billing_history.go
- command.go
- command_config.go
- command_option.go
- completion.go
- confirmation.go
- doit.go
- domains.go
- errors.go
- extract.go
- firewalls.go
- floating_ip_actions.go
- floating_ips.go
- image_actions.go
- images.go
- invoices.go
- load_balancers.go
- plugin.go
- projects.go
- regions.go
- server_actions.go
- servers.go
- sizes.go
- snapshots.go
- ssh.go
- sshkeys.go
- tags.go
- util.go
- version.go
- vpcs.go