cmd

package
v1.85.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZoneFlagLong              = "zone"
	ZoneFlagShort             = "z"
	ZoneFlagMsg               = "bucket zone"
	LegacyAPIVersion          = "compute"
	DefaultEnvironment        = "api"
	DefaultConfigFileName     = "exoscale"
	DefaultInstanceType       = "medium"
	DefaultInstanceTypeFamily = "standard"
	DefaultTemplate           = "Linux Ubuntu 22.04 LTS 64-bit"
	DefaultTemplateVisibility = "public"
	DefaultSosEndpoint        = "https://sos-{zone}.exo.io"
	DefaultZone               = "ch-dk-2"
	DefaultOutputFormat       = "table"
	DefaultClientTimeout      = 20
)
View Source
const CmdFlagForceHelp = "attempt to perform the operation without prompting for confirmation"

Variables

View Source
var GCommit string
View Source
var GConfig *viper.Viper
View Source
var GConfigFilePath string
View Source
var GContext context.Context
View Source
var GCreateAlias = []string{"add"}
View Source
var GDeleteAlias = []string{"del"}
View Source
var GListAlias = []string{"ls"}

Aliases

View Source
var GRemoveAlias = []string{"rm"}
View Source
var GShowAlias = []string{"get"}
View Source
var GVersion string
View Source
var RootCmd = &cobra.Command{
	Use:           "exo",
	Short:         "Manage your Exoscale infrastructure easily",
	SilenceUsage:  true,
	SilenceErrors: true,
}

Functions

func CliCommandDefaultPreRun added in v1.85.0

func CliCommandDefaultPreRun(c cliCommand, cmd *cobra.Command, args []string) error

CliCommandDefaultPreRun is a convenience helper function that can be used in cliCommand.cmdPreRun() hooks to automagically retrieve values for the struct flags/args fields from a cobra.Command and args provided, and set corresponding fields on the struct implementing the cliCommand interface.

func CmdCheckRequiredFlags added in v1.85.1

func CmdCheckRequiredFlags(cmd *cobra.Command, flags []string) error

CmdCheckRequiredFlags evaluates the specified flags as parsed in the cobra.Command flagset to check that their value is unset (i.e. null/empty/zero, depending on the type), and returns a multierror listing all flags missing a required value.

func CmdExitOnUsageError added in v1.85.0

func CmdExitOnUsageError(cmd *cobra.Command, reason string)

func CmdSetTemplateFlagFromDefault added in v1.85.0

func CmdSetTemplateFlagFromDefault(cmd *cobra.Command)

CmdSetTemplateFlagFromDefault attempts to set the "--template" flag value based on the current active account's default template setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.

func CmdSetZoneFlagFromDefault added in v1.85.0

func CmdSetZoneFlagFromDefault(cmd *cobra.Command)

CmdSetZoneFlagFromDefault attempts to set the "--zone" flag value based on the current active account's default zone setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.

func CmdShowHelpFlags added in v1.85.0

func CmdShowHelpFlags(flags *pflag.FlagSet, prefix string)

CmdShowHelpFlags outputs flags matching the specified prefix in the provided flag set. This can be used for example to craft specialized usage help messages for hidden flags.

func ConvertIfSpecialEmptyMap added in v1.85.0

func ConvertIfSpecialEmptyMap(m map[string]string) map[string]string

func Execute

func Execute(version, commit string)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

func MustCLICommandFlagName added in v1.85.0

func MustCLICommandFlagName(c cliCommand, field interface{}) string

func RegisterCLICommand added in v1.85.0

func RegisterCLICommand(parent *cobra.Command, c cliCommand) error

RegisterCLICommand registers the specified cliCommand instance to the current CLI framework (currently Cobra).

func SwitchClientZoneV3 added in v1.85.0

func SwitchClientZoneV3(ctx context.Context, client *v3.Client, zone v3.ZoneName) (*v3.Client, error)

Types

type CliCommandSettings added in v1.85.0

type CliCommandSettings struct {
	OutputFunc func(o output.Outputter, err error) error
}

CliCommandSettings represents a CLI command settings.

func DefaultCLICmdSettings added in v1.85.0

func DefaultCLICmdSettings() CliCommandSettings

DefaultCLICmdSettings returns a cliCommandSettings struct initialized with default values.

type LimitsItemOutput

type LimitsItemOutput struct {
	Resource string `json:"resource"`
	Used     int64  `json:"used"`
	Max      int64  `json:"max"`
}

type LimitsOutput

type LimitsOutput []LimitsItemOutput

func (*LimitsOutput) ToJSON added in v1.68.0

func (o *LimitsOutput) ToJSON()

func (*LimitsOutput) ToTable added in v1.68.0

func (o *LimitsOutput) ToTable()

func (*LimitsOutput) ToText added in v1.68.0

func (o *LimitsOutput) ToText()

Jump to

Keyboard shortcuts

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